build and release scripts

master
Tudor Stanciu 2022-01-18 19:09:29 +02:00
parent 8606d8e573
commit 36950175d2
2 changed files with 41 additions and 0 deletions

19
build.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
echo "Welcome!"
version="1.0.1"
registryPass="***REMOVED***"
echo "Create docker image with version $version."
docker image build -t "network-resurrector-frontend:$version" .
echo "Tag docker image with registry prefix."
docker tag network-resurrector-frontend:$version alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
echo "Login to alpine-nexus registry."
docker login --username=admin --password=$registryPass alpine-nexus:8500
echo "Push image network-resurrector-frontend:$version to registry."
docker push alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
echo "DONE!"

22
release.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
echo "Welcome!"
version="1.0.1"
oldver="1.0.0"
echo "Pull docker image network-resurrector-frontend:$version from registry."
docker pull alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
echo "Stop old container."
docker stop network-resurrector-frontend && docker rm network-resurrector-frontend
echo "Run new container."
docker run -d --name network-resurrector-frontend --restart=always -p 5011:80 alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
echo "Remove old image network-resurrector-frontend:$oldver."
docker rmi alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
echo "Get container logs:"
docker logs network-resurrector-frontend
echo "DONE!"