Skip to content

Commit

Permalink
add option to dockerhub hook to build also as latest
Browse files Browse the repository at this point in the history
  • Loading branch information
André Bauer committed Nov 25, 2016
1 parent eaf0f59 commit 7b4c067
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/scripts/build_centos.sh
9 changes: 8 additions & 1 deletion hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@

for PACKAGER_REPO in ${PACKAGER_REPOS}; do

echo "Build Zammad Docker image from Packager.io ${PACKAGER_REPO} repo for DockerHubs ${DOCKER_REPO} repo"
echo "Build Zammad Docker image from Packager.io ${PACKAGER_REPO} repo for DockerHubs ${DOCKER_REPO}:${PACKAGER_REPO} repo"
docker build --build-arg PACKAGER_REPO=${PACKAGER_REPO} --build-arg BUILD_DATE=$(date -u +”%Y-%m-%dT%H:%M:%SZ”) -t ${DOCKER_REPO}:${PACKAGER_REPO} .

done

if [ "${CREATE_LATEST}" == "yes" ]; then

echo "Build Zammad Docker image from Packager.io ${LATEST_REPO} repo for DockerHubs ${DOCKER_REPO}:latest repo"
docker build --build-arg PACKAGER_REPO=${LATEST_REPO} --build-arg BUILD_DATE=$(date -u +”%Y-%m-%dT%H:%M:%SZ”) -t ${DOCKER_REPO}:latest .

fi
2 changes: 2 additions & 0 deletions hooks/config
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
#

PACKAGER_REPOS="stable develop"
CREATE_LATEST="no"
LATEST_REPO="develop"
9 changes: 8 additions & 1 deletion hooks/push
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@

for PACKAGER_REPO in ${PACKAGER_REPOS}; do

echo "Push Zammad Docker image from Packager.io ${PACKAGER_REPO} repo to DockerHubs ${DOCKER_REPO} repo"
echo "Push Zammad Docker image from Packager.io ${PACKAGER_REPO} repo to DockerHubs ${DOCKER_REPO}:${PACKAGER_REPO} repo"
docker push ${DOCKER_REPO}:${PACKAGER_REPO}

done

if [ "${CREATE_LATEST}" == "yes" ]; then

echo "Push Zammad Docker image from Packager.io ${LATEST_REPO} repo to DockerHubs ${DOCKER_REPO}:latest repo"
docker push ${DOCKER_REPO}:latest

fi

0 comments on commit 7b4c067

Please sign in to comment.