Enabled piplines support for automated docker releases

This commit is contained in:
Dave Chevell 2017-10-10 13:24:57 +11:00
parent bd87e0018b
commit 5b51b21a11
No known key found for this signature in database
GPG Key ID: 279DF1B52C7C44DC
2 changed files with 44 additions and 0 deletions

31
bitbucket-pipelines.yml Normal file
View File

@ -0,0 +1,31 @@
image: dchevell/docker-release-maker:latest
clone:
depth: full
pipelines:
custom:
create-release-base-6:
- step:
script:
- git fetch --all
- export BASE_BRANCH=base-6
- export BASE_VERSION=6
- export DOCKER_REPO=atlassian/confluence-server
- export DOCKERFILE_VERSION_STRING=CONFLUENCE_VERSION
- export GIT_USER=pipelinesagent
- export GIT_EMAIL=pipelines-agent@atlassian.com
- export MAC_PRODUCT_KEY=confluence
- python /usr/src/app/create_release.py
branches:
base-6:
- step:
script:
- git fetch --all
- export BASE_BRANCH=base-6
- export BASE_VERSION=6
- export DOCKER_REPO=atlassian/confluence-server
- export DOCKERFILE_VERSION_STRING=CONFLUENCE_VERSION
- export GIT_USER=pipelinesagent
- export GIT_EMAIL=pipelines-agent@atlassian.com
- export MAC_PRODUCT_KEY=confluence
- python /usr/src/app/update_release.py

13
hooks/post_push Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -e
# Parse image name for repo name
tagStart=$(expr index "$IMAGE_NAME" :)
repoName=${IMAGE_NAME:0:tagStart-1}
# Tag and push image for each additional tag
for tag in `git tag -l --points-at HEAD`; do
docker tag $IMAGE_NAME ${repoName}:${tag}
docker push ${repoName}:${tag}
done