File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2- git checkout main
3- git pull
4- # tag=$(git describe --tags | cut -d\- -f1 | sed s/v/release-/)
2+
3+ # Get new tags from remote
4+ git fetch --tags
5+ # Get latest tag name
6+ latestTag=$( git describe --tags ` git rev-list --tags --max-count=1` )
7+ # Checkout latest tag
8+ git checkout $latestTag
9+ # Login to DockerHub
510docker login
11+ # Make docker tag
12+ dockerTag=$( echo $latestTag | sed s/v/release-/)
13+ # Build release
14+ docker build . -t mevdschee/php-crud-api:$dockerTag
15+ # Push release
16+ docker push mevdschee/php-crud-api:$dockerTag
17+ # Build latest
618docker build . -t mevdschee/php-crud-api:latest
7- # docker build . -t mevdschee/php-crud-api:$tag
8- # docker push mevdschee/php-crud-api:$tag
19+ # Push latest
920docker push mevdschee/php-crud-api:latest
21+
22+ # Revert
23+ git checkout main
You can’t perform that action at this time.
0 commit comments