From 79015ce6a8942d493d46b2bff2286d342e2acff9 Mon Sep 17 00:00:00 2001 From: Eric Williams Date: Thu, 26 Nov 2020 16:35:13 -0500 Subject: [PATCH 1/3] Add a GitHub action based release job Part of eclipse/che#18072 Signed-off-by: Eric Williams --- ...ild-jobs.yml => nightly-build-publish.yml} | 4 +- .github/workflows/release-build-publish.yml | 52 +++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) rename .github/workflows/{build-jobs.yml => nightly-build-publish.yml} (96%) create mode 100644 .github/workflows/release-build-publish.yml diff --git a/.github/workflows/build-jobs.yml b/.github/workflows/nightly-build-publish.yml similarity index 96% rename from .github/workflows/build-jobs.yml rename to .github/workflows/nightly-build-publish.yml index e4b459081..800c9bbff 100644 --- a/.github/workflows/build-jobs.yml +++ b/.github/workflows/nightly-build-publish.yml @@ -7,7 +7,7 @@ # SPDX-License-Identifier: EPL-2.0 # -name: Build/Push +name: Build/Publish on: push: @@ -15,7 +15,7 @@ on: - master jobs: - nightly-build-push: + nightly-build-publish: runs-on: ubuntu-latest steps: - name: Clone source code diff --git a/.github/workflows/release-build-publish.yml b/.github/workflows/release-build-publish.yml new file mode 100644 index 000000000..1bbf5708e --- /dev/null +++ b/.github/workflows/release-build-publish.yml @@ -0,0 +1,52 @@ +# +# Copyright (c) 2020 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 +# + +name: Build/Publish + +on: + push: + branches: + - release + paths: + - VERSION + +jobs: + release-build-publish: + runs-on: ubuntu-latest + steps: + - name: Clone source code + uses: actions/checkout@v1 + with: + fetch-depth: 1 + ref: release + + - name: Login to quay.io + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push patched base images and happy path image + run: | + export TAG=$(head -n 1 VERSION) + /bin/bash arbitrary-users-patch/happy-path/build_happy_path_image.sh --push + /bin/bash arbitrary-users-patch/build_images.sh --push + + - name: Build and push images + run: | + SHORT_SHA1=$(git rev-parse --short HEAD) + VERSION=$(head -n 1 VERSION) + IMAGE=che-devfile-registry + DOCKERFILE_PATH=./build/dockerfiles/Dockerfile + docker build -t ${IMAGE} -f ${DOCKERFILE_PATH} --build-arg PATCHED_IMAGES_TAG=${VERSION} --target registry . + docker tag ${IMAGE} quay.io/eclipse/${IMAGE}:${SHORT_SHA1} + docker push quay.io/eclipse/${IMAGE}:${SHORT_SHA1} + docker tag ${IMAGE} quay.io/eclipse/${IMAGE}:${VERSION} + docker push quay.io/eclipse/${IMAGE}:${VERSION} From 04b0a649f027b302d8a66d905408113ee49febc7 Mon Sep 17 00:00:00 2001 From: Eric Williams Date: Mon, 7 Dec 2020 14:31:51 -0500 Subject: [PATCH 2/3] Add dockerhub login step Signed-off-by: Eric Williams --- .github/workflows/release-build-publish.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-build-publish.yml b/.github/workflows/release-build-publish.yml index 1bbf5708e..f7961cd0b 100644 --- a/.github/workflows/release-build-publish.yml +++ b/.github/workflows/release-build-publish.yml @@ -26,13 +26,19 @@ jobs: fetch-depth: 1 ref: release - - name: Login to quay.io - uses: docker/login-action@v1 + - name: Login to Quay.io + uses: azure/docker-login@v1 with: - registry: quay.io + login-server: quay.io username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} + - name: Login to Docker Hub + uses: azure/docker-login@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build and push patched base images and happy path image run: | export TAG=$(head -n 1 VERSION) From f8bcaf0b97453fa9016b52245c4ead16d730e7c5 Mon Sep 17 00:00:00 2001 From: Eric Williams Date: Mon, 7 Dec 2020 16:33:47 -0500 Subject: [PATCH 3/3] Update file and job name Signed-off-by: Eric Williams --- .github/workflows/{release-build-publish.yml => release.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{release-build-publish.yml => release.yml} (98%) diff --git a/.github/workflows/release-build-publish.yml b/.github/workflows/release.yml similarity index 98% rename from .github/workflows/release-build-publish.yml rename to .github/workflows/release.yml index f7961cd0b..8a1519e05 100644 --- a/.github/workflows/release-build-publish.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ # SPDX-License-Identifier: EPL-2.0 # -name: Build/Publish +name: Release Che Devfile Registry on: push: