Skip to content

Commit

Permalink
Merge pull request #59 from leojonathanoh/enhancement/add-packer-1.11…
Browse files Browse the repository at this point in the history
….2-qemu-virtualbox-7.0.20-and-7.1.2-variants

Enhancement: Add packer 1.11.2 qemu, virtualbox 7.0.20, and virtualbox 7.1.2 variants
  • Loading branch information
leojonathanoh authored Oct 5, 2024
2 parents 61fbdc4 + 0e42ba5 commit 129c87e
Show file tree
Hide file tree
Showing 19 changed files with 872 additions and 49 deletions.
325 changes: 324 additions & 1 deletion .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,327 @@ jobs:
run: |
git diff --exit-code
build-1-11-2-ubuntu-22-04:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-1.11.2-ubuntu-22.04-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-1.11.2-ubuntu-22.04-
${{ runner.os }}-buildx-
- name: Login to Docker Hub registry
# Run on master and tags
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}

# This step generates the docker tags
- name: Prepare
id: prep-1-11-2-sops-ubuntu-22-04
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="1.11.2-sops-ubuntu-22.04"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT
echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: 1.11.2-sops-ubuntu-22.04 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-ubuntu-22.04
platforms: linux/amd64
push: false
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.11.2-sops-ubuntu-22.04 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-ubuntu-22.04
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.11.2-sops-ubuntu-22.04 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-ubuntu-22.04
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-ubuntu-22-04.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# This step generates the docker tags
- name: Prepare
id: prep-1-11-2-sops-qemu-ubuntu-22-04
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="1.11.2-sops-qemu-ubuntu-22.04"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT
echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: 1.11.2-sops-qemu-ubuntu-22.04 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-qemu-ubuntu-22.04
platforms: linux/amd64
push: false
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-qemu-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-qemu-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.11.2-sops-qemu-ubuntu-22.04 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-qemu-ubuntu-22.04
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-qemu-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-qemu-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.11.2-sops-qemu-ubuntu-22.04 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-qemu-ubuntu-22.04
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-qemu-ubuntu-22-04.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-qemu-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-qemu-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# This step generates the docker tags
- name: Prepare
id: prep-1-11-2-sops-virtualbox-7-0-20-ubuntu-22-04
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="1.11.2-sops-virtualbox-7.0.20-ubuntu-22.04"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT
echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: 1.11.2-sops-virtualbox-7.0.20-ubuntu-22.04 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-virtualbox-7.0.20-ubuntu-22.04
platforms: linux/amd64
push: false
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-0-20-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-0-20-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.11.2-sops-virtualbox-7.0.20-ubuntu-22.04 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-virtualbox-7.0.20-ubuntu-22.04
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-0-20-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-0-20-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.11.2-sops-virtualbox-7.0.20-ubuntu-22.04 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-virtualbox-7.0.20-ubuntu-22.04
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-0-20-ubuntu-22-04.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-0-20-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-0-20-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# This step generates the docker tags
- name: Prepare
id: prep-1-11-2-sops-virtualbox-7-1-2-ubuntu-22-04
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="1.11.2-sops-virtualbox-7.1.2-ubuntu-22.04"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT
echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: 1.11.2-sops-virtualbox-7.1.2-ubuntu-22.04 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-virtualbox-7.1.2-ubuntu-22.04
platforms: linux/amd64
push: false
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-1-2-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-1-2-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.11.2-sops-virtualbox-7.1.2-ubuntu-22.04 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-virtualbox-7.1.2-ubuntu-22.04
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-1-2-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-1-2-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.11.2-sops-virtualbox-7.1.2-ubuntu-22.04 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/1.11.2-sops-virtualbox-7.1.2-ubuntu-22.04
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-1-2-ubuntu-22-04.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-1-2-ubuntu-22-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-11-2-sops-virtualbox-7-1-2-ubuntu-22-04.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build-1-7-7-ubuntu-16-04:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -446,7 +767,6 @@ jobs:
${{ github.repository }}:${{ steps.prep-1-7-7-sops-ubuntu-20-04.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-7-7-sops-ubuntu-20-04.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-7-7-sops-ubuntu-20-04.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

Expand Down Expand Up @@ -862,6 +1182,7 @@ jobs:
update-draft-release:
needs:
- build-1-11-2-ubuntu-22-04
- build-1-7-7-ubuntu-16-04
- build-1-7-7-ubuntu-18-04
- build-1-7-7-ubuntu-20-04
Expand All @@ -878,6 +1199,7 @@ jobs:

publish-draft-release:
needs:
- build-1-11-2-ubuntu-22-04
- build-1-7-7-ubuntu-16-04
- build-1-7-7-ubuntu-18-04
- build-1-7-7-ubuntu-20-04
Expand All @@ -896,6 +1218,7 @@ jobs:

update-dockerhub-description:
needs:
- build-1-11-2-ubuntu-22-04
- build-1-7-7-ubuntu-16-04
- build-1-7-7-ubuntu-18-04
- build-1-7-7-ubuntu-20-04
Expand Down
Loading

0 comments on commit 129c87e

Please sign in to comment.