Skip to content

Commit

Permalink
Push to a separate repo
Browse files Browse the repository at this point in the history
  • Loading branch information
softcat477 committed Sep 15, 2023
1 parent b5540cc commit 7d6eadd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
14 changes: 6 additions & 8 deletions hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,19 @@ cleanup() {
echo "An error occur when building images."
echo "Push to another repo to trigger webhook on failure with tag syntax: {repo name}-{source branch}-{docker tag}"

docker build \
--tag ddmal/rodan:rodan-${SOURCE_BRANCH}-${DOCKER_TAG}\
.

docker push ddmal/rodan:rodan-${SOURCE_BRANCH}-${DOCKER_TAG}
docker tag ddmal/docker-webhook:placeholder ddmal/docker-webhook:rodan-fail-${SOURCE_BRANCH}-${DOCKER_TAG}
docker push ddmal/docker-webhook:rodan-fail-${SOURCE_BRANCH}-${DOCKER_TAG}
fi
}

# Trigger fail
ls abyss

docker build \
--tag ddmal/rodan:${DOCKER_TAG}\
--tag ddmal/docker-webhook:placeholder \
.

# Trigger fail
ls abyss

# ###############################################################################
# # Stage 1
# # Build and push Python3-Celery image
Expand Down
8 changes: 6 additions & 2 deletions hooks/post_build
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ echo "DOCKER_REPO: $DOCKER_REPO"
echo "DOCKER_TAG: $DOCKER_TAG"
echo "IMAGE_NAME: $IMAGE_NAME"

# Push to trigger webhook and send a message to slack
docker push ddmal/rodan:${DOCKER_TAG}
if [[ "$DOCKER_TAG" -e "this" ]]; then
# Testing a pull request
# Push to trigger webhook and send a message to slack
docker tag ddmal/docker-webhook:placeholder ddmal/docker-webhook:rodan-pass-${SOURCE_BRANCH}-${DOCKER_TAG}
docker push ddmal/docker-webhook:rodan-pass-${SOURCE_BRANCH}-${DOCKER_TAG}
fi
5 changes: 4 additions & 1 deletion hooks/push
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ echo "Docker tag: $DOCKER_TAG"
# docker push ddmal/nginx:${DOCKER_TAG}
#
# echo "[+] Pushing ddmal/iipsrv:${DOCKER_TAG}"
# docker push ddmal/iipsrv:${DOCKER_TAG}
# docker push ddmal/iipsrv:${DOCKER_TAG}

docker tag ddmal/docker-webhook:placeholder ddmal/docker-webhook:rodan-pass-${SOURCE_BRANCH}-${DOCKER_TAG}
docker push ddmal/docker-webhook:rodan-pass-${SOURCE_BRANCH}-${DOCKER_TAG}

0 comments on commit 7d6eadd

Please sign in to comment.