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