-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
executable file
·44 lines (40 loc) · 1.1 KB
/
build
File metadata and controls
executable file
·44 lines (40 loc) · 1.1 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
44
#!/usr/bin/env bash
set -e
# Builds the `pryvio/base` Docker image and others.
if [ "$1" == "preview" ]
then
if [ -z "$2" ]; then
echo "preview requires a tag argument for the version"
exit 0
fi
version=$2"-preview"
echo "This is a preview build: it will be published to the Docker registry with tag: ${version}"
host='docker.io'
release=true
elif [ "$1" != "test" ]
then
# Determine build tag and release status from git working copy
./check-git
version=$(cat build_tag)
if [ -e release_build ]; then
release=true
echo "This is a release build: it will be published to the Docker registry"
fi
host='docker.io'
else ## test
version=test
host=localhost
release=false
fi
cd docker
for image in base mongodb redis nginx
do
echo ""
echo "---------------------------- BUILD IMAGE: $image ----------------------------"
echo ""
docker build -f Dockerfile.$image --build-arg BUILD_HOST=$host --build-arg BUILD_VERSION=$version -t $host/pryvio/$image:$version .
if [ "$release" = true ]; then
# publish to registry
docker push $host/pryvio/$image:$version
fi
done