-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix multiarch support to be... (#99)
* chore: fix multiarch support to be consistent with the way che-dashbord does it Change-Id: I99b2b296a5242855ffe7d39df1c622c846e36330 Signed-off-by: Nick Boldt <[email protected]> * remove unused method Change-Id: I563eef297041c6727da2c3ba59c3fbd11070cb02 Signed-off-by: Nick Boldt <[email protected]> --------- Signed-off-by: Nick Boldt <[email protected]>
- Loading branch information
Showing
5 changed files
with
250 additions
and
157 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# | ||
# Copyright (c) 2023 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
# | ||
|
||
name: Che Configbump Next Build | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: {} | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
IMAGE: quay.io/che-incubator/configbump | ||
|
||
jobs: | ||
|
||
build-images: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [amd64,arm64] | ||
outputs: | ||
amd64: ${{ steps.result.outputs.amd64 }} | ||
arm64: ${{ steps.result.outputs.arm64 }} | ||
steps: | ||
- | ||
name: "Checkout Che Configbump source code" | ||
uses: actions/checkout@v3 | ||
- | ||
name: "Set up QEMU" | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: "Set up Docker Buildx ${{ matrix.arch }}" | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: "Login to quay.io" | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
- | ||
name: "Build and push ${{ matrix.arch }}" | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./build/dockerfiles/Dockerfile | ||
platforms: linux/${{ matrix.arch }} | ||
push: true | ||
provenance: false | ||
tags: ${{ env.IMAGE }}:${{ matrix.arch }}-next | ||
- | ||
id: result | ||
name: "Build result outputs version" | ||
if: ${{ success() }} | ||
run: echo "${{ matrix.arch }}=${{ matrix.arch }}-next" >> $GITHUB_OUTPUT | ||
|
||
create-manifest: | ||
if: always() | ||
needs: build-images | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- | ||
name: "Docker quay.io Login" | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
- | ||
name: "Create and push manifest" | ||
run: | | ||
AMEND="" | ||
AMD64_VERSION="${{ needs['build-images'].outputs.amd64 }}" | ||
if [ -n "$AMD64_VERSION" ]; then | ||
AMEND+=" --amend ${{ env.IMAGE }}:$AMD64_VERSION"; | ||
fi | ||
ARM64_VERSION="${{ needs['build-images'].outputs.arm64 }}" | ||
if [ -n "$ARM64_VERSION" ]; then | ||
AMEND+=" --amend ${{ env.IMAGE }}:$ARM64_VERSION"; | ||
fi | ||
if [ -z "$AMEND" ]; then | ||
echo "[!] The job 'build-images' didn't provide any outputs. Can't create the manifest list." | ||
exit 1; | ||
fi | ||
docker manifest create ${{ env.IMAGE }}:next $AMEND | ||
docker manifest push ${{ env.IMAGE }}:next |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -11,31 +11,109 @@ | |
# | ||
|
||
name: Release Che Configbump | ||
|
||
on: | ||
workflow_dispatch: | ||
# Inputs the workflow accepts. | ||
inputs: | ||
version: | ||
description: 'The version that is going to be released. Should be in format 7.y.z' | ||
required: true | ||
noCommit: | ||
description: 'If true, will not commit the version bump changes' | ||
default: '' | ||
default: '7.y.z' | ||
forceRecreateTags: | ||
description: If true, tags will be recreated. Use with caution | ||
required: false | ||
default: 'false' | ||
|
||
env: | ||
IMAGE: quay.io/che-incubator/configbump | ||
|
||
jobs: | ||
build: | ||
name: Create Release | ||
|
||
build-images: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [amd64,arm64] | ||
outputs: | ||
amd64: ${{ steps.result.outputs.amd64 }} | ||
arm64: ${{ steps.result.outputs.arm64 }} | ||
steps: | ||
- name: Checkout code | ||
- | ||
name: "Checkout Che Dashboard source code" | ||
uses: actions/checkout@v3 | ||
- | ||
name: "Set up QEMU" | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: "Set up Docker Buildx ${{ matrix.arch }}" | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: "Docker quay.io Login" | ||
uses: docker/login-action@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Check existing tags | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
- | ||
name: "Build and push ${{ matrix.arch }}" | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./build/dockerfiles/Dockerfile | ||
platforms: linux/${{ matrix.arch }} | ||
push: true | ||
provenance: false | ||
tags: ${{ env.IMAGE }}:${{ github.event.inputs.version }}-${{ matrix.arch }} | ||
- | ||
id: result | ||
name: "Build result outputs version" | ||
if: ${{ success() }} | ||
run: echo "${{ matrix.arch }}=${{ github.event.inputs.version }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT | ||
|
||
create-manifest: | ||
needs: build-images | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- | ||
name: "Docker quay.io Login" | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
- | ||
name: "Create and push manifest" | ||
run: | | ||
AMD64_VERSION="${{ needs['build-images'].outputs.amd64 }}" | ||
ARM64_VERSION="${{ needs['build-images'].outputs.arm64 }}" | ||
if [[ -z "$AMD64_VERSION" || \ | ||
-z "$ARM64_VERSION" ]]; then | ||
echo "[!] The job 'build-images' fails on some of the architectures. Can't create complete manifest."; | ||
exit 1; | ||
fi | ||
AMEND="" | ||
AMEND+=" --amend ${{ env.IMAGE }}:$AMD64_VERSION"; | ||
AMEND+=" --amend ${{ env.IMAGE }}:$ARM64_VERSION"; | ||
docker manifest create ${{ env.IMAGE }}:${{ github.event.inputs.version }} $AMEND | ||
docker manifest push ${{ env.IMAGE }}:${{ github.event.inputs.version }} | ||
- | ||
id: result | ||
name: "Manifest result" | ||
if: ${{ success() }} | ||
run: echo "Manifest was created and pushed successfully" | ||
|
||
tag-release: | ||
needs: create-manifest | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- | ||
name: "Checkout source code" | ||
uses: actions/checkout@v3 | ||
- | ||
name: Check existing tags | ||
run: | | ||
set +e | ||
RECREATE_TAGS=${{ github.event.inputs.forceRecreateTags }} | ||
|
@@ -52,29 +130,14 @@ jobs: | |
else | ||
echo "[INFO] No existing tags detected for $VERSION" | ||
fi | ||
- name: Login to quay.io | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
registry: quay.io | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Create Release | ||
- | ||
name: "Tag release" | ||
run: | | ||
git config --global user.name "Mykhailo Kuznietsov" | ||
git config --global user.email "[email protected]" | ||
git config --global pull.rebase true | ||
export GITHUB_TOKEN=${{ secrets.CHE_INCUBATOR_BOT_GITHUB_TOKEN }} | ||
NO_COMMIT=${{ github.event.inputs.noCommit}} | ||
if [[ $NO_COMMIT == "true" ]]; then | ||
NO_COMMIT="--no-commit" | ||
else | ||
NO_COMMIT= | ||
fi | ||
/bin/bash make-release.sh --version ${{ github.event.inputs.version }} --trigger-release $NO_COMMIT | ||
/bin/bash make-release.sh --version ${{ github.event.inputs.version }} --tag-release | ||
# - name: Create failure MM message | ||
# if: ${{ failure() }} | ||
# run: | | ||
|
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
Oops, something went wrong.