Skip to content

Commit

Permalink
Separate image build & push
Browse files Browse the repository at this point in the history
Move out some variables on top
  • Loading branch information
Dmitrii Dolgov committed Feb 14, 2018
1 parent c21136c commit d61b87a
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions delivery.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
build_steps:
env:
GOPATH: /root/go
OPERATOR_TOP_DIR: /root/go/src/github.com/zalando-incubator

- desc: 'Install required build software'
cmd: |
apt-get install -y make git apt-transport-https ca-certificates curl
Expand All @@ -15,11 +19,9 @@ build_steps:
curl -sSL https://get.docker.com/ | sh
- desc: 'Symlink sources into the GOPATH'
cmd: |
export GOPATH=$HOME/go
export OPERATOR_TOP_DIR=$GOPATH/src/github.com/zalando-incubator
mkdir -p $OPERATOR_TOP_DIR
ln -s $(pwd) $OPERATOR_TOP_DIR/postgres-operator
- desc: 'Build & push docker image'
- desc: 'Build docker image'
cmd: |
export PATH=$PATH:$HOME/go/bin
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
Expand All @@ -30,11 +32,21 @@ build_steps:
IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-test
fi
export IMAGE
make tools deps docker push
make tools deps docker
- desc: 'Run unit tests'
cmd: |
export PATH=$PATH:$HOME/go/bin
export GOPATH=$HOME/go
export OPERATOR_TOP_DIR=$GOPATH/src/github.com/zalando-incubator
cd $OPERATOR_TOP_DIR/postgres-operator
go test ./...
- desc: 'Push docker image'
cmd: |
export PATH=$PATH:$HOME/go/bin
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${CDP_TARGET_BRANCH} == "master" && ${IS_PR_BUILD} != "true" ]]
then
IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator
else
IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-test
fi
export IMAGE
make push

0 comments on commit d61b87a

Please sign in to comment.