Merge pull request #16 from tparikh/app-sre-pipeline-integration
PROJQUAY-8 - Added app-sre ci pipleline scripts and Makefile targets
This commit is contained in:
commit
a0f7c4f396
3 changed files with 42 additions and 0 deletions
9
Makefile
9
Makefile
|
@ -140,6 +140,15 @@ docker-build: pkgs build
|
|||
git checkout $(NAME)
|
||||
echo $(TAG)
|
||||
|
||||
app-sre-docker-build:
|
||||
# get named head (ex: branch, tag, etc..)
|
||||
export NAME=$(shell git rev-parse --abbrev-ref HEAD)
|
||||
# checkout commit so .git/HEAD points to full sha (used in Dockerfile)
|
||||
echo "$(SHA)"
|
||||
git checkout $(SHA)
|
||||
$(BUILD_CMD) -t ${IMG} .
|
||||
git checkout $(NAME)
|
||||
|
||||
run: license
|
||||
goreman start
|
||||
|
||||
|
|
25
scripts/app_sre_build_deploy.sh
Executable file
25
scripts/app_sre_build_deploy.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
# AppSRE team CD
|
||||
|
||||
set -exv
|
||||
|
||||
CURRENT_DIR=$(dirname $0)
|
||||
|
||||
BASE_IMG="quay"
|
||||
QUAY_IMAGE="quay.io/app-sre/${BASE_IMG}"
|
||||
IMG="${BASE_IMG}:latest"
|
||||
|
||||
GIT_HASH=`git rev-parse --short=7 HEAD`
|
||||
|
||||
# build the image
|
||||
BUILD_CMD="docker build" IMG="$IMG" make app-sre-docker-build
|
||||
|
||||
# push the image
|
||||
skopeo copy --dest-creds "${QUAY_USER}:${QUAY_TOKEN}" \
|
||||
"docker-daemon:${IMG}" \
|
||||
"docker://${QUAY_IMAGE}:latest"
|
||||
|
||||
skopeo copy --dest-creds "${QUAY_USER}:${QUAY_TOKEN}" \
|
||||
"docker-daemon:${IMG}" \
|
||||
"docker://${QUAY_IMAGE}:${GIT_HASH}"
|
8
scripts/app_sre_pr_check.sh
Executable file
8
scripts/app_sre_pr_check.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
set -exv
|
||||
|
||||
BASE_IMG="quay"
|
||||
|
||||
IMG="${BASE_IMG}:latest"
|
||||
|
||||
BUILD_CMD="docker build" IMG="$IMG" make app-sre-docker-build
|
Reference in a new issue