Skip to content

Commit c603b62

Browse files
committed
ECOPROJECT-2524: Add AppSRE Continues Integration scripts
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>
1 parent 04a9935 commit c603b62

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ yarn-error.log*
2727
!.vscode/launch.json
2828
!.vscode/extensions.json
2929
.idea
30+
31+
# CI temp directory
32+
docker-config/

ci/build-deploy.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4+
PARENT_DIR="$(dirname "$SCRIPT_DIR")"
5+
cd "$PARENT_DIR"
6+
7+
IMAGE_NAME="quay.io/nargaman/migration-planner-ui"
8+
GIT_HASH=$(git rev-parse --short=7 HEAD)
9+
10+
podman build . -f Containerfile -t ${IMAGE_NAME}:latest
11+
podman tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${GIT_HASH}
12+
13+
DOCKER_CONF="${PWD}/docker-config"
14+
DOCKER_AUTH_FILE="${DOCKER_CONF}/auth.json"
15+
mkdir -p "${DOCKER_CONF}"
16+
17+
podman login -u="${QUAY_USER}" -p="${QUAY_TOKEN}" quay.io --authfile "${DOCKER_AUTH_FILE}"
18+
19+
podman push "${IMAGE_NAME}:latest" --authfile "${DOCKER_AUTH_FILE}"
20+
podman push "${IMAGE_NAME}:${GIT_HASH}" --authfile "${DOCKER_AUTH_FILE}"

ci/pr-check.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4+
PARENT_DIR="$(dirname "$SCRIPT_DIR")"
5+
cd "$PARENT_DIR"
6+
7+
IMAGE_NAME="quay.io/app-sre/migration-planner-ui"
8+
9+
podman build . -f Containerfile -t ${IMAGE_NAME}:pr-check

0 commit comments

Comments
 (0)