Skip to content
This repository was archived by the owner on Nov 6, 2021. It is now read-only.

Commit 0151a6a

Browse files
authored
Update readme with deployment instructions and deployment script (#411)
* Update readme with deployment instructions and deployment script * Update travis
1 parent 44a0e6e commit 0151a6a

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ after_success:
3030
chmod 600 config/deploy_id_rsa;
3131
eval `ssh-agent -s`;
3232
ssh-add config/deploy_id_rsa;
33-
bundle exec cap staging deploy;
33+
BRANCH=master bundle exec cap staging deploy;
3434
ssh-agent -k;
3535
fi
3636
env:

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,6 @@ Keep in mind that you need js to be enabled. For example:
9696
```
9797
describe "PickupSheet", type: :feature, js: true do
9898
```
99+
100+
# Deployment Process
101+
Please follow the deployment instructions in the associated diaper application [here](https://github.com/rubyforgood/diaper#deployment-process)

config/deploy.rb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@
2626

2727
## Defaults:
2828
# set :scm, :git
29-
set :branch, ENV["BRANCH"] || :master
29+
set :branch do
30+
if ENV["TAG"] && ENV["BRANCH"]
31+
raise "You can only specify either TAG or BRANCH"
32+
elsif ENV["TAG"]
33+
ENV["TAG"]
34+
elsif ENV["BRANCH"]
35+
ENV["BRANCH"]
36+
end
37+
end
3038
# set :format, :pretty
3139
# set :log_level, :debug
3240
# set :keep_releases, 5
@@ -51,9 +59,8 @@
5159
desc "Make sure local git is in sync with remote."
5260
task :check_revision do
5361
on roles(:app) do
54-
unless `git rev-parse HEAD` == `git rev-parse origin/master`
55-
puts "WARNING: HEAD is not the same as origin/master"
56-
puts "Run `git push` to sync changes."
62+
if fetch(:branch).nil?
63+
puts "You must provide either a TAG or a BRANCH. Example: 'TAG=2.2.0 cap <environment> deploy'"
5764
exit
5865
end
5966
end

0 commit comments

Comments
 (0)