-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removing status subresource from the chaosengine CRD (#64) Signed-off-by: shubhamchaudhary <[email protected]> * (chore)ci: update circleci to push tagged images (#69) Signed-off-by: ksatchit <[email protected]> * (chore)ci: ensure circle ci builds for tags (#70) Signed-off-by: ksatchit <[email protected]>
- Loading branch information
Showing
4 changed files
with
119 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,51 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ -z "${REPONAME}" ] | ||
then | ||
REPONAME="litmuschaos" | ||
fi | ||
# Push CI images | ||
function push_ci_image(){ | ||
|
||
echo "Pushing ${REPONAME}/${IMGNAME}:${IMGTAG} ..." | ||
docker push ${REPONAME}/${IMGNAME}:${IMGTAG} | ||
|
||
} | ||
|
||
# Push Release Images | ||
function push_release_image(){ | ||
|
||
if [ ! -z "${CIRCLE_TAG}" ]; | ||
then | ||
# Push with different tags if tagged as a release | ||
# When github is tagged with a release, then CircleCI will | ||
# set the release tag in env CIRCLE_TAG | ||
echo "Pushing ${REPONAME}/${IMGNAME}:${CIRCLE_TAG} ..." | ||
docker tag ${IMAGEID} ${REPONAME}/${IMGNAME}:${CIRCLE_TAG} | ||
docker push ${REPONAME}/${IMGNAME}:${CIRCLE_TAG} | ||
fi; | ||
|
||
} | ||
|
||
if [ -z "${IMGNAME}" ] || [ -z "${IMGTAG}" ] || [ -z "${IMGSHATAG}" ] | ||
|
||
# Check for Image Details | ||
if [ -z "${REPONAME}" ] || [ -z "${IMGNAME}" ] || [ -z "${IMGTAG}" ] | ||
then | ||
echo "Image details are missing. Nothing to push."; | ||
exit 1 | ||
fi | ||
|
||
IMAGEID=$( docker images -q ${REPONAME}/${IMGNAME}:${IMGTAG} ) | ||
IMAGESHAID=$( docker images -q ${REPONAME}/${IMGNAME}:${IMGSHATAG} ) | ||
|
||
# Verify Docker Credentials | ||
if [ ! -z "${DNAME}" ] && [ ! -z "${DPASS}" ]; | ||
then | ||
docker login -u "${DNAME}" -p "${DPASS}"; | ||
# Push image to docker hub | ||
echo "Pushing ${REPONAME}/${IMGNAME}:${IMGTAG} ..."; | ||
docker push ${REPONAME}/${IMGNAME}:${IMGTAG} ; | ||
docker push ${REPONAME}/${IMGNAME}:${IMGSHATAG} ; | ||
if [ ! -z "${TRAVIS_TAG}" ] ; | ||
then | ||
# Push with different tags if tagged as a release | ||
# When github is tagged with a release, then Travis will | ||
# set the release tag in env TRAVIS_TAG | ||
echo "Pushing ${REPONAME}/${IMGNAME}:${TRAVIS_TAG} ..."; | ||
docker tag ${IMAGEID} ${REPONAME}/${IMGNAME}:${TRAVIS_TAG} | ||
docker push ${REPONAME}/${IMGNAME}:${TRAVIS_TAG}; | ||
echo "Pushing ${REPONAME}/${IMGNAME}:latest ..."; | ||
docker tag ${IMAGEID} ${REPONAME}/${IMGNAME}:latest | ||
docker push ${REPONAME}/${IMGNAME}:latest; | ||
fi; | ||
build_type=$(echo $1 | cut -d "=" -f 2) | ||
if [ "${build_type}" == "ci" ]; then | ||
push_ci_image; | ||
elif [ "${build_type}" == "release" ]; then | ||
push_release_image; | ||
else | ||
echo "Invalid build type"; exit 1 | ||
fi | ||
else | ||
echo "No docker credentials provided. Skip uploading ${REPONAME}/${IMGNAME}:${IMGTAG} to docker hub"; | ||
fi; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters