File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ parameters:
24
24
type : string
25
25
description : Deploy the given branch. The default value is your current branch.
26
26
default : " $CIRCLE_BRANCH"
27
+ tag :
28
+ type : string
29
+ description : Deploy the given tag. The default value is your current tag.
30
+ default : " $CIRCLE_TAG"
27
31
force :
28
32
type : boolean
29
33
description : Whether or not to force the git push (i.e. `git push -f`). Defaults to false.
@@ -42,12 +46,22 @@ steps:
42
46
command : heroku maintenance:on --app << parameters.app-name >>
43
47
- run :
44
48
no_output_timeout : << parameters.no_output_timeout >>
45
- name : Deploy branch to Heroku via git push
49
+ name : Deploy branch or tag to Heroku via git push
46
50
command : |
47
51
if << parameters.force >>;then
48
52
force="-f"
49
53
fi
50
- git push $force https://heroku:$<< parameters.api-key >>@git.heroku.com/<< parameters.app-name >>.git << parameters.branch >>:master
54
+
55
+ heroku_url = "https://heroku:$<< parameters.api-key >>@git.heroku.com/<< parameters.app-name >>.git"
56
+
57
+ if [ -z "<< parameters.branch >>" ]; then
58
+ git push $force $heroku_url << parameters.branch >>:master
59
+ elif [ -z "<< parameters.tag >>" ]; then
60
+ git push $force $heroku_url << parameters.tag >>^{}:master
61
+ else
62
+ echo "No branch or tag found."
63
+ exit 1
64
+ fi
51
65
- when :
52
66
condition : << parameters.maintenance-mode >>
53
67
steps :
Original file line number Diff line number Diff line change 1
1
description : >
2
- Quickly and easily take the changes to this branch and deploy them to Heroku automatically with this job.
2
+ Quickly and easily take the changes to this branch or tag and deploy them to Heroku automatically with this job.
3
3
parameters :
4
4
app-name :
5
5
description :
You can’t perform that action at this time.
0 commit comments