roro 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: c6bf9813b07f7c2c2f34a0e0e4578130062af0752865da885f4da75c4def51c2
4
- data.tar.gz: 2ff26062242671ba49fdffd5b6e87d0477ffb906fb5af967b758440fb4dade1d
2
+ SHA1:
3
+ metadata.gz: 6b8dac88c95d43a7e4531d2b44849f30e1e37c9e
4
+ data.tar.gz: 20af42166d1cc70f7b20d327d8cbc8027255cc6c
5
5
  SHA512:
6
- metadata.gz: d272d16756b148c197ec2b0dcaf25463f0669e88ad4c79ff2f9fc19a2508be72d7ebd13b33ef595df1d146bd22346a8f9413f99ce4d61139167ee0923e103dc7
7
- data.tar.gz: 1ce050d03045da0c39d93f8f6ecbf9e4a92782ee7a7594aa976dbdea7350b53964612cd6b970f852749d016b071ccc8c56afca4ce71ed8ab632360150f086fd8
6
+ metadata.gz: c05e7ff871bcfb14a52602ef71b3a331113ff87da423cca594fb07b41fb5463a432809e0526b8ca77987fb6838829c5ccacfc6e85e1823bf92d6d66a5c1bc3f9
7
+ data.tar.gz: db4039537980f16d922c0f08add246f66d1229b3055e0cfc0880f5bbdd968eca374d142639fb09d1b4d3d6246efac5dbe381239f516170e065ef3e72ab400366
File without changes
@@ -0,0 +1,55 @@
1
+ version: 2.1
2
+
3
+ jobs:
4
+
5
+ build:
6
+ machine: true
7
+ steps:
8
+ - checkout
9
+
10
+ test:
11
+ machine: true
12
+ steps:
13
+ - checkout
14
+ - run: RUBY_VERSION=2.5 docker-compose build ruby_gem
15
+ - run: RUBY_VERSION=2.5 docker-compose up -d --force-recreate ruby_gem
16
+ - run: RUBY_VERSION=2.5 docker-compose run ruby_gem bundle exec rake test
17
+ - run: RUBY_VERSION=2.6 docker-compose build ruby_gem
18
+ - run: RUBY_VERSION=2.6 docker-compose up -d --force-recreate ruby_gem
19
+ - run: RUBY_VERSION=2.6 docker-compose run ruby_gem bundle exec rake test
20
+ - run: RUBY_VERSION=2.7 docker-compose build ruby_gem
21
+ - run: RUBY_VERSION=2.7 docker-compose up -d --force-recreate ruby_gem
22
+ - run: RUBY_VERSION=2.7 docker-compose run ruby_gem bundle exec rake test
23
+
24
+ release:
25
+ machine: true
26
+ steps:
27
+ - checkout
28
+ - run: gem install roro
29
+ - run: roro generate::exposed ci
30
+ - run: |
31
+ echo $(cat ./roro/containers/ruby_image/ci.env) >> $BASH_ENV
32
+ source $BASH_ENV
33
+ - run: chmod +x ./.circleci/setup-gem-credentials.sh
34
+ - run: ./.circleci/setup-gem-credentials.sh
35
+ - run: chmod 0600 ~/.gem/credentials
36
+ - run: git checkout .
37
+ - run: gem release
38
+
39
+ workflows:
40
+ version: 2
41
+
42
+ build-release:
43
+ jobs:
44
+ - build
45
+ - test:
46
+ filters:
47
+ branches:
48
+ only: master
49
+
50
+ - release:
51
+ requires:
52
+ - build
53
+ filters:
54
+ branches:
55
+ only: release
@@ -1,3 +1,3 @@
1
1
  mkdir ~/.gem
2
2
  echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
3
- chmod 0600 /home/circleci/.gem/credentials
3
+ chmod 0600 /home/circleci/.gem/credentials
data/.gitignore CHANGED
@@ -13,10 +13,10 @@ roro/**/*.key
13
13
 
14
14
  *.key
15
15
  *.env
16
+ !/.gitignore
16
17
 
