welaika-suspenders 2.32.2 → 2.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG_WELAIKA.md +10 -0
- data/lib/suspenders/adapters/heroku.rb +1 -1
- data/lib/suspenders/generators/import_dump_generator.rb +20 -0
- data/lib/suspenders/generators/production/deployment_generator.rb +2 -0
- data/lib/suspenders/version.rb +1 -1
- data/spec/adapters/heroku_spec.rb +1 -1
- data/spec/features/staging/pull_requests_spec.rb +1 -1
- data/templates/bin_deploy +13 -1
- data/templates/capybara_silence_puma.rb +2 -0
- data/templates/chromedriver.rb +10 -8
- data/templates/dotfiles/.env +1 -1
- data/templates/gitlab-ci.yml.erb +20 -0
- data/templates/sentry.rb +1 -1
- data/templates/spec_helper.rb +0 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1feb33dee0a5957e4e4f475da9afc775414ba866f162781bc160dec04fcdd9f4
|
4
|
+
data.tar.gz: 6b6f4bd1656d5cb86bf9ffbc4d2131ecc69b1dc64bca69199b4e385f3df3e9df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe96258397d31d095e8db2b2259117d1a6fb78eebe4b27e39047408b4628ed910b91815cab7087f5bbd9dfa16214b722c72a56399f15f7acc3cf2fdf8ccbb1d9
|
7
|
+
data.tar.gz: 4a01c8d4b248329326ef71e2bde68eb4c5d67672e3a7be437b8e72a6ada4fb2a015730ca27f673faee473030bb70b8881e0bf61639406b4aba9d4cc50a895ada
|
data/CHANGELOG_WELAIKA.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
2.33 (July 23th, 2019)
|
2
|
+
* Feature: allow to deploy to heroku with push --force-with-lease (useful for staging)
|
3
|
+
* Fix: make new Chrome versions (really) headless
|
4
|
+
* Fix: remove code written for simple_cov on Circle CI
|
5
|
+
* Change: create database snapshot on heroku at 2 am (UTC) instead of 10 am (UTC)
|
6
|
+
* Documentation: add info about resetting the db on heroku
|
7
|
+
* Feature: add factory_bot lint to gitlabci
|
8
|
+
* Fix: SENTRY_ENV environment name was mismatched in .env file
|
9
|
+
* Fix: Chrome now runs (again) on docker (for gitlabci)
|
10
|
+
|
1
11
|
2.32.2 (June 24, 2019)
|
2
12
|
* Fix: stylelint on gitlab was not working
|
3
13
|
|
@@ -59,7 +59,7 @@ module Suspenders
|
|
59
59
|
def set_heroku_backup_schedule
|
60
60
|
%w(staging production).each do |environment|
|
61
61
|
run_toolbelt_command(
|
62
|
-
"pg:backups:schedule DATABASE_URL --at '
|
62
|
+
"pg:backups:schedule DATABASE_URL --at '2:00 UTC'",
|
63
63
|
environment,
|
64
64
|
)
|
65
65
|
end
|
@@ -17,6 +17,26 @@ module Suspenders
|
|
17
17
|
|
18
18
|
% ./bin/import_dump staging
|
19
19
|
% ./bin/import_dump production
|
20
|
+
|
21
|
+
## Resetting a database
|
22
|
+
|
23
|
+
If you want to reset (destroy and recreate) a database on Heroku, you
|
24
|
+
cannot use `heroku run rake db:drop`, instead use:
|
25
|
+
|
26
|
+
% heroku pg:reset DATABASE_URL --remote=staging
|
27
|
+
|
28
|
+
( source: https://devcenter.heroku.com/articles/heroku-postgresql#pg-reset )
|
29
|
+
|
30
|
+
To load schema and seeds, you cannot use `heroku run rake db:setup`, instead use:
|
31
|
+
|
32
|
+
% heroku run rails db:schema:load db:seed --remote=staging
|
33
|
+
|
34
|
+
Remember to create a new backup schedule on Heroku after you reset your database!
|
35
|
+
|
36
|
+
% heroku pg:backups:schedule DATABASE_URL --at '2:00 UTC' --remote=staging
|
37
|
+
|
38
|
+
( source: https://devcenter.heroku.com/articles/heroku-postgres-backups#scheduling-backups )
|
39
|
+
|
20
40
|
MARKDOWN
|
21
41
|
|
22
42
|
append_file "README.md", instructions
|
@@ -17,7 +17,9 @@ module Suspenders
|
|
17
17
|
you can deploy to staging and production with:
|
18
18
|
|
19
19
|
% ./bin/deploy staging
|
20
|
+
% ./bin/deploy -f staging # pushing with force-with-lease, attention!
|
20
21
|
% ./bin/deploy production
|
22
|
+
% ./bin/deploy -f production # pushing with force-with-lease, attention!
|
21
23
|
MARKDOWN
|
22
24
|
|
23
25
|
append_file "README.md", instructions
|
data/lib/suspenders/version.rb
CHANGED
@@ -61,7 +61,7 @@ module Suspenders
|
|
61
61
|
|
62
62
|
def have_backup_schedule(remote_name)
|
63
63
|
have_received(:run).
|
64
|
-
with(/pg:backups:schedule DATABASE_URL --at '
|
64
|
+
with(/pg:backups:schedule DATABASE_URL --at '2:00 UTC' --remote #{remote_name}/)
|
65
65
|
end
|
66
66
|
|
67
67
|
def have_configured_var(remote_name, var)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
RSpec.describe "suspenders:staging:pull_requests", type: :
|
3
|
+
RSpec.describe "suspenders:staging:pull_requests", type: :generator do
|
4
4
|
it "generates the configuration for Heroku pipeline review apps" do
|
5
5
|
with_app { generate("suspenders:staging:pull_requests") }
|
6
6
|
|
data/templates/bin_deploy
CHANGED
@@ -3,10 +3,22 @@
|
|
3
3
|
# Run this script to deploy the app to Heroku.
|
4
4
|
|
5
5
|
set -e
|
6
|
+
# set -x # turn debugging on
|
7
|
+
|
8
|
+
while getopts "f" options; do
|
9
|
+
case "${options}" in
|
10
|
+
f)
|
11
|
+
force='--force-with-lease'
|
12
|
+
;;
|
13
|
+
*)
|
14
|
+
;;
|
15
|
+
esac
|
16
|
+
done
|
17
|
+
shift $((OPTIND-1))
|
6
18
|
|
7
19
|
branch="$(git symbolic-ref HEAD --short)"
|
8
20
|
target="${1:-staging}"
|
9
21
|
|
10
|
-
git push "$target" "$branch:master"
|
22
|
+
git push $force "$target" "$branch:master"
|
11
23
|
heroku run rails db:migrate --exit-code --remote "$target"
|
12
24
|
heroku restart --remote "$target"
|
data/templates/chromedriver.rb
CHANGED
@@ -10,19 +10,21 @@ end
|
|
10
10
|
Capybara.register_driver :headless_chrome do |app|
|
11
11
|
options = ::Selenium::WebDriver::Chrome::Options.new
|
12
12
|
options.headless!
|
13
|
-
|
14
|
-
# `save_and_open_screenshot` captures the whole page.
|
15
|
-
options.add_argument "--window-size=1680,1050"
|
13
|
+
options.add_argument '--window-size=1680,1050'
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
if ENV['CI'].present?
|
16
|
+
# NOTE: alternative, create a chrome user
|
17
|
+
# https://github.com/GoogleChromeLabs/lighthousebot/blob/master/builder/Dockerfile#L35-L40
|
18
|
+
options.add_argument '--no-sandbox'
|
19
|
+
|
20
|
+
options.add_argument '--disable-gpu'
|
21
|
+
options.add_argument '--disable-dev-shm-usage'
|
22
|
+
end
|
20
23
|
|
21
24
|
Capybara::Selenium::Driver.new(
|
22
25
|
app,
|
23
26
|
browser: :chrome,
|
24
|
-
options: options
|
25
|
-
desired_capabilities: capabilities
|
27
|
+
options: options
|
26
28
|
)
|
27
29
|
end
|
28
30
|
|
data/templates/dotfiles/.env
CHANGED
data/templates/gitlab-ci.yml.erb
CHANGED
@@ -93,6 +93,26 @@ quality:rubycritic:
|
|
93
93
|
- bundle check --path vendor/bundle
|
94
94
|
- bundle exec rubycritic app/ config/ lib/ --no-browser --minimum-score 94 --format console
|
95
95
|
|
96
|
+
test:factory_lint:
|
97
|
+
<<: *job-creation-policy
|
98
|
+
stage: test
|
99
|
+
services: *rails-services
|
100
|
+
cache:
|
101
|
+
<<: *cache-settings
|
102
|
+
script:
|
103
|
+
# Verify node and yarn versions
|
104
|
+
- node --version
|
105
|
+
- yarn --version
|
106
|
+
|
107
|
+
# Setup environment
|
108
|
+
- cp -f config/database.gitlab.yml config/database.yml
|
109
|
+
- bundle check --path vendor/bundle
|
110
|
+
- bin/yarn
|
111
|
+
- bundle exec rails db:setup RAILS_ENV=test
|
112
|
+
|
113
|
+
# Run factory_bot lint
|
114
|
+
- bundle exec rake factory_bot:lint RAILS_ENV=test
|
115
|
+
|
96
116
|
test:rspec:
|
97
117
|
<<: *job-creation-policy
|
98
118
|
stage: test
|
data/templates/sentry.rb
CHANGED
@@ -3,6 +3,6 @@
|
|
3
3
|
Raven.configure do |config|
|
4
4
|
config.dsn = ENV.fetch('SENTRY_DSN')
|
5
5
|
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
|
6
|
-
config.environments = %w[
|
6
|
+
config.environments = %w[staging production]
|
7
7
|
config.current_environment = ENV.fetch('SENTRY_ENV', Rails.env)
|
8
8
|
end
|
data/templates/spec_helper.rb
CHANGED
@@ -7,11 +7,6 @@ SimpleCov.start 'rails' do
|
|
7
7
|
add_group 'Interactions', 'app/interactions'
|
8
8
|
end
|
9
9
|
|
10
|
-
if ENV['CIRCLE_ARTIFACTS']
|
11
|
-
dir = File.join(ENV['CIRCLE_ARTIFACTS'], 'coverage')
|
12
|
-
SimpleCov.coverage_dir(dir)
|
13
|
-
end
|
14
|
-
|
15
10
|
require 'webmock/rspec'
|
16
11
|
require 'timecop'
|
17
12
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: welaika-suspenders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: '2.33'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|