-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild
More file actions
executable file
·43 lines (37 loc) · 1.79 KB
/
build
File metadata and controls
executable file
·43 lines (37 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# This are the git ENV vars present at this point for the build process.
# more on that in https://docs.docker.com/docker-cloud/builds/advanced
#
# SOURCE_BRANCH: the name of the branch or the tag that is currently being tested.
# SOURCE_COMMIT: the SHA1 hash of the commit being tested.
# COMMIT_MSG: the message from the commit being tested and built.
# DOCKERFILE_PATH: the dockerfile currently being built.
# DOCKER_REPO: the name of the Docker repository being built.
# CACHE_TAG: the Docker repository tag being built.
# IMAGE_NAME: the name and tag of the Docker repository being built.
# (This variable is a combination of DOCKER_REPO:CACHE_TAG.)
echo "Build hook running"
# Build :develop tag
docker build --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
-f $DOCKERFILE_PATH \
-t "$IMAGE_NAME" .
# Build :dind, :vscode and :vscode-dind tag
# Only build if
if [ "$CACHE_TAG" -eq "develop" ]; then
docker build --build-arg IMAGE_FROM="skycoin/skycoindev-cli:dind" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
-f $DOCKERFILE_PATH \
-t "$DOCKER_REPO:dind" .
docker build --build-arg IMAGE_FROM="skycoin/skycoindev-vscode:develop" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
-f $DOCKERFILE_PATH \
-t "$DOCKER_REPO:vscode" .
docker build --build-arg IMAGE_FROM="skycoin/skycoindev-vscode:dind" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
-f $DOCKERFILE_PATH \
-t "$DOCKER_REPO:vscode-dind" .
fi