Skip to content

Commit bcce6b9

Browse files
committed
update
1 parent 26ac1b0 commit bcce6b9

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

update-docker-io.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
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
510
docker 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
618
docker 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
920
docker push mevdschee/php-crud-api:latest
21+
22+
# Revert
23+
git checkout main

0 commit comments

Comments
 (0)