Update .gitlab-ci.yml file
This commit is contained in:
parent
d3371f011f
commit
51cc0463de
@ -10,11 +10,11 @@ build:
|
||||
image: docker:24
|
||||
script:
|
||||
- echo "Building LittleShop Docker image"
|
||||
- docker build -t gitlabs.silverlabs.uk:443/littleshop:latest .
|
||||
- docker build -t localhost:5000/littleshop:latest .
|
||||
- |
|
||||
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||
echo "Tagging as version $CI_COMMIT_TAG"
|
||||
docker tag gitlabs.silverlabs.uk:443/littleshop:latest gitlabs.silverlabs.uk:443/littleshop:$CI_COMMIT_TAG
|
||||
docker tag localhost:5000/littleshop:latest localhost:5000/littleshop:$CI_COMMIT_TAG
|
||||
fi
|
||||
- echo "Build complete"
|
||||
rules:
|
||||
@ -49,13 +49,13 @@ deploy:vps:
|
||||
export VERSION="$VERSION"
|
||||
|
||||
# Tag the image
|
||||
docker tag littleshop:\$VERSION gitlabs.silverlabs.uk:443/littleshop:\$VERSION
|
||||
docker tag littleshop:\$VERSION gitlabs.silverlabs.uk:443/littleshop:latest
|
||||
docker tag littleshop:\$VERSION localhost:5000/littleshop:\$VERSION
|
||||
docker tag littleshop:\$VERSION localhost:5000/littleshop:latest
|
||||
|
||||
# Push to local registry
|
||||
echo "Pushing to local Docker registry..."
|
||||
docker push gitlabs.silverlabs.uk:443/littleshop:\$VERSION
|
||||
docker push gitlabs.silverlabs.uk:443/littleshop:latest
|
||||
docker push localhost:5000/littleshop:\$VERSION
|
||||
docker push localhost:5000/littleshop:latest
|
||||
|
||||
# Navigate to deployment directory
|
||||
cd /opt/littleshop
|
||||
@ -125,7 +125,7 @@ rollback:vps:
|
||||
cd /opt/littleshop
|
||||
|
||||
# Pull previous image
|
||||
docker tag gitlabs.silverlabs.uk:443/littleshop:previous gitlabs.silverlabs.uk:443/littleshop:latest
|
||||
docker tag localhost:5000/littleshop:previous localhost:5000/littleshop:latest
|
||||
|
||||
# Restart services
|
||||
echo "Restarting with previous version..."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user