17
18
  tmp/*
18
- tmp/*
19
- !tmp/.gitkeep
19
+ !tmp/.keep
20
20
  sandbox/*
21
21
  !sandbox/.keep
22
22
  !sandbox/greenfield
@@ -0,0 +1,15 @@
1
+ version: '3.2'
2
+
3
+ services:
4
+
5
+ ruby_gem:
6
+ build:
7
+ context: .
8
+ dockerfile: roro/containers/ruby_image/Dockerfile
9
+ environment:
10
+ - RUBY_VERSION=${RUBY_VERSION}
11
+ volumes:
12
+ - gem_cache:/gems
13
+
14
+ volumes:
15
+ gem_cache:
@@ -2,7 +2,6 @@ module Roro
2
2
  class CLI < Thor
3
3
 
4
4
  desc "rollon::ruby_gem::with_ci_cd", "Generate files for containerized gem testing, CircleCI, and releasing to RubyGems."
5
- method_option :rubies, type: :array, banner: "2.5.3 2.4.2"
6
5
  map "rollon::ruby_gem::with_ci_cd" => "rollon_ruby_gem_with_ci_cd"
7
6
 
8
7
  def rollon_ruby_gem_with_ci_cd(*args)
@@ -13,7 +12,7 @@ module Roro
13
12
  def ruby_gem_with_ci_cd(*args)
14
13
  configure_for_rollon
15
14
  answer = ask("\nYou can add your rubygems api key in\n\t
16
- './roro/ci.env' \n\nlater, or we'll try to add it here:",
15
+ './roro/containers/ruby_gem/ci.env' \n\nlater, or we'll try to add it here:",
17
16
  default: '')
18
17
  rubygems_api_key = (answer.eql?("") ? 'some-key' : answer)
19
18
  @config.app['rubygems_api_key'] = rubygems_api_key
@@ -27,55 +26,20 @@ module Roro
27
26
  copy_file 'ruby_gem/docker-compose.yml', './docker-compose.yml'
28
27
 
29
28
  @config.app['rubies'].each do |ruby|
30
- img_name = 'ruby_gem:' + ruby
31
29
  file = '.circleci/config.yml'
32
-
33
- run_build = "\n - run: RUBY_IMAGE=ruby:#{ruby}-alpine docker-compose build ruby_gem"
34
- run_test = "\n - run: RUBY_IMAGE=ruby:#{ruby}-alpine docker-compose run ruby_gem rake test"
35
- append_to_file file, run_build + run_test, after: 'gem install roro'
30
+ spacer = "\n - run: "
31
+ rv = "RUBY_VERSION=#{ruby} docker-compose "
32
+ build = "build ruby_gem"
33
+ up = "up -d --force-recreate ruby_gem"
34
+ run_tests = "run ruby_gem bundle exec rake test"
35
+ append_to_file file, spacer + rv + run_tests, after: "- placeholder"
36
+ append_to_file file, spacer + rv + up, after: "- placeholder"
37
+ append_to_file file, spacer + rv + build, after: "- placeholder"
36
38
  end
39
+ gsub_file '.circleci/config.yml', "- placeholder", "- checkout"
37
40
  append_to_file ".gitignore", "\nGemfile.lock"
38
41
  gitignore_sensitive_files
39
42
  end
40
43
  end
41
44
  end
42
45
  end
43
- # # def ruby_gem
44
- # # rubies = options["rubies"] || ["2.5.3", "2.6.0"]
45
- # # copy_file 'ruby_gem/docker-compose.yml', 'docker-compose.yml'
46
- # # copy_file 'ruby_gem/config.yml', '.circleci/config.yml'
47
- # # copy_file 'ruby_gem/setup-gem-credentials.sh', '.circleci/setup-gem-credentials.sh'
48
- # # directory 'ruby_gem/docker', 'docker', { ruby_version: "2.5"}
49
-
50
- # # rubies.each do |ruby|
51
- # # rubydash = ruby.gsub('.', '-')
52
- # # rubyunderscore = ruby.gsub('.', '_')
53
- # # doc_loc = "docker/containers/#{rubyunderscore}/Dockerfile"
54
- # # content = <<-EOM
55
-
56
- # # app-#{rubydash}:
57
- # # build:
58
- # # context: .
59
- # # dockerfile: #{doc_loc}
60
- # # command: rake test
61
- # # EOM
62
- # # append_to_file 'docker-compose.yml', content
63
- # # template 'ruby_gem/docker/containers/app/Dockerfile.tt', doc_loc, {ruby_version: ruby}
64
- # # # append_to_file 'docker-compose.yml', "\n app-#{ruby}:\n build:\n\s\s\s\s\s\scontext:"
65
- # # end
66
-
67
- # # # end
68
- # # # <<EOF
69
- # # # This is the first way of creating
70
- # # # here document ie. multiple line string.
71
- # # # EOF
72
- # # # %w[app web].each do |container|
73
- # # # options = {
74
- # # # email: @env_hash['DOCKERHUB_EMAIL'],
75
- # # # app_name: @env_hash['APP_NAME'] }
76
- # # #
77
- # # # template("docker/containers/#{container}/Dockerfile.tt", "docker/containers/#{container}/Dockerfile", options)
78
- # # # end
79
- # # end
80
- # # end
81
- # # end
@@ -1,5 +1,4 @@
1
1
  .git
2
- .gitignore
3
2
  README.md
4
3
 
5
4
  #
@@ -30,7 +29,8 @@ Temporary Items
30
29
  *.rbc
31
30
  capybara-*.html
32
31
  log
33
- tmp
32
+ tmp/*
33
+ !tmp/.keep
34
34
  db/*.sqlite3
35
35
  db/*.sqlite3-journal
36
36
  public/system
@@ -0,0 +1,40 @@
1
+ version: 2.1
2
+
3
+ jobs:
4
+
5
+ build:
6
+ machine: true
7
+ steps:
8
+ - checkout
9
+
10
+ test:
11
+ machine: true
12
+ steps:
13
+ - placeholder
14
+
15
+ release:
16
+ machine: true
17
+ steps:
18
+ - checkout
19
+ - run: gem install roro
20
+ - run: roro generate::exposed ci
21
+ - run: echo 'source roro/containers/ruby_image/ci.env' >> $BASH_ENV
22
+ - run: chmod +x ./.circleci/setup-gem-credentials.sh
23
+ - run: ./.circleci/setup-gem-credentials.sh
24
+ - run: cat ~/.gem/credentials
25
+ - run: git checkout .
26
+ - run: gem release
27
+
28
+ workflows:
29
+ version: 2
30
+
31
+ build-release:
32
+ jobs:
33
+ - build
34
+ - test
35
+ - release:
36
+ requires:
37
+ - build
38
+ filters:
39
+ branches:
40
+ only: release
@@ -0,0 +1,3 @@
1
+ mkdir ~/.gem
2
+ echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
3
+ chmod 0600 /home/circleci/.gem/credentials
@@ -7,5 +7,9 @@ services:
7
7
  context: .
8
8
  dockerfile: roro/containers/ruby_image/Dockerfile
9
9
  environment:
10
- - RUBY_IMAGE=${RUBY_IMAGE}
11
- command: bundle exec rake test
10
+ - RUBY_VERSION=${RUBY_VERSION}
11
+ volumes:
12
+ - gem_cache:/gems
13
+
14
+ volumes:
15
+ gem_cache:
@@ -1,16 +1,16 @@
1
- ARG RUBY_IMAGE=ruby:<%= config['ruby_version'] %>-alpine
1
+ ARG RUBY_VERSION=<%= config['ruby_version'] %>
2
+ ARG RUBY_IMAGE=ruby:${RUBY_VERSION}-alpine
2
3
  FROM $RUBY_IMAGE
3
4
 
4
5
  RUN apk add --no-cache --update build-base linux-headers git
5
6
 
6
7
  ENV APP_HOME /usr/src/app/
8
+ ENV BUNDLE_PATH /gems
9
+ ENV GEM_PATH ${BUNDLE_PATH}
10
+ ENV GEM_HOME ${BUNDLE_PATH}
7
11
 
8
- RUN mkdir ${APP_HOME}
9
-
12
+ RUN mkdir ${BUNDLE_PATH}
10
13
 
11
14
  WORKDIR ${APP_HOME}
12
-
13
-
14
15
  COPY . ${APP_HOME}
15
- RUN gem update bundler
16
- RUN bundle
16
+ RUN bundle install
@@ -0,0 +1 @@
1
+ export RUBYGEMS_API_KEY=<%= config['rubygems_api_key'] %>
@@ -0,0 +1,10 @@
1
+ database:
2
+ image: mysql:5.7
3
+ env_file:
4
+ - roro/containers/database/development.env
5
+ - roro/containers/app/development.env
6
+ volumes:
7
+ - db_data:/var/lib/mysql
8
+ restart: always
9
+ ports:
10
+ - '3307:3306'
@@ -0,0 +1,7 @@
1
+ database:
2
+ image: postgres
3
+ env_file:
4
+ - roro/containers/database/development.env
5
+ - roro/containers/app/development.env
6
+ volumes:
7
+ - db_data:/var/lib/postgresql/data
@@ -0,0 +1,11 @@
1
+ build:
2
+ machine: true
3
+ steps:
4
+ - checkout
5
+
6
+ <%= 'getsome' %>
7
+ - run: gem install roro
8
+ - run: roro generate::exposed ci
9
+ - run: echo 'source roro/containers/ruby_image/ci.env' >> $BASH_ENV
10
+ - run: gem install gem-release
11
+ # - run: gem release --key $RUBYGEMS_API_KEY
@@ -1,3 +1,3 @@
1
1
  module Roro
2
- VERSION = "0.3.12"
2
+ VERSION = "0.3.13"
3
3
  end
@@ -46,5 +46,6 @@ Gem::Specification.new do |spec|
46
46
  spec.add_development_dependency "rake", ">= 12.3"
47
47
  spec.add_development_dependency "handsome_fencer-test", "0.1.1"
48
48
  spec.add_development_dependency "mocha"
49
+ spec.add_development_dependency "byebug"
49
50
 
50
51
  end
File without changes
@@ -0,0 +1,16 @@
1
+ ARG RUBY_VERSION=2.7
2
+ ARG RUBY_IMAGE=ruby:${RUBY_VERSION}-alpine
3
+ FROM $RUBY_IMAGE
4
+
5
+ RUN apk add --no-cache --update build-base linux-headers git
6
+
7
+ ENV APP_HOME /usr/src/app/
8
+ ENV BUNDLE_PATH /gems
9
+ ENV GEM_PATH ${BUNDLE_PATH}
10
+ ENV GEM_HOME ${BUNDLE_PATH}
11
+
12
+ RUN mkdir ${BUNDLE_PATH}
13
+
14
+ WORKDIR ${APP_HOME}
15
+ COPY . ${APP_HOME}
16
+ RUN bundle install
@@ -0,0 +1,2 @@
1
+ CP3WnhLldqGcoPdCRgAkzUiXdTYdd166oDCRsXDbJi+YWczgX53oaJsRNlu8
2
+ S/cvOkds770ID3hmbcNXwfyR4A==
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - schadenfred
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-22 00:00:00.000000000 Z
11
+ date: 2020-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem-release
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: byebug
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: Roro is a containerization and continuous integration framework for Ruby
140
154
  on Rails applications. Like Rails, it favors convention over configuration "...for
141
155
  programmer happiness and sustainable productivity."
@@ -146,6 +160,9 @@ executables:
146
160
  extensions: []
147
161
  extra_rdoc_files: []
148
162
  files:
163
+ - ".circleci/.keep"
164
+ - ".circleci/config.yml"
165
+ - ".circleci/setup-gem-credentials.sh"
149
166
  - ".gitignore"
150
167
  - ".ruby-gemset"
151
168
  - ".travis.yml"
@@ -158,6 +175,7 @@ files:
158
175
  - bin/console
159
176
  - bin/roro
160
177
  - bin/setup
178
+ - docker-compose.yml
161
179
  - lib/roro.rb
162
180
  - lib/roro/cli.rb
163
181
  - lib/roro/cli/base/base.rb
@@ -216,21 +234,31 @@ files:
216
234
  - lib/roro/cli/templates/roro/roro/containers/app/.keep
217
235
  - lib/roro/cli/templates/roro/roro/containers/frontend/.keep
218
236
  - lib/roro/cli/templates/roro/roro/docker-entrypoint.sh.tt
219
- - lib/roro/cli/templates/ruby_gem/.circleci/config.yml
237
+ - lib/roro/cli/templates/ruby_gem/.circleci/.keep
238
+ - lib/roro/cli/templates/ruby_gem/.circleci/config.yml.tt
239
+ - lib/roro/cli/templates/ruby_gem/.circleci/setup-gem-credentials.sh
220
240
  - lib/roro/cli/templates/ruby_gem/docker-compose.yml
221
- - lib/roro/cli/templates/ruby_gem/roro/ci.env.tt
222
241
  - lib/roro/cli/templates/ruby_gem/roro/containers/.keep
223
242
  - lib/roro/cli/templates/ruby_gem/roro/containers/ruby_image/Dockerfile.tt
243
+ - lib/roro/cli/templates/ruby_gem/roro/containers/ruby_image/ci.env.tt
224
244
  - lib/roro/cli/templates/ruby_gem/roro/keys/.keep
225
- - lib/roro/cli/templates/ruby_gem/setup-gem-credentials.sh
226
245
  - lib/roro/cli/templates/stories/.keep
246
+ - lib/roro/cli/templates/stories/rails/database/with_mysql/_service.yml
247
+ - lib/roro/cli/templates/stories/rails/database/with_postgresql/.keep
248
+ - lib/roro/cli/templates/stories/rails/database/with_postgresql/_service.yml
249
+ - lib/roro/cli/templates/stories/ruby_gem/with_ci_cd/_build.yml
227
250
  - lib/roro/cli/templates/stories/with_mysql/_service.yml
228
251
  - lib/roro/cli/templates/stories/with_postgresql/.keep
229
252
  - lib/roro/cli/templates/stories/with_postgresql/_service.yml
230
253
  - lib/roro/version.rb
231
254
  - lib/tasks/deploy.rake
232
255
  - roro.gemspec
256
+ - roro/containers/.keep
257
+ - roro/containers/ruby_image/Dockerfile
258
+ - roro/containers/ruby_image/ci.env.enc
259
+ - roro/keys/.keep
233
260
  - sandbox/.keep
261
+ - tmp/.keep
234
262
  - vendor/bundle/.keep
235
263
  - vendor/cache/actionpack-6.0.3.2.gem
236
264
  - vendor/cache/actionview-6.0.3.2.gem
@@ -316,7 +344,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
344
  - !ruby/object:Gem::Version
317
345
  version: '0'
318
346
  requirements: []
319
- rubygems_version: 3.1.4
347
+ rubyforge_project:
348
+ rubygems_version: 2.6.13
320
349
  signing_key:
321
350
  specification_version: 4
322
351
  summary: Containerization framwork for Ruby on Rails applications.
@@ -1,17 +0,0 @@
1
- defaults: &defaults
2
- working_directory: /tmp
3
-
4
- version: 2
5
-
6
- jobs:
7
-
8
- build:
9
- machine: true
10
- steps:
11
- - checkout
12
- - run: gem install roro
13
- - run: roro generate::exposed ci
14
- - run: echo 'source roro/containers/gem/ci.env' >> $BASH_ENV
15
- - run: setup_gem_credentials.sh
16
- - run: gem install gem-release
17
- - run: gem release -k
@@ -1 +0,0 @@
1
- RUBYGEMS_API_KEY=<%= config['rubygems_api_key'] %>