-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins.sh
executable file
·33 lines (27 loc) · 1.07 KB
/
jenkins.sh
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
if [ $PRODUCTION == true ]; then
echo "building image for production instance"
cp ./credentials/production_env/settings.env .env
else
echo "building image for dev/test instance"
cp ./credentials/test_env/settings.env .env
fi
echo "" >> .env && cat ./credentials/shared/versions.env >> .env
export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=120
/usr/local/bin/docker-compose pull
/usr/local/bin/docker-compose down --volumes
/usr/local/bin/docker-compose run --entrypoint ./build.sh selv-v3-ui
/usr/local/bin/docker-compose build image
/usr/local/bin/docker-compose down --volumes
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
if [ $PRODUCTION == true ]; then
echo "pushing image for production instance"
docker tag openlmismz/selv-v3-ui:latest openlmismz/selv-v3-production-ui:${version}
docker push openlmismz/selv-v3-production-ui:${version}
else
echo "pushing image for dev/test instance"
docker tag openlmismz/selv-v3-ui:latest openlmismz/selv-v3-ui:${version}
docker push openlmismz/selv-v3-ui:${version}
fi
rm -Rf ./credentials
rm -f .env