Skip to content

Commit

Permalink
ECOPROJECT-2524: Add AppSRE Continues Integration scripts
Browse files Browse the repository at this point in the history
There are two scipts that need to be added here:
* build-deploy.sh - build and push the image to app-sre quay.io registry
* pr-check.sh - Just build the image for validation

Signed-off-by: Nir Argaman <nargaman@redhat.com>
  • Loading branch information
nirarg committed Jan 27, 2025
1 parent 04a9935 commit 7b196bb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ yarn-error.log*
!.vscode/launch.json
!.vscode/extensions.json
.idea

# CI temp directory
docker-config/
20 changes: 20 additions & 0 deletions ci/build-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PARENT_DIR="$(dirname "$SCRIPT_DIR")"
cd "$PARENT_DIR"

IMAGE_NAME="quay.io/app-sre/migration-planner-ui"
GIT_HASH=$(git rev-parse --short=7 HEAD)

podman build . -f Containerfile -t ${IMAGE_NAME}:latest
podman tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${GIT_HASH}

DOCKER_CONF="${PWD}/docker-config"
DOCKER_AUTH_FILE="${DOCKER_CONF}/auth.json"
mkdir -p "${DOCKER_CONF}"

podman login -u="${QUAY_USER}" -p="${QUAY_TOKEN}" quay.io --authfile "${DOCKER_AUTH_FILE}"

podman push "${IMAGE_NAME}:latest" --authfile "${DOCKER_AUTH_FILE}"
podman push "${IMAGE_NAME}:${GIT_HASH}" --authfile "${DOCKER_AUTH_FILE}"
9 changes: 9 additions & 0 deletions ci/pr-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PARENT_DIR="$(dirname "$SCRIPT_DIR")"
cd "$PARENT_DIR"

IMAGE_NAME="quay.io/app-sre/migration-planner-ui"

podman build . -f Containerfile -t ${IMAGE_NAME}:pr-check

0 comments on commit 7b196bb

Please sign in to comment.