-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from docksal/develop
Release 1.4.0
- Loading branch information
Showing
6 changed files
with
57 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,18 @@ defaults: | |
|
||
env: | ||
IMAGE: docksal/mariadb | ||
LATEST_VERSION: "10.11" | ||
#DOCKSAL_VERSION: develop | ||
|
||
jobs: | ||
build: | ||
name: "Build: ${{ matrix.version }}/${{ matrix.arch }}" | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
fail-fast: false # Don't cancel other jobs if one fails | ||
matrix: | ||
include: | ||
- | ||
arch: amd64 | ||
version: "10.3" | ||
- | ||
arch: arm64 | ||
version: "10.3" | ||
- | ||
arch: amd64 | ||
version: "10.4" | ||
|
@@ -53,6 +48,12 @@ jobs: | |
- | ||
arch: arm64 | ||
version: "10.6" | ||
- | ||
arch: amd64 | ||
version: "10.11" | ||
- | ||
arch: arm64 | ||
version: "10.11" | ||
|
||
env: | ||
ARCH: ${{ matrix.arch }} | ||
|
@@ -64,7 +65,7 @@ jobs: | |
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- | ||
name: Environment variables | ||
run: | | ||
|
@@ -73,39 +74,27 @@ jobs: | |
echo BUILD_IMAGE_TAG="${IMAGE}:${VERSION_PREFIX}${VERSION}-build" | tee -a ${GITHUB_ENV} | ||
# Pull the host public SSH key at runtime instead of relying on a static value stored in secrets. | ||
echo ARM64_HOST_SSH_CERT="$(ssh-keyscan -t rsa ${{ secrets.ARM64_HOST }} 2>/dev/null)" | tee -a ${GITHUB_ENV} | ||
# - | ||
# # Switch docker context to a remote arm64 host | ||
# # Used for building heavy images that take too long to build using QEMU + for native arm64 testing. | ||
# name: Switch to arm64 builder host | ||
# if: ${{ env.ARCH == 'arm64' }} | ||
# uses: arwynfr/actions-docker-context@v2 | ||
# with: | ||
# docker_host: "ssh://ubuntu@${{ secrets.ARM64_HOST }}" | ||
# context_name: arm64-host | ||
# ssh_key: "${{ secrets.ARM64_HOST_SSH_KEY }}" | ||
# ssh_cert: "${{ env.ARM64_HOST_SSH_CERT }}" | ||
# use_context: true | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Check Docker | ||
run: | | ||
docker version | ||
docker info | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
# Build and cache image in the registry | ||
name: Build image | ||
uses: docker/build-push-action@v2 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ${{ env.BUILD_DIR }} | ||
file: ${{ env.BUILD_DIR }}/Dockerfile | ||
|
@@ -116,28 +105,31 @@ jobs: | |
# Push intermediate arch-specific build tag to repo | ||
tags: ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-${{ env.ARCH }} | ||
push: ${{ github.event_name != 'pull_request' }} # Don't push for PRs | ||
# Disable automatic image attestations | ||
# With image attestations enabled, the image tag pushed to the registry is a manifest list. | ||
# That makes it impossible to stitch different platform images together in a manifest list, since you | ||
# cannot have a manifest list of manifest lists. | ||
# See https://docs.docker.com/build/attestations/attestation-storage/ | ||
# TODO: Refactor to allow for image attestations | ||
provenance: false | ||
sbom: false | ||
# BUILD_IMAGE_TAG - persistent multi-arch tag, updated at the end of the build (success or failure) | ||
cache-from: type=registry,ref=${{ env.BUILD_IMAGE_TAG }} | ||
cache-to: type=inline # Write the cache metadata into the image configuration | ||
# Use registry cache with max mode to cahce all image layers in the registry | ||
cache-from: type=registry,ref=${{ env.BUILD_IMAGE_TAG }}-cache-${{ env.ARCH }} | ||
cache-to: type=registry,ref=${{ env.BUILD_IMAGE_TAG }}-cache-${{ env.ARCH }},mode=max | ||
|
||
test: | ||
name: "Test: ${{ matrix.version }}/${{ matrix.arch }}" | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
needs: build | ||
|
||
strategy: | ||
fail-fast: false # Don't cancel other jobs if one fails | ||
matrix: | ||
include: | ||
- | ||
arch: amd64 | ||
version: "10.3" | ||
# Disabled arm64 tests. | ||
# TODO: Refactor tests to be compatible with a remote host test runner. | ||
# TODO: Remember to re-enabled the test results check in "push". | ||
# - | ||
# arch: arm64 | ||
# version: "10.3" | ||
- | ||
arch: amd64 | ||
version: "10.4" | ||
|
@@ -156,6 +148,12 @@ jobs: | |
# - | ||
# arch: arm64 | ||
# version: "10.6" | ||
- | ||
arch: amd64 | ||
version: "10.11" | ||
# - | ||
# arch: arm64 | ||
# version: "10.11" | ||
|
||
env: | ||
ARCH: ${{ matrix.arch }} | ||
|
@@ -165,12 +163,10 @@ jobs: | |
steps: | ||
- | ||
name: Setup Bats | ||
uses: mig4/setup-bats@v1 | ||
with: | ||
bats-version: "1.3.0" | ||
uses: bats-core/[email protected] | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- | ||
name: Environment variables | ||
run: | | ||
|
@@ -179,33 +175,11 @@ jobs: | |
echo BUILD_IMAGE_TAG="${IMAGE}:${VERSION_PREFIX}${VERSION}-build" | tee -a ${GITHUB_ENV} | ||
# Pull the host public SSH key at runtime instead of relying on a static value stored in secrets. | ||
echo ARM64_HOST_SSH_CERT="$(ssh-keyscan -t rsa ${{ secrets.ARM64_HOST }} 2>/dev/null)" | tee -a ${GITHUB_ENV} | ||
- | ||
# Switch docker context to a remote arm64 host | ||
# Used for building heavy images that take too long to build using QEMU + for native arm64 testing. | ||
name: Switch to arm64 builder host | ||
if: ${{ env.ARCH == 'arm64' }} | ||
uses: arwynfr/actions-docker-context@v2 | ||
with: | ||
docker_host: "ssh://ubuntu@${{ secrets.ARM64_HOST }}" | ||
context_name: arm64-host | ||
ssh_key: "${{ secrets.ARM64_HOST_SSH_KEY }}" | ||
ssh_cert: "${{ env.ARM64_HOST_SSH_CERT }}" | ||
use_context: true | ||
- | ||
name: Check Docker | ||
run: | | ||
docker version | ||
docker info | ||
# - | ||
# name: Test preparations | ||
# working-directory: ${{ env.BUILD_CONTEXT }} | ||
# env: | ||
# BUILD_IMAGE_TAG: ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-${{ env.ARCH }} | ||
# run: | | ||
# # Install Docksal using the passed DOCKSAL_VERSION value | ||
# curl -sSL http://get.docksal.io | bash | ||
# # Start the service using the build image tag | ||
# make start | ||
- | ||
# Run tests | ||
name: Test | ||
|
@@ -222,14 +196,16 @@ jobs: | |
# Dynamic variable names cannot be used when mapping step outputs to job outputs. | ||
# Step outputs cannot be accessed directly from other jobs. Dead end. | ||
- name: Store test results | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
name: test-results-${{ env.GIT_SHA7 }}-${{ env.VERSION_PREFIX }}${{ env.VERSION }}-${{ env.ARCH }} | ||
path: ${{ github.workspace }}/test-results-*.txt | ||
if-no-files-found: error | ||
overwrite: true | ||
|
||
push: | ||
name: "Push: ${{ matrix.version }}/multi" | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
# Wait for test to either succeed or fail | ||
needs: test | ||
|
@@ -238,10 +214,10 @@ jobs: | |
strategy: | ||
matrix: | ||
version: | ||
- "10.3" | ||
- "10.4" | ||
- "10.5" | ||
- "10.6" | ||
- "10.11" | ||
|
||
env: | ||
VERSION_PREFIX: "" | ||
|
@@ -250,27 +226,26 @@ jobs: | |
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- | ||
name: Environment variables | ||
run: | | ||
# Export variables for further steps | ||
echo GIT_SHA7="${GITHUB_SHA:0:7}" | tee -a ${GITHUB_ENV} | ||
echo BUILD_IMAGE_TAG="${IMAGE}:${VERSION_PREFIX}${VERSION}-build" | tee -a ${GITHUB_ENV} | ||
# Pull the host public SSH key at runtime instead of relying on a static value stored in secrets. | ||
echo ARM64_HOST_SSH_CERT="$(ssh-keyscan -t rsa ${{ secrets.ARM64_HOST }} 2>/dev/null)" | tee -a ${GITHUB_ENV} | ||
- | ||
# Login to Docker Hub | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Retrieve test results | ||
uses: actions/download-artifact@v2 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: test-results | ||
pattern: test-results-${{ env.GIT_SHA7 }}-* | ||
merge-multiple: true | ||
- | ||
# Generate persistent tags (edge, stable, release) | ||
name: Docker image tags | ||
|
@@ -307,5 +282,5 @@ jobs: | |
docker manifest push ${tag} | ||
done | ||
# Clean up intermediate arch-specific image tags (DockerHub only) | ||
.github/scripts/docker-tag-delete.sh ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-amd64 | ||
.github/scripts/docker-tag-delete.sh ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-arm64 | ||
.github/scripts/docker-tag-delete.sh "${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-amd64" | ||
.github/scripts/docker-tag-delete.sh "${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-arm64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters