diff --git a/.github/workflows/build-sidecar-images-on-push.yml b/.github/workflows/build-sidecar-images-on-push.yml new file mode 100644 index 000000000..a20cbb75f --- /dev/null +++ b/.github/workflows/build-sidecar-images-on-push.yml @@ -0,0 +1,46 @@ +# +# Copyright (c) 2021 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: Rebuild Sidecar Images / Push to Main + +on: + push: + branches: + - main + paths: + - 'dockerfiles/**' + +jobs: + rebuild-images-on-push: + runs-on: ubuntu-20.04 + steps: + - name: Clone source code + uses: actions/checkout@v1 + with: + fetch-depth: 0 + + - name: "Login to quay.io" + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Login to docker.io + uses: docker/login-action@v1 + with: + registry: docker.io + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Rebuild sidecar images + run: ./build/workflows/build-sidecar-images-on-push.sh --push --rm --update-devfiles + + - name: Bump devfiles to new sidecar tags + run: ./build/workflows/bump-devfiles-to-new-sidecar-tags.sh --pr diff --git a/.github/workflows/sidecar-check.yml b/.github/workflows/check-sidecar-image-digests.yml similarity index 82% rename from .github/workflows/sidecar-check.yml rename to .github/workflows/check-sidecar-image-digests.yml index d635f932e..421fcefb5 100644 --- a/.github/workflows/sidecar-check.yml +++ b/.github/workflows/check-sidecar-image-digests.yml @@ -19,45 +19,45 @@ jobs: name: Validate digests for sidecar images runs-on: ubuntu-20.04 steps: - - - name: "Checkout source code" + - name: "Checkout source code" uses: actions/checkout@v2 with: fetch-depth: 0 - - - name: "Set up QEMU" + + - name: "Set up QEMU" uses: docker/setup-qemu-action@v1 - - - name: "Set up Docker Buildx" + + - name: "Set up Docker Buildx" uses: docker/setup-buildx-action@v1 - - - name: "Docker quay.io Login" + + - name: "Docker quay.io Login" uses: docker/login-action@v1 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} - - - name: Login to docker.io + + - name: Login to docker.io uses: docker/login-action@v1 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Login to registry.redhat.io + + - name: Login to registry.redhat.io uses: docker/login-action@v1 with: registry: registry.redhat.io username: ${{ secrets.CRW_BUILD_USER }} password: ${{ secrets.CRW_BUILD_TOKEN }} - - - name: Login to registry.access.redhat.com + + - name: Login to registry.access.redhat.com uses: docker/login-action@v1 with: registry: registry.access.redhat.com username: ${{ secrets.CRW_BUILD_USER }} password: ${{ secrets.CRW_BUILD_TOKEN }} + - name: Install skopeo run: | . /etc/os-release @@ -66,10 +66,10 @@ jobs: sudo apt-get update sudo apt-get -y upgrade sudo apt-get -y install skopeo - - - name: Run the digest checking script + + - name: Run the digest checking script run: | git config --global user.name "Mykhailo Kuznietsov" git config --global user.email "mkuznets@redhat.com" export GITHUB_TOKEN=${{ secrets.CHE_BOT_GITHUB_TOKEN }} - ./arbitrary-users-patch/check_sidecar_image_digests.sh + ./build/workflows/check-sidecar-image-digests.sh --pr diff --git a/.github/workflows/next-build.yml b/.github/workflows/next-build.yml index 0ffcc3c7e..fd589cf4d 100644 --- a/.github/workflows/next-build.yml +++ b/.github/workflows/next-build.yml @@ -18,13 +18,12 @@ jobs: next-build-publish: runs-on: ubuntu-20.04 steps: - - - name: Clone source code + - name: Clone source code uses: actions/checkout@v1 with: fetch-depth: 0 - - - name: Prepare + + - name: Prepare id: prep run: | set -e @@ -36,38 +35,33 @@ jobs: echo ::set-output name=image::${IMAGE} PLATFORMS=$(cat PLATFORMS) echo ::set-output name=platforms::${PLATFORMS} - - - name: "Set up QEMU" + + - name: "Set up QEMU" uses: docker/setup-qemu-action@v1 - - - name: "Set up Docker Buildx" + + - name: "Set up Docker Buildx" uses: docker/setup-buildx-action@v1 - - - name: "Docker quay.io Login" + + - name: "Login to quay.io" uses: docker/login-action@v1 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} - - - name: Login to docker.io + + - name: Login to docker.io uses: docker/login-action@v1 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Build and push base images - run: ./arbitrary-users-patch/build_images.sh --push --rm - env: - TAG: next - - name: Build and push happy path image - run: ./arbitrary-users-patch/happy-path/build_happy_path_image.sh --push --rm + run: ./happy-path/build_happy_path_image.sh --push --rm env: TAG: next - - - name: "Build and push" + + - name: "Build and push" uses: docker/build-push-action@v2 with: context: . @@ -75,9 +69,8 @@ jobs: platforms: ${{ steps.package.outputs.content }} tags: quay.io/eclipse/${{ steps.prep.outputs.image }}:${{ steps.prep.outputs.version }},quay.io/eclipse/${{ steps.prep.outputs.image }}:${{ steps.prep.outputs.short_sha1 }} push: true - - - - name: Set up yq + + - name: Set up yq run: | sudo wget https://github.com/mikefarah/yq/releases/download/v4.7.0/yq_linux_amd64 -O /usr/bin/yq sudo chmod +x /usr/bin/yq diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 66596e3f2..7e119902a 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -19,7 +19,6 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - - name: Shellcheck run: | find . -type f -name '*.sh' | wc -l @@ -29,52 +28,54 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 + - name: Run script which checks container image digest run: | sudo pip install yq /bin/bash .ci/devfile-images-check.sh - build-dev-containers: + build-sidecar-images: runs-on: ubuntu-20.04 steps: - - name: Checkout source code + - name: Clone source code uses: actions/checkout@v1 + with: + fetch-depth: 0 - - name: Build dev container images - run: ./arbitrary-users-patch/build_images.sh --rm + - name: Rebuild sidecar images + run: ./build/workflows/build-sidecar-images-on-push.sh --rm + env: + COMMIT_SHA: ${{ github.event.pull_request.head.sha }} build-main-image: - runs-on: ubuntu-20.04 - steps: - uses: actions/checkout@v1 - - - name: Prepare + - name: Prepare id: prep run: | PLATFORMS=$(cat PLATFORMS) echo ::set-output name=platforms::${PLATFORMS} - + - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 - name: Set up QEMU uses: docker/setup-qemu-action@v1 - + - name: Cache docker layers uses: actions/cache@v1 with: path: ./caches key: v1-${{ github.head_ref }} - + - name: Load docker layer cache run: | set +o pipefail docker load -i ./caches/app.tar | true - + - name: Build devfile registry uses: docker/build-push-action@v2 with: @@ -86,7 +87,7 @@ jobs: cache-from: "type=local,src=/tmp/.buildx-cache" cache-to: "type=local,dest=/tmp/.buildx-cache" push: false - + - name: Build offline devfile registry uses: docker/build-push-action@v2 with: diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..187ab9baf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.Dockerfile diff --git a/arbitrary-users-patch/build_images.sh b/arbitrary-users-patch/build_images.sh deleted file mode 100755 index 51546d6c1..000000000 --- a/arbitrary-users-patch/build_images.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018-2021 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 -# - -set -e - -SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) - -DEFAULT_REGISTRY="quay.io" -DEFAULT_ORGANIZATION="eclipse" -DEFAULT_TAG="next" -DEFAULT_BASE_IMAGES="${SCRIPT_DIR}/base_images" - -REGISTRY=${REGISTRY:-${DEFAULT_REGISTRY}} -ORGANIZATION=${ORGANIZATION:-${DEFAULT_ORGANIZATION}} -TAG=${TAG:-${DEFAULT_TAG}} -BASE_IMAGES=${BASE_IMAGES:-${DEFAULT_BASE_IMAGES}} - -NAME_FORMAT="${REGISTRY}/${ORGANIZATION}" - -PUSH_IMAGES=false -RM_IMAGES=false -PUSH_LATEST=false - -while [[ "$#" -gt 0 ]]; do - case $1 in - '--push') PUSH_IMAGES=true; shift 0;; - '--rm') RM_IMAGES=true; shift 0;; - '--latest') PUSH_LATEST=true; shift 0;; - esac - shift 1 -done - -BUILT_IMAGES="" -while read -r line; do - dev_container_name=$(echo "$line" | tr -s ' ' | cut -f 1 -d ' ') - base_image_name=$(echo "$line" | tr -s ' ' | cut -f 2 -d ' ') - base_image_digest=$(echo "$line" | tr -s ' ' | cut -f 3 -d ' ') - echo "Building ${NAME_FORMAT}/${dev_container_name}:${TAG} based on $base_image_name ..." - docker build -t "${NAME_FORMAT}/${dev_container_name}:${TAG}" --no-cache --build-arg FROM_IMAGE="$base_image_digest" "${SCRIPT_DIR}"/ | cat - if ${PUSH_IMAGES}; then - echo "Pushing ${NAME_FORMAT}/${dev_container_name}:${TAG} to remote registry" - docker push "${NAME_FORMAT}/${dev_container_name}:${TAG}" | cat - if ${PUSH_LATEST}; then - echo "Pushing ${NAME_FORMAT}/${dev_container_name}:latest to remote registry" - docker tag "${NAME_FORMAT}/${dev_container_name}:${TAG}" "${NAME_FORMAT}/${dev_container_name}:latest" - docker push "${NAME_FORMAT}/${dev_container_name}:latest" | cat - fi - fi - if ${RM_IMAGES}; then # save disk space by deleting the image we just published - echo "Deleting ${NAME_FORMAT}/${dev_container_name}:${TAG} from local registry" - docker rmi "${NAME_FORMAT}/${dev_container_name}:${TAG}" - fi - BUILT_IMAGES="${BUILT_IMAGES} ${NAME_FORMAT}/${dev_container_name}:${TAG}\n" -done < "${BASE_IMAGES}" - -echo "Built images:" -echo -e "$BUILT_IMAGES" diff --git a/arbitrary-users-patch/check_sidecar_image_digests.sh b/arbitrary-users-patch/check_sidecar_image_digests.sh deleted file mode 100755 index 6176c75dc..000000000 --- a/arbitrary-users-patch/check_sidecar_image_digests.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018-2021 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 -# -# Check for new digests for all base images in base_images file -# If found, a pull request will be created with updated digests. -# This script requires GITHUB_TOKEN in order for Hub to be able to create a PR, -# as well as configured Git name & email configuration - -set -e - -NO_OP="false" -while [[ "$#" -gt 0 ]]; do - case $1 in - '-n'|'--no-op') NO_OP="true"; shift 0;; - esac - shift 1 -done - -SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) - -REGISTRY="quay.io" -ORGANIZATION="eclipse" -NAME_FORMAT="${REGISTRY}/${ORGANIZATION}" -MAIN_BRANCH="main" - -REGISTRY=${REGISTRY:-${DEFAULT_REGISTRY}} -ORGANIZATION=${ORGANIZATION:-${DEFAULT_ORGANIZATION}} - -createPR() { - set +e - PR_BRANCH="$1" - - COMMIT_MSG="[update] Update digests in base_images" - - # commit change into branch - git add "${SCRIPT_DIR}"/base_images - git commit -sm "${COMMIT_MSG}" - - git branch "${PR_BRANCH}" - git checkout "${PR_BRANCH}" - git pull origin "${PR_BRANCH}" - git push origin "${PR_BRANCH}" - lastCommitComment="$(git log -1 --pretty=%B)" - hub pull-request -f -m "${lastCommitComment}" -b "${MAIN_BRANCH}" -h "${PR_BRANCH}" - set -e -} - -cp "${SCRIPT_DIR}"/base_images "${SCRIPT_DIR}"/base_images.copy -while read -r line; do - dev_container_name=$(echo "$line" | tr -s ' ' | cut -f 1 -d ' ') - base_image_name=$(echo "$line" | tr -s ' ' | cut -f 2 -d ' ') - base_image_digest=$(echo "$line" | tr -s ' ' | cut -f 3 -d ' ' ) - echo "Checking ${NAME_FORMAT}/${dev_container_name} based on $base_image_name ..." - latest_digest="$(skopeo inspect --tls-verify=false docker://"${base_image_name}" 2>/dev/null | jq -r '.Digest')" - echo "latest digest ---> ${latest_digest}" - latest_digest="${base_image_name%:*}@${latest_digest}" - if [[ "${latest_digest}" != "${base_image_digest}" ]]; then - echo "[INFO] Detected newer image digest for ${base_image_name}" - sed -i "s|${base_image_digest}$|${latest_digest}|" "${SCRIPT_DIR}"/base_images.copy - else - echo "[INFO] Image ${base_image_name} has valid digest" - fi -done < "${SCRIPT_DIR}"/base_images -mv "${SCRIPT_DIR}"/base_images.copy "${SCRIPT_DIR}"/base_images - -set +e -if [[ $(git diff --exit-code "${SCRIPT_DIR}"/base_images) ]]; then - if [[ ${NO_OP} == "true" ]]; then - echo "[INFO] Changes detected, see base_images file changes:" - git diff "${SCRIPT_DIR}"/base_images - else - echo "[INFO] Changes detected, generating PR with new digests" - createPR "new-base-image-digests" - fi -else - echo "[INFO] No changes detected for digests, do nothing" -fi diff --git a/build/workflows/build-sidecar-images-on-push.sh b/build/workflows/build-sidecar-images-on-push.sh new file mode 100755 index 000000000..641bec103 --- /dev/null +++ b/build/workflows/build-sidecar-images-on-push.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# Copyright (c) 2021 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 +# +# See: https://sipb.mit.edu/doc/safe-shell/ + +set -e +set -u + +PUSH="" +REMOVE="" +UPDATE_DEVFILES="" + +while [[ "$#" -gt 0 ]]; do + case $1 in + '--push') PUSH="--push"; shift 0;; + '--rm') REMOVE="--rm"; shift 0;; + '--update-devfiles') UPDATE_DEVFILES="--update-devfiles"; shift 0;; + esac + shift 1 +done + +# Compute directory +BASE_DIR=$(cd "$(dirname "$0")"; pwd) +ROOT_DIR=$(cd "${BASE_DIR}/../.."; pwd) + +cd "${ROOT_DIR}" + +# COMMIT_SHA +DEFAULT_COMMIT_SHA=$(git rev-parse --short HEAD) +COMMIT_SHA=${COMMIT_SHA:-${DEFAULT_COMMIT_SHA}} + + +echo "> git log ----------------------------------------------------------" +GIT_LOG=$(git log --pretty=oneline -n10) +echo "${GIT_LOG}" +echo "--------------------------------------------------------------------" +echo + +echo "--------------------------------------------------------------------" +echo "> changes in ${COMMIT_SHA}" +CHANGES=$(git show --pretty="format:" --name-only "${COMMIT_SHA}") +echo "${CHANGES}" +echo "--------------------------------------------------------------------" +echo + + +# rebuild all the images if changes in +# dockerfiles/base.dockerfile +# dockerfiles/entrypoint.sh +# dockerfiles/install-editor-tooling.sh +set +e +CHANGES=$(git show --pretty="format:" --name-only "${COMMIT_SHA}" | grep -E "dockerfiles/base.dockerfile|dockerfiles/entrypoint.sh|dockerfiles/install-editor-tooling.sh") +set -e + +if [ -n "${CHANGES}" ]; then + echo -e "\nRebuild ALL images" + ./dockerfiles/build.sh --all ${PUSH} ${REMOVE} + exit 0 +fi + +# rebuild specific image if something chaned in dockerfiles/ +set +e +CHANGES=$(git show --pretty="format:" --name-only "${COMMIT_SHA}" | grep "dockerfiles/") +set -e + +if [ -n "${CHANGES}" ]; then + BUILT_IMAGES="" + + for change in ${CHANGES} ; do + name=$(echo "${change}" | cut -d"/" -f2) + + # Check for directory and for the Dockerfile + if [ ! -d "./dockerfiles/${name}" ] || [ ! -e "./dockerfiles/${name}/Dockerfile" ]; then + continue + fi + + ./dockerfiles/build.sh --image "${name}" ${PUSH} ${REMOVE} ${UPDATE_DEVFILES} + BUILT_IMAGES="${BUILT_IMAGES} ${name}\n" + done + + if [ -n "${BUILT_IMAGES}" ]; then + echo -e "\nBuilt image(s): \n${BUILT_IMAGES}" + exit 0 + fi + +fi + +echo "It is not needed to rebuild base images" diff --git a/build/workflows/bump-devfiles-to-new-sidecar-tags.sh b/build/workflows/bump-devfiles-to-new-sidecar-tags.sh new file mode 100755 index 000000000..cf265813e --- /dev/null +++ b/build/workflows/bump-devfiles-to-new-sidecar-tags.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Copyright (c) 2021 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 +# +# See: https://sipb.mit.edu/doc/safe-shell/ + +set -e +set -u + +BRANCH_NAME="bump-devfiles" +COMMIT_MSG="chore(digests): bump devfiles to new sidecar tags" +MAIN_BRANCH="main" + +PULL_REQUEST=false + +while [[ "$#" -gt 0 ]]; do + case $1 in + '--pr') PULL_REQUEST=true; shift 0;; + esac + shift 1 +done + +if ! ${PULL_REQUEST}; then + echo "To create a pull request with changes run './bump-devfiles-to-new-sidecar-tags.sh --pr'" + exit 1 +fi + +# Compute directory +BASE_DIR=$(cd "$(dirname "$0")"; pwd) +ROOT_DIR=$(cd "${BASE_DIR}/../.."; pwd) + +cd "${ROOT_DIR}" + +set +e +CHANGES=$(git status | grep "devfiles/") +set -e + +if [ -z "${CHANGES}" ]; then + echo "All the devfiles are up to date." + exit 0 +fi + +# get last commit sha +COMMIT_SHA=$(git rev-parse --short HEAD) + +# compute branch name +BRANCH="${BRANCH_NAME}-${COMMIT_SHA}" + +# create and push new branch +git checkout -B "${BRANCH}" + +# add files to index +CHANGES="${CHANGES//modified:/}" +for CHANGE in ${CHANGES} ; do + git add "${CHANGE}" +done + +git status + +# commoit changes +git commit -sm "${COMMIT_MSG}" +git push origin "${BRANCH}" + +# create pull request +COMMIT_COMMENT="$(git log -1 --pretty=%B)" +hub pull-request -f -m "${COMMIT_COMMENT}" -b "${MAIN_BRANCH}" -h "${BRANCH}" diff --git a/build/workflows/check-sidecar-image-digests.sh b/build/workflows/check-sidecar-image-digests.sh new file mode 100755 index 000000000..40ade1605 --- /dev/null +++ b/build/workflows/check-sidecar-image-digests.sh @@ -0,0 +1,147 @@ +#!/bin/bash +# +# Copyright (c) 2021 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 +# +# See: https://sipb.mit.edu/doc/safe-shell/ + +set -e +set -u + +REGISTRY="quay.io" +ORGANIZATION="eclipse" + +BRANCH_NAME="update-base-images" +COMMIT_MSG="chore(digests): update dockerfile base images" +MAIN_BRANCH="main" + + +# colors +BLUE='\033[1;34m' +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' + +PULL_REQUEST=false +while [[ "$#" -gt 0 ]]; do + case $1 in + '--pr') PULL_REQUEST=true; shift 0;; + esac + shift 1 +done + + +echo "> checking sidecar image digects..." + +# Compute directory +BASE_DIR=$(cd "$(dirname "$0")"; pwd) +ROOT_DIR=$(cd "${BASE_DIR}/../.."; pwd) + +cd "${ROOT_DIR}" + +echo "> ROOT DIR ${ROOT_DIR}" + +UPDATED="" + +# +# checks digest for image +# +check_image_digest() { + echo + local image="$1" + + # Compute Docker image name + local image_name="${REGISTRY}/${ORGANIZATION}/che-${image}" + + # fetch base image name from the Dockerfile + local base_image_name + # shellcheck disable=SC2002 + base_image_name=$(cat "${ROOT_DIR}/dockerfiles/${image}/Dockerfile" | grep "ARG BASE_IMAGE=" | cut -d '"' -f 2) + + # fetch base image digest from the Dockerfile + local base_image_digest + # shellcheck disable=SC2002 + base_image_digest=$(cat "${ROOT_DIR}/dockerfiles/${image}/Dockerfile" | grep "FROM " | cut -d ' ' -f 2) + + echo -e "Checking ${GREEN}${image_name}${NC} based on ${BLUE}${base_image_name}${NC} ..." + + local latest_digest + latest_digest="$(skopeo inspect --tls-verify=false docker://"${base_image_name}" 2>/dev/null | jq -r '.Digest')" + latest_digest="${base_image_name%:*}@${latest_digest}" + + if [[ "${latest_digest}" != "${base_image_digest}" ]]; then + echo -e "\n${RED}Detected newer image digest${NC} for ${BLUE}${base_image_name}${NC}" + + sed -i "s|FROM ${base_image_digest}$|FROM ${latest_digest}|" "${ROOT_DIR}/dockerfiles/${image}/Dockerfile" + + UPDATED="${UPDATED} ${image_name}\n" + else + echo -e "Image ${BLUE}${base_image_name}${NC} has valid digest" + fi +} + +# +# creates pull request with changes +# +create_pr() { + local changes + changes=$(git diff --name-only | grep "dockerfiles/") + + # commit change into branch + for change in ${changes} ; do + git add "${change}" + done + + git commit -sm "${COMMIT_MSG}" + + # get last commit sha + local commit_sha + commit_sha=$(git rev-parse --short HEAD) + + # compute branch name + local branch="${BRANCH_NAME}-${commit_sha}" + + # create and push new branch + git checkout -B "${branch}" + git push origin "${branch}" + + # create pull request + local commit_comment + commit_comment="$(git log -1 --pretty=%B)" + hub pull-request -f -m "${commit_comment}" -b "${MAIN_BRANCH}" -h "${branch}" +} + +# +# scan ./dockerfiles/ directory +# +# shellcheck disable=SC2045 +for directory in $(ls "${ROOT_DIR}/dockerfiles") ; do + if [ -e "${ROOT_DIR}/dockerfiles/${directory}/Dockerfile" ] ; then + # update Dockerfiles if parent image uses new digest + check_image_digest "${directory}" + fi +done + +echo + +# +# creates Pull Request with changes +# +if [ -n "${UPDATED}" ]; then + echo -e "Updated(s): \n${UPDATED}\n" + + echo + echo "====================================================================" + echo "> git status" + git status + echo "====================================================================" + echo + + if ${PULL_REQUEST}; then + create_pr + fi +fi diff --git a/dockerfiles/antora-2.3/Dockerfile b/dockerfiles/antora-2.3/Dockerfile new file mode 100644 index 000000000..4d39bb909 --- /dev/null +++ b/dockerfiles/antora-2.3/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/antora/antora:2.3.3" + +FROM docker.io/antora/antora@sha256:fbf31b3be4e5dd215c82f9b5b403c5e746f68bcf50ced9b7d41b6d1414aa5714 + +#{INCLUDE:../base.dockerfile} diff --git a/arbitrary-users-patch/Dockerfile b/dockerfiles/base.dockerfile similarity index 88% rename from arbitrary-users-patch/Dockerfile rename to dockerfiles/base.dockerfile index e2095f211..a02d17f9b 100644 --- a/arbitrary-users-patch/Dockerfile +++ b/dockerfiles/base.dockerfile @@ -1,5 +1,3 @@ -ARG FROM_IMAGE -FROM ${FROM_IMAGE} USER 0 # Set permissions on /etc/passwd and /home to allow arbitrary users to write COPY --chown=0:0 entrypoint.sh / @@ -15,4 +13,5 @@ WORKDIR /projects ENTRYPOINT [ "/entrypoint.sh" ] CMD ["tail", "-f", "/dev/null"] -LABEL "che.base.image" ${FROM_IMAGE} +LABEL "che.base.image" ${BASE_IMAGE} + diff --git a/dockerfiles/build.sh b/dockerfiles/build.sh new file mode 100755 index 000000000..1663d72df --- /dev/null +++ b/dockerfiles/build.sh @@ -0,0 +1,197 @@ +#!/bin/bash +# +# Copyright (c) 2021 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 +# +# See: https://sipb.mit.edu/doc/safe-shell/ + +set -e +set -u + +DEFAULT_REGISTRY="quay.io" +DEFAULT_ORGANIZATION="eclipse" +DEFAULT_PREFIX="che-" +DEFAULT_TAG=$(git rev-parse --short HEAD) + +REGISTRY=${REGISTRY:-${DEFAULT_REGISTRY}} +ORGANIZATION=${ORGANIZATION:-${DEFAULT_ORGANIZATION}} +PREFIX=${PREFIX:-${DEFAULT_PREFIX}} +TAG=${TAG:-${DEFAULT_TAG}} + +# build params +IMAGE_TO_BUILD="" +BUILD_ALL=false +PUSH_IMAGES=false +REMOVE_IMAGES=false +UPDATE_DEVFILES=false + +# colors +BLUE='\033[1;34m' +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' + + +USAGE=" +Dockerfile Build Script + +Usage: ./build.sh [OPTIONS] + --image, -i [IMAGE] image to build + --all, -a build all images + --push, -p push images after build + --rm, -r remove built images + --update-devfiles bump devfiles to new tags + +Examples: + + build.sh --image quarkus build che-quarkus image + build.sh --all build all images +" + +# Check params +while [[ "$#" -gt 0 ]]; do + case $1 in + '-i'|'--image') IMAGE_TO_BUILD="$2"; shift 1;; + '-a'|'--all') BUILD_ALL=true; shift 0;; + '-p'|'--push') PUSH_IMAGES=true; shift 0;; + '-r'|'--rm') REMOVE_IMAGES=true; shift 0;; + '--update-devfiles') UPDATE_DEVFILES=true; shift 0;; + esac + shift 1 +done + +# Print usage if options are not provided +if [[ ${BUILD_ALL} == "false" ]] && [[ ! ${IMAGE_TO_BUILD} ]]; then + echo "${USAGE}" + exit 1 +fi + +# Compute directory +DOCKERFILES_DIR=$(cd "$(dirname "$0")"; pwd) +DEVFILES_DIR=$(cd "${DOCKERFILES_DIR}/../devfiles"; pwd) + +BUILT_IMAGES="" + +update_devfiles() { + local image="$1" + + # shellcheck disable=SC2045 + for directory in $(ls "${DEVFILES_DIR}") ; do + local devfile="${DEVFILES_DIR}/${directory}/devfile.yaml"; + if [ -e "${devfile}" ] ; then + local changes + set +e + changes=$(grep "image: ${image}:" < "${devfile}") + set -e + + if [ -n "${changes}" ]; then + changes="${changes//image: /}" + + for change in ${changes} ; do + local replace_from="image: ${change}" + local replace_to="image: ${image}:${TAG}" + sed -i "s|${replace_from}$|${replace_to}|" "${devfile}" + done + fi + + fi + done +} + +build_image() { + local IMAGE="$1" + + local DIR="${DOCKERFILES_DIR}/${IMAGE}" + + # Compute Docker image name + local BASE_NAME="${REGISTRY}/${ORGANIZATION}/${PREFIX}${IMAGE}" + local IMAGE_NAME="${BASE_NAME}:${TAG}" + + # Check for directory + if [ ! -d "${DIR}" ]; then + echo -e "\n${RED}ERROR:${NC} Directory ${DIR} does not exist\n" + exit 2 + fi + + # Check for the Dockerfile + if [ ! -e "${DIR}/Dockerfile" ]; then + echo -e "\n${RED}ERROR:${NC} No Dockerfile in directory ${DIR}\n" + exit 2 + fi + + echo -e "\nBuilding Docker Image ${GREEN}${IMAGE_NAME}${NC} from ${BLUE}${DIR}${NC} directory" + + # Replace macros in Dockerfiles + cp -f "${DIR}/Dockerfile" "${DIR}/.Dockerfile" + + # grab includes + local to_include + to_include=$(sed -n 's/.*\#{INCLUDE:\(.*\)\}/\1/p' "${DIR}/.Dockerfile") + + # perform includes (not use sed {r} to be portable) + echo "${to_include}" | while IFS= read -r filename_to_include ; do + if [ -n "${filename_to_include}" ]; then + # trim argument + filename_to_include=$(echo "${filename_to_include}" | xargs) + + local line_to_insert + line_to_insert=$(grep -n "\#{INCLUDE:${filename_to_include}}" "${DIR}/.Dockerfile" | cut -d ":" -f 1 | head -n 1) + + local head_line=$((line_to_insert - 1)) + local tail_line=$((line_to_insert + 1)) + + local content_to_include + content_to_include=$(cat "${DIR}/${filename_to_include}") + + head -n ${head_line} "${DIR}/.Dockerfile" > "${DIR}/.Dockerfile2" + echo "${content_to_include}" >> "${DIR}/.Dockerfile2" + tail -n +${tail_line} "${DIR}/.Dockerfile" >> "${DIR}/.Dockerfile2" + + mv "${DIR}/.Dockerfile2" "${DIR}/.Dockerfile" + fi + done + + # Build .Dockerfile + cd "${DIR}/.." + docker build --cache-from "${IMAGE_NAME}" -f "${DIR}/.Dockerfile" -t "${IMAGE_NAME}" . + rm "${DIR}/.Dockerfile" + + if ${PUSH_IMAGES}; then + echo "Pushing ${IMAGE_NAME} to remote registry" + docker push "${IMAGE_NAME}" | cat + fi + + if ${REMOVE_IMAGES}; then # save disk space by deleting the image we just built/published + echo "Deleting ${IMAGE_NAME} from local registry" + docker rmi "${IMAGE_NAME}" + fi + + if ${UPDATE_DEVFILES}; then + update_devfiles "${BASE_NAME}" + fi + + BUILT_IMAGES="${BUILT_IMAGES} ${IMAGE_NAME}\n" +} + +build_all() { + # shellcheck disable=SC2045 + for directory in $(ls "${DOCKERFILES_DIR}") ; do + if [ -e "${DOCKERFILES_DIR}/${directory}/Dockerfile" ] ; then + build_image "${directory}" + fi + done +} + +if [[ ${BUILD_ALL} == "true" ]]; then + build_all + + if [ -n "${BUILT_IMAGES}" ]; then + echo -e "\nBuilt image(s): \n${BUILT_IMAGES}" + fi +else + build_image "${IMAGE_TO_BUILD}" +fi diff --git a/dockerfiles/cpp-rhel7/Dockerfile b/dockerfiles/cpp-rhel7/Dockerfile new file mode 100644 index 000000000..a62d60e5b --- /dev/null +++ b/dockerfiles/cpp-rhel7/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="registry.access.redhat.com/devtools/llvm-toolset-rhel7" + +FROM registry.access.redhat.com/devtools/llvm-toolset-rhel7@sha256:2c65fdfb180eefadb615a6a858ff06ce8541860be2b570716e854510a04cd329 + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/dotnet-2.2/Dockerfile b/dockerfiles/dotnet-2.2/Dockerfile new file mode 100644 index 000000000..40486ca15 --- /dev/null +++ b/dockerfiles/dotnet-2.2/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="mcr.microsoft.com/dotnet/core/sdk:2.2-stretch" + +FROM mcr.microsoft.com/dotnet/core/sdk@sha256:db9b38d066fdbdd5ac5ce862076c27e4ae17f2b57cbacd03bdc3b24e06696ae8 + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/dotnet-3.1/Dockerfile b/dockerfiles/dotnet-3.1/Dockerfile new file mode 100644 index 000000000..f81f5af27 --- /dev/null +++ b/dockerfiles/dotnet-3.1/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="mcr.microsoft.com/dotnet/core/sdk:3.1.301-buster" + +FROM mcr.microsoft.com/dotnet/core/sdk@sha256:c87fd21bdebb2c2d573ecd703981476e5b8ac6a0e96d134722bb672e1c231fea + +#{INCLUDE:../base.dockerfile} diff --git a/arbitrary-users-patch/entrypoint.sh b/dockerfiles/entrypoint.sh similarity index 100% rename from arbitrary-users-patch/entrypoint.sh rename to dockerfiles/entrypoint.sh diff --git a/dockerfiles/golang-1.12/Dockerfile b/dockerfiles/golang-1.12/Dockerfile new file mode 100644 index 000000000..99adcfe70 --- /dev/null +++ b/dockerfiles/golang-1.12/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/golang:1.12-stretch" + +FROM docker.io/golang@sha256:8b0f4fee390ca1308ef5c522accad9f7d98a4134fcde1b2cff33df1cbb1b3b97 + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/golang-1.14/Dockerfile b/dockerfiles/golang-1.14/Dockerfile new file mode 100644 index 000000000..98e1ab7b1 --- /dev/null +++ b/dockerfiles/golang-1.14/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/golang:1.14-stretch" + +FROM docker.io/golang@sha256:a60bc0c6be7e352336044e68db7089d8604864933fcbc0d7cb2285d60b0b2d98 + +#{INCLUDE:../base.dockerfile} diff --git a/arbitrary-users-patch/install-editor-tooling.sh b/dockerfiles/install-editor-tooling.sh similarity index 100% rename from arbitrary-users-patch/install-editor-tooling.sh rename to dockerfiles/install-editor-tooling.sh diff --git a/dockerfiles/java11-gradle/Dockerfile b/dockerfiles/java11-gradle/Dockerfile new file mode 100644 index 000000000..bd8fd847a --- /dev/null +++ b/dockerfiles/java11-gradle/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/gradle:6.6.1-jdk11" + +FROM docker.io/gradle@sha256:c25f15608cd9bee8e290dd5654f9a784bea4505719fdedd0ad7ac640bed0fc50 + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/java11-maven/Dockerfile b/dockerfiles/java11-maven/Dockerfile new file mode 100644 index 000000000..37c1e580d --- /dev/null +++ b/dockerfiles/java11-maven/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/maven:3.6.3-jdk-11" + +FROM docker.io/maven@sha256:1d29ccf46ef2a5e64f7de3d79a63f9bcffb4dc56be0ae3daed5ca5542b38aa2d + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/java8-maven/Dockerfile b/dockerfiles/java8-maven/Dockerfile new file mode 100644 index 000000000..548bd1129 --- /dev/null +++ b/dockerfiles/java8-maven/Dockerfile @@ -0,0 +1,15 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/maven:3.6.1-jdk-8" + +FROM docker.io/maven@sha256:69b40237b342fee9bf996b81110f4dab250a4bc6a2ee52866965101eda066324 + +#{INCLUDE:../base.dockerfile} + diff --git a/dockerfiles/nodejs10-community/Dockerfile b/dockerfiles/nodejs10-community/Dockerfile new file mode 100644 index 000000000..1371a1f86 --- /dev/null +++ b/dockerfiles/nodejs10-community/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/node:10.16" + +FROM docker.io/node@sha256:f4b6f471cdd4b66b27eef899e7f8423ecd9fbfc863b2cb7a59978a7f64c8e0c3 + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/nodejs10-ubi/Dockerfile b/dockerfiles/nodejs10-ubi/Dockerfile new file mode 100644 index 000000000..8bd0eb7b1 --- /dev/null +++ b/dockerfiles/nodejs10-ubi/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="registry.access.redhat.com/ubi8/nodejs-10" + +FROM registry.access.redhat.com/ubi8/nodejs-10@sha256:59610c6b73172e4c7d3b0a84efeeecba478180fdfd8523e85c9674f88cca4adf + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/nodejs12-community/Dockerfile b/dockerfiles/nodejs12-community/Dockerfile new file mode 100644 index 000000000..29a0bc4fa --- /dev/null +++ b/dockerfiles/nodejs12-community/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/node:12.18" + +FROM docker.io/node@sha256:8cfe7e8dc60095a4f9d25a3f0f208503559fa033a15e2ddd87dee85bec101a2e + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/nodejs8-centos/Dockerfile b/dockerfiles/nodejs8-centos/Dockerfile new file mode 100644 index 000000000..7ee1d403e --- /dev/null +++ b/dockerfiles/nodejs8-centos/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="registry.centos.org/che-stacks/centos-nodejs" + +FROM registry.centos.org/che-stacks/centos-nodejs@sha256:d5cef8b16d9596ff334328b046894e0415e5be470a134357db590b4209922f99 + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/php-7/Dockerfile b/dockerfiles/php-7/Dockerfile new file mode 100644 index 000000000..6ef542c0f --- /dev/null +++ b/dockerfiles/php-7/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="quay.io/eclipse/che-php-base:7.4-9c00f7a" + +FROM quay.io/eclipse/che-php-base@sha256:da8cc8cd3e6d4615d00e29ff303490e95709a03a60515f8d1c9642f0784695d4 + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/python-3.8/Dockerfile b/dockerfiles/python-3.8/Dockerfile new file mode 100644 index 000000000..af338a68b --- /dev/null +++ b/dockerfiles/python-3.8/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/python:3.8.6-slim" + +FROM docker.io/python@sha256:83323df595e261d5aabf0c96c5ae65dcaa42049495c86de21f54c39d61a824ff + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/quarkus/Dockerfile b/dockerfiles/quarkus/Dockerfile new file mode 100644 index 000000000..c5589c81f --- /dev/null +++ b/dockerfiles/quarkus/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="quay.io/quarkus/centos-quarkus-maven:21.0-java11" + +FROM quay.io/quarkus/centos-quarkus-maven@sha256:c472acf9e8ef7f722469a8dc37a7a2dfed220cfb22b9fe36a051fe80c153448f + +#{INCLUDE:../base.dockerfile} diff --git a/dockerfiles/rust-1.39/Dockerfile b/dockerfiles/rust-1.39/Dockerfile new file mode 100644 index 000000000..06816db9d --- /dev/null +++ b/dockerfiles/rust-1.39/Dockerfile @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019-2021 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 +# + +ARG BASE_IMAGE="docker.io/rust:1.39.0-slim" + +FROM docker.io/rust@sha256:b47dd7b5f59bea2bc19ac18e81cc6b5b3cfe6c4e40082cab09604b296bca2652 + +#{INCLUDE:../base.dockerfile} diff --git a/arbitrary-users-patch/happy-path/Dockerfile b/happy-path/Dockerfile similarity index 100% rename from arbitrary-users-patch/happy-path/Dockerfile rename to happy-path/Dockerfile diff --git a/arbitrary-users-patch/happy-path/build_happy_path_image.sh b/happy-path/build_happy_path_image.sh similarity index 100% rename from arbitrary-users-patch/happy-path/build_happy_path_image.sh rename to happy-path/build_happy_path_image.sh diff --git a/make-release.sh b/make-release.sh index 54a4f3fa4..a279b5971 100755 --- a/make-release.sh +++ b/make-release.sh @@ -97,10 +97,9 @@ performRelease() #Build and push patched base images and happy path image TAG=$(head -n 1 VERSION) export TAG - # Build and push base images - ./arbitrary-users-patch/build_images.sh --push --rm + # Build and push happy path image, which depends on the above - ./arbitrary-users-patch/happy-path/build_happy_path_image.sh --push --rm + ./happy-path/build_happy_path_image.sh --push --rm checkRequiredImagesExist