Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenhorsman committed Oct 4, 2024
1 parent 3edf19d commit ae92c57
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
41 changes: 38 additions & 3 deletions .github/workflows/caa_build_and_push_per_arch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,37 @@ defaults:
working-directory: src/cloud-api-adaptor

jobs:
upload_tags:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ inputs.git_ref }}"

- name: Create tags.txt
run: |
# Matches expected logic in ./hack/build.sh
commit=$(git rev-parse HEAD)
dev_tags=${{ inputs.dev_tags }}
release_tags=${{ inputs.release_tags }}
echo "dev_tags=${dev_tags:-latest,dev-${commit}}" > tags.txt
echo "release_tags=${release_tags:-${commit}}" >> tags.txt
# debug
cat tags.txt
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: image-tags
retention-days: 1
path: |
src/cloud-api-adaptor/tags.txt
build_push_job:
name: build and push
needs: [upload_tags]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -87,13 +116,16 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

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

- name: Install build dependencies
if: ${{ startsWith(matrix.type, 'dev-') }}
run: |
sudo apt-get update -y
sudo apt-get install -y libvirt-dev
- name: Login to quay Container Registry
if: ${{ startsWith(inputs.registry, 'quay.io') }}
uses: docker/login-action@v3
Expand Down Expand Up @@ -136,15 +168,18 @@ jobs:
echo "Build and push release image without libvirt"
cd src/cloud-api-adaptor && ARCHES=${{matrix.arches}} RELEASE_BUILD=true RELEASE_TAGS=${{ inputs.release_tags}} make image-with-arch registry=${{ inputs.registry }}
# artifact name can't have a / in
- name: Santise arches
run: echo "ARCHES=${{matrix.arches}} | tr / -" >> $GITHUB_ENV

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: image-artifacts
name: image-artifacts-${{matrix.type}}-${ARCHES}
retention-days: 1
path: |
src/cloud-api-adaptor/tags.txt
src/cloud-api-adaptor/tags-architectures-*
manifest_job:
name: generate images manifest
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions src/cloud-api-adaptor/hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ release_tags=${RELEASE_TAGS:-"${commit}"}

supported_arches=${ARCHES:-"linux/amd64"}

tags_file="${script_dir}/../tags.txt"
# tags_file="${script_dir}/../tags.txt"
arch_file_prefix="${script_dir}/../tags-architectures-"
arch_prefix="linux/"

Expand Down Expand Up @@ -84,8 +84,8 @@ function build_caa_payload_arch_specific() {

arch=${supported_arches#"$arch_prefix"}

echo "dev_tags="$dev_tags > "$tags_file"
echo "release_tags="$release_tags >> "$tags_file"
# echo "dev_tags="$dev_tags > "$tags_file"
# echo "release_tags="$release_tags >> "$tags_file"
echo "arch="$arch >> "$arch_file_prefix$arch"

local tag_string
Expand Down

0 comments on commit ae92c57

Please sign in to comment.