forked from IT-Academy-BCN/ita-challenges-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_Docker.sh
More file actions
executable file
·46 lines (37 loc) · 1.07 KB
/
build_Docker.sh
File metadata and controls
executable file
·46 lines (37 loc) · 1.07 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
45
46
#!/bin/sh
# Start parameters:
# 1.-fileConfig
# Example: ./build_Docker.sh ./nginx_conf/.env.dev
# Init variables
fileConfig=$1;
now="$(date +'%d-%m-%Y %H:%M:%S:%3N')"
base_dir=`pwd`
# Load environment variables
if [ -f "$fileConfig" ]
then
echo ""
echo " Loading config from $fileConfig"
echo ""
while IFS='=' read -r key value
do
key=$(echo $key | tr '.' '_')
eval ${key}='${value}'
done < "$fileConfig"
echo " Date: "${now}
echo " ======================================================"
echo ""
echo " Initializing variables "
echo ""
echo " ======================================================"
echo " REGISTRY_NAME="${REGISTRY_NAME}
else
echo "$fileConfig not found."
fi
#./gradlew :itachallenge-challenge:clean && ./gradlew :itachallenge-challenge:build
ng build --configuration production
docker build -t=${REGISTRY_NAME}:itachallenge-nginx-${MICROSERVICE_VERSION} .
#upload image to DockerHub
if [ ${ENV} = "dev" ] || [ ${ENV} = "pre" ];
then
docker push ${REGISTRY_NAME}:itachallenge-nginx-${MICROSERVICE_VERSION}
fi