Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
f535ff43
Commit
f535ff43
authored
8 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Improved bin/heroku/deploy script supports tags etc
parent
3ff4eb71
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/heroku/deploy
+40
-2
40 additions, 2 deletions
bin/heroku/deploy
with
40 additions
and
2 deletions
bin/heroku/deploy
+
40
−
2
View file @
f535ff43
#!/bin/bash
#!/usr/bin/env bash
set
-euo
pipefail
if
[
$#
-gt
0
]
&&
[
"
$1
"
==
"-h"
]
;
then
cat
<<
EOM
Usage:
Deploy current branch to Heroku app "metabase-CURRENT_BRANCH_NAME"
./bin/heroku/deploy
Deploy current branch to Heroku app "HEROKU_APP_NAME"
./bin/heroku/deploy "HEROKU_APP_NAME"
Deploy "GIT_REF" (branch or tag) to Heroku app "HEROKU_APP_NAME"
./bin/heroku/deploy "HEROKU_APP_NAME" "GIT_REF"
EOM
exit
0
fi
if
[
$#
-gt
0
]
;
then
heroku_app_name
=
"
$1
"
else
if
[
$(
git rev-parse
--abbrev-ref
HEAD
)
==
"HEAD"
]
;
then
echo
"Detached HEAD. Specify a Heroku app name."
echo
""
echo
"For more usage examples:
$0
-h"
exit
1
fi
heroku_app_name
=
"metabase-
$(
git rev-parse
--abbrev-ref
HEAD
)
"
fi
if
[
$#
-gt
1
]
;
then
# "peel" annotated tags etc
git_local_ref
=
"+
$2
^{}"
else
git_local_ref
=
"HEAD"
fi
# use explicit "master" ref in case it doesn't exist yet
git_remote_ref
=
"refs/heads/master"
if
!
heroku ps
-a
"
$heroku_app_name
"
>
/dev/null
;
then
heroku apps:create
-n
--addons
"heroku-postgresql:hobby-dev"
"
$heroku_app_name
"
heroku buildpacks:clear
-a
"
$heroku_app_name
"
...
...
@@ -14,6 +51,7 @@ if ! heroku ps -a "$heroku_app_name" > /dev/null; then
heroku buildpacks:add
"https://github.com/heroku/heroku-buildpack-clojure"
-a
"
$heroku_app_name
"
fi
time
git push
-f
"https://git.heroku.com/
$heroku_app_name
.git"
HEAD:master
echo
git push
-f
"https://git.heroku.com/
$heroku_app_name
.git"
"
$git_local_ref
:
$git_remote_ref
"
time
git push
-f
"https://git.heroku.com/
$heroku_app_name
.git"
"
$git_local_ref
:
$git_remote_ref
"
heroku open
-a
"
$heroku_app_name
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment