2021-08-14 19:40:36 +03:00
#!/bin/bash
echo "Welcome!"
2021-08-15 02:29:07 +03:00
version = "1.0.1"
2022-11-22 23:25:52 +02:00
localRegistryPass = "*********"
dockerHubRegistryPass = "*********"
2021-08-14 19:40:36 +03:00
echo "Login to dockerhub registry."
docker login --username= tstanciu --password= $dockerHubRegistryPass
echo " Create docker image with version $version and publish it to dockerhub registry. "
2022-06-18 10:53:29 +03:00
docker buildx build --build-arg APP_VERSION = $version --platform linux/arm/v7 -t " tstanciu/sta-registry:network-resurrector-api- $version -arm32v7 " -f "src/api/NetworkResurrector.Api/Docker/arm32/Dockerfile" --push .
2021-08-14 19:40:36 +03:00
echo " Pull docker image with version $version from dockerhub registry. "
docker pull tstanciu/sta-registry:network-resurrector-api-$version -arm32v7
echo "Tag docker image with alpine-nexus registry prefix."
docker tag tstanciu/sta-registry:network-resurrector-api-$version -arm32v7 alpine-nexus:8500/network-resurrector/network-resurrector-api:$version -arm32v7
echo "Login to alpine-nexus registry."
docker login --username= admin --password= $localRegistryPass alpine-nexus:8500
echo " Push image alpine-nexus:8500/network-resurrector/network-resurrector-api: $version -arm32v7 to registry. "
docker push alpine-nexus:8500/network-resurrector/network-resurrector-api:$version -arm32v7
echo " Remove docker image tstanciu/sta-registry:network-resurrector-api- $version -arm32v7 from local machine. "
docker rmi tstanciu/sta-registry:network-resurrector-api-$version -arm32v7
echo " Remove docker image tstanciu/sta-registry:network-resurrector-api- $version -arm32v7 from local machine. "
docker rmi alpine-nexus:8500/network-resurrector/network-resurrector-api:$version -arm32v7
echo "DONE!"