Skip to content

Commit

Permalink
last tweaks to create downstream images
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed Apr 8, 2024
1 parent f439d98 commit eef58e3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 38 deletions.
47 changes: 23 additions & 24 deletions .github/workflows/workflow-docker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,37 +82,36 @@ jobs:
echo "[debug] Generated app name is '${app_name}'"
echo "app_name=$app_name" >> $GITHUB_OUTPUT
id: generate_app_name
# - name: Build amd64 image and export to Docker for testing
# uses: docker/build-push-action@v5
# with:
# context: .
# load: true
# tags: ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}
# - name: Run tests using previously built image
# shell: bash
# run: |
# git_clone_scripts_dest="/tmp/scripts"
# git_clone_scripts_repo="https://github.com/binhex/scripts.git"
# git clone "${git_clone_scripts_repo}" "${git_clone_scripts_dest}"
# "${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --app-name ${{ steps.generate_app_name.outputs.app_name }} --image-name "ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}"
# # note this will re-use the internal cached amd64 image from the previous build
# - name: Build multi-arch Docker image, tag and push to registries
# uses: docker/build-push-action@v5
# with:
# context: .
# platforms: linux/amd64,linux/arm64
# push: true
# tags: ${{ github.repository }}:latest, ${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, quay.io/${{ github.repository }}:latest, quay.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, registry.gitlab.com/${{ github.repository }}:latest, registry.gitlab.com/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
# build-args: |
# RELEASETAG=${{ steps.identify_github_release_tag_name.outputs.tag }}
- name: Build amd64 image and export to Docker for testing
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}
- name: Run tests using previously built image
shell: bash
run: |
git_clone_scripts_dest="/tmp/scripts"
git_clone_scripts_repo="https://github.com/binhex/scripts.git"
git clone "${git_clone_scripts_repo}" "${git_clone_scripts_dest}"
"${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --app-name ${{ steps.generate_app_name.outputs.app_name }} --image-name "ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}"
# note this will re-use the internal cached amd64 image from the previous build
- name: Build multi-arch Docker image, tag and push to registries
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ github.repository }}:latest, ${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, quay.io/${{ github.repository }}:latest, quay.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, registry.gitlab.com/${{ github.repository }}:latest, registry.gitlab.com/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
build-args: |
RELEASETAG=${{ steps.identify_github_release_tag_name.outputs.tag }}
- name: Trigger build of int images
uses: nick-fields/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
retry_wait_seconds: 120
command: |
set -x
# login to github
echo "${{ secrets.TDB_PAT }}" | gh auth login --with-token
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/workflow-docker-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,16 @@ jobs:
max_attempts: 3
retry_wait_seconds: 120
command: |
# login to github
echo "${{ secrets.TDB_PAT }}" | gh auth login --with-token
# construct array of repos to trigger builds for
declare -a int_repos_array=("arch-int-vpn" "arch-int-gui" "arch-devel")
# process repos and create release (triggers action to build)
for int_repo in "${int_repos_array[@]}"; do
curl -v -i -X POST \
-H "Content-Type:application/json" \
-H \
"Authorization: token ${{ secrets.TDB_PAT }}" \
"https://api.github.com/repos/binhex/${int_repo}/releases" \
-d '{\
"tag_name": "'${{ steps.identify_github_release_tag_name.outputs.tag }}'",\
"target_commitish": "master",\
"name": "API/URL triggered release",\
"body": "'${{ steps.identify_github_release_tag_name.outputs.tag }}'",\
"draft": false,\
"prerelease": false\
}'
done
# create release using gh cli
# note --target is not specified as it maybe 'main' or 'master'
gh release create "${{ steps.identify_github_release_tag_name.outputs.tag }}" --repo "binhex/${int_repo}" --notes "API/URL triggered release"
done

0 comments on commit eef58e3

Please sign in to comment.