Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
c4c46513
Unverified
Commit
c4c46513
authored
7 years ago
by
Silas Davis
Browse files
Options
Downloads
Patches
Plain Diff
include commit hash and date in docker image label unless we are building a tagged version
parent
3060cd57
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
circle.yml
+1
-24
1 addition, 24 deletions
circle.yml
tests/build_tool.sh
+24
-8
24 additions, 8 deletions
tests/build_tool.sh
with
25 additions
and
32 deletions
circle.yml
+
1
−
24
View file @
c4c46513
...
@@ -32,36 +32,13 @@ test:
...
@@ -32,36 +32,13 @@ test:
# - echo "Running integration tests..." && cd $REPO && "tests/circle_test.sh" # | tee $CIRCLE_ARTIFACTS/output.log; test ${PIPESTATUS[0]} -eq 0"
# - echo "Running integration tests..." && cd $REPO && "tests/circle_test.sh" # | tee $CIRCLE_ARTIFACTS/output.log; test ${PIPESTATUS[0]} -eq 0"
deployment
:
deployment
:
release-0.12
:
branch
:
release-0.12
commands
:
-
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io
# build docker image and tag the image with the version
-
tests/build_tool.sh
-
docker push quay.io/monax/db
release-0.16
:
branch
:
release-0.16
commands
:
-
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io
# build docker image and tag the image with the version
-
tests/build_tool.sh
-
docker push quay.io/monax/db
develop
:
develop
:
branch
:
develop
branch
:
develop
commands
:
commands
:
-
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io
-
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io
# build docker image and tag the image with the version
# build docker image and tag the image with the version
, date, and commit hash
-
tests/build_tool.sh
-
tests/build_tool.sh
-
docker push quay.io/monax/db
-
docker push quay.io/monax/db
master
:
branch
:
master
commands
:
-
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io
# build docker image and tag the image with ':latest'
# builds on master are considered immutable so we do not push the version
# tag to allow for hotfixes
-
tests/build_tool.sh latest
-
docker push quay.io/monax/db
tagged-releases
:
tagged-releases
:
tag
:
/v[0-9]+(\.[0-9]+)*/
tag
:
/v[0-9]+(\.[0-9]+)*/
commands
:
commands
:
...
...
This diff is collapsed.
Click to expand it.
tests/build_tool.sh
+
24
−
8
View file @
c4c46513
...
@@ -18,8 +18,8 @@
...
@@ -18,8 +18,8 @@
# ----------------------------------------------------------
# ----------------------------------------------------------
TARGET
=
burrow
IMAGE
=
quay.io/monax/db
IMAGE
=
quay.io/monax/db
VERSION_REGEX
=
"^v[0-9]+
\.
[0-9]+
\.
[0-9]+$"
set
-e
set
-e
...
@@ -28,24 +28,40 @@ then
...
@@ -28,24 +28,40 @@ then
REPO
=
`
pwd
`
REPO
=
`
pwd
`
CI
=
"true"
CI
=
"true"
else
else
REPO
=
$GOPATH
/src/github.com/hyperledger/
$TARGET
REPO
=
$GOPATH
/src/github.com/hyperledger/burrow
fi
version
=
$(
cat
$REPO
/version/version.go |
tail
-n
1 |
cut
-d
\
-f
4 |
tr
-d
'"'
)
tag
=
$(
git tag
--points-at
HEAD
)
# Only label a build as a release version when the commit is tagged
if
[[
${
tag
}
=
~
${
VERSION_REGEX
}
]]
;
then
echo
"Building release version (tagged
$tag
)..."
# Fail noisily when trying to build a release version that does not match code tag
if
[[
!
${
tag
}
=
"v
$version
"
]]
;
then
echo
"Build failure: version tag
$tag
does not match version/version.go version
$version
"
exit
1
fi
else
date
=
$(
date
+
"%Y%m%d"
)
commit
=
$(
git rev-parse
--short
HEAD
)
version
=
"
$version
-dev-
$date
-
$commit
"
echo
"Building non-release version
$version
..."
fi
fi
release_min
=
$(
cat
$REPO
/version/version.go |
tail
-n
1 |
cut
-d
\
-f
4 |
tr
-d
'"'
)
release_maj
=
$(
echo
$release_min
|
cut
-d
.
-f
1-2
)
# Build
# Build
mkdir
-p
$REPO
/target/docker
mkdir
-p
$REPO
/target/docker
docker build
-t
$IMAGE
:build
$REPO
docker build
-t
$IMAGE
:build
$REPO
docker run
--rm
--entrypoint
cat
$IMAGE
:build /usr/local/bin/
$TARGET
>
$REPO
/target/docker/burrow.dockerartefact
docker run
--rm
--entrypoint
cat
$IMAGE
:build /usr/local/bin/
burrow
>
$REPO
/target/docker/burrow.dockerartefact
docker run
--rm
--entrypoint
cat
$IMAGE
:build /usr/local/bin/burrow-client
>
$REPO
/target/docker/burrow-client.dockerartefact
docker run
--rm
--entrypoint
cat
$IMAGE
:build /usr/local/bin/burrow-client
>
$REPO
/target/docker/burrow-client.dockerartefact
docker build
-t
$IMAGE
:
$
release_mi
n
-f
Dockerfile.deploy
$REPO
docker build
-t
$IMAGE
:
$
versio
n
-f
Dockerfile.deploy
$REPO
# If provided, tag the image with the label provided
# If provided, tag the image with the label provided
if
[
"
$1
"
]
if
[
"
$1
"
]
then
then
docker tag
$IMAGE
:
$
release_mi
n
$IMAGE
:
$1
docker tag
$IMAGE
:
$
versio
n
$IMAGE
:
$1
docker rmi
$IMAGE
:
$
release_mi
n
docker rmi
$IMAGE
:
$
versio
n
fi
fi
# Cleanup
# Cleanup
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment