roro 0.3.6 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/{lib/roro/cli/templates/dockerize/.env → .circleci}/.keep +0 -0
- data/.circleci/config.yml +55 -0
- data/{lib/roro/cli/templates/ruby_gem → .circleci}/setup-gem-credentials.sh +1 -1
- data/.gitignore +13 -3
- data/Guardfile +2 -12
- data/docker-compose.yml +15 -0
- data/lib/roro.rb +0 -1
- data/lib/roro/cli.rb +70 -4
- data/lib/roro/cli/cli.rb +99 -0
- data/lib/roro/cli/configuration.rb +1 -0
- data/lib/roro/cli/expose.rb +8 -7
- data/lib/roro/cli/generate/config.rb +5 -5
- data/lib/roro/cli/generate/generate_keys.rb +47 -79
- data/lib/roro/cli/greenfield.rb +11 -21
- data/lib/roro/cli/obfuscate.rb +10 -11
- data/lib/roro/cli/rollon.rb +2 -2
- data/lib/roro/cli/rollon/stories.rb +2 -3
- data/lib/roro/cli/{templates/dockerize/.env/development/.keep → rollon/stories/database.rb} +0 -0
- data/lib/roro/cli/rollon/stories/rails.rb +1 -0
- data/lib/roro/cli/{templates/dockerize → rollon/stories/rails}/.keep +0 -0
- data/lib/roro/cli/rollon/{database → stories/rails}/database.rb +2 -0
- data/lib/roro/cli/rollon/{database → stories/rails/database}/with_mysql.rb +0 -0
- data/lib/roro/cli/rollon/{database/with_postgres.rb → stories/rails/database/with_postgresql.rb} +0 -0
- data/lib/roro/cli/rollon/stories/ruby_gem.rb +77 -0
- data/lib/roro/cli/rollon/stories/ruby_gem/with_ci_cd.rb +45 -0
- data/lib/roro/cli/rollon/stories/stories.rb +3 -0
- data/lib/roro/cli/ruby_gem.rb +60 -47
- data/lib/roro/cli/templates/base/.dockerignore +2 -2
- data/lib/roro/cli/templates/base/.env/database.mysql.env.tt +0 -1
- data/lib/roro/cli/templates/base/.env/database.pg.env.tt +0 -1
- data/lib/roro/cli/templates/base/.env/web.env.tt +1 -0
- data/lib/roro/cli/templates/base/Dockerfile.tt +53 -15
- data/lib/roro/cli/templates/greenfield/Dockerfile.tt +1 -1
- data/lib/roro/cli/templates/ruby_gem/{docker/env_files → .circleci}/.keep +0 -0
- data/lib/roro/cli/templates/ruby_gem/.circleci/config.yml.tt +40 -0
- data/lib/roro/cli/templates/ruby_gem/.circleci/setup-gem-credentials.sh +3 -0
- data/lib/roro/cli/templates/ruby_gem/docker-compose.yml +10 -4
- data/lib/roro/cli/templates/ruby_gem/{docker/keys → roro/containers}/.keep +0 -0
- data/lib/roro/cli/templates/ruby_gem/roro/containers/ruby_image/Dockerfile.tt +16 -0
- data/lib/roro/cli/templates/ruby_gem/roro/containers/ruby_image/ci.env.tt +1 -0
- data/lib/roro/cli/templates/ruby_gem/roro/keys/.keep +0 -0
- data/lib/roro/cli/templates/stories/rails/database/with_mysql/_service.yml +10 -0
- data/lib/roro/cli/templates/stories/rails/database/with_postgresql/.keep +0 -0
- data/lib/roro/cli/templates/stories/rails/database/with_postgresql/_service.yml +7 -0
- data/lib/roro/cli/templates/stories/ruby_gem/with_ci_cd/_build.yml +11 -0
- data/lib/roro/version.rb +1 -1
- data/roro.gemspec +3 -3
- data/roro/containers/.keep +0 -0
- data/roro/containers/ruby_image/Dockerfile +16 -0
- data/roro/containers/ruby_image/ci.env.enc +2 -0
- data/roro/keys/.keep +0 -0
- data/sandbox/.keep +0 -0
- data/tmp/.keep +0 -0
- data/vendor/cache/concurrent-ruby-1.1.7.gem +0 -0
- data/vendor/cache/gem-release-2.1.1.gem +0 -0
- metadata +59 -35
- data/lib/roro/cli/generate_keys.rb +0 -79
- data/lib/roro/cli/templates/circleci/config.yml.tt +0 -70
- data/lib/roro/cli/templates/dockerize/.env/development/database +0 -3
- data/lib/roro/cli/templates/dockerize/.env/development/web +0 -1
- data/lib/roro/cli/templates/dockerize/Dockerfile.tt +0 -23
- data/lib/roro/cli/templates/dockerize/docker-compose.yml.tt +0 -60
- data/lib/roro/cli/templates/dockerize/docker-entrypoint.sh +0 -9
- data/lib/roro/cli/templates/quickstart/Dockerfile.tt +0 -20
- data/lib/roro/cli/templates/quickstart/database.yml +0 -85
- data/lib/roro/cli/templates/quickstart/docker-compose.yml +0 -17
- data/lib/roro/cli/templates/quickstart/entrypoint.sh +0 -8
- data/lib/roro/cli/templates/ruby_gem/.gitignore +0 -8
- data/lib/roro/cli/templates/ruby_gem/config.yml +0 -122
- data/lib/roro/cli/templates/ruby_gem/docker/containers/app/Dockerfile.tt +0 -10
- data/vendor/cache/concurrent-ruby-1.1.6.gem +0 -0
@@ -1,70 +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 handsome_fencer-circle_c_i
|
13
|
-
- run: handsome_fencer-circle_c_i expose circleci
|
14
|
-
- run: handsome_fencer-circle_c_i expose development
|
15
|
-
- run: echo 'source docker/env_files/circleci.env' >> $BASH_ENV
|
16
|
-
- run: docker-compose up -d <%= config[:app_name] %> --build
|
17
|
-
- run: docker-compose exec <%= config[:app_name] %> bin/rails db:create db:migrate
|
18
|
-
- run: docker-compose exec <%= config[:app_name] %> bin/rails test
|
19
|
-
|
20
|
-
push:
|
21
|
-
machine: true
|
22
|
-
steps:
|
23
|
-
- checkout
|
24
|
-
- run: gem install handsome_fencer-circle_c_i
|
25
|
-
- run: handsome_fencer-circle_c_i expose circleci
|
26
|
-
- run: handsome_fencer-circle_c_i expose development
|
27
|
-
- run: echo 'source docker/env_files/circleci.env' >> $BASH_ENV
|
28
|
-
- run: docker-compose build <%= config[:app_name] %> web
|
29
|
-
- run: docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASS
|
30
|
-
- run: docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASS
|
31
|
-
- run:
|
32
|
-
name: Tag <%= config[:app_name] %> image
|
33
|
-
command: docker tag $(docker images | grep project_<%= config[:app_name] %> | awk '{ print $3 }') ${DOCKERHUB_ORG_NAME}/${APP_NAME}_app:$DEPLOY_TAG
|
34
|
-
- run:
|
35
|
-
name: Tag web image
|
36
|
-
command: docker tag $(docker images | grep project_web | awk '{ print $3 }') ${DOCKERHUB_ORG_NAME}/${APP_NAME}_web:$DEPLOY_TAG
|
37
|
-
|
38
|
-
|
39
|
-
- run: docker push ${DOCKERHUB_ORG_NAME}/${APP_NAME}_app:$DEPLOY_TAG
|
40
|
-
- run: docker push ${DOCKERHUB_ORG_NAME}/${APP_NAME}_web:$DEPLOY_TAG
|
41
|
-
|
42
|
-
deploy:
|
43
|
-
machine: true
|
44
|
-
steps:
|
45
|
-
- checkout
|
46
|
-
- add_ssh_keys
|
47
|
-
- run: gem install handsome_fencer-circle_c_i
|
48
|
-
- run: handsome_fencer-circle_c_i expose circleci
|
49
|
-
- run: handsome_fencer-circle_c_i expose development
|
50
|
-
- run: echo 'source docker/env_files/circleci.env' >> $BASH_ENV
|
51
|
-
|
52
|
-
- run: rake --rakefile .circleci/Rakefile
|
53
|
-
|
54
|
-
workflows:
|
55
|
-
version: 2
|
56
|
-
build-and-deploy:
|
57
|
-
jobs:
|
58
|
-
- build
|
59
|
-
- push:
|
60
|
-
requires:
|
61
|
-
- build
|
62
|
-
filters:
|
63
|
-
branches:
|
64
|
-
only: master
|
65
|
-
- deploy:
|
66
|
-
requires:
|
67
|
-
- push
|
68
|
-
filters:
|
69
|
-
branches:
|
70
|
-
only: master
|
@@ -1 +0,0 @@
|
|
1
|
-
DATABASE_HOST=database
|
@@ -1,23 +0,0 @@
|
|
1
|
-
FROM ruby:<%= config[:ruby_version] %>
|
2
|
-
|
3
|
-
|
4
|
-
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
5
|
-
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
6
|
-
RUN apt-get update -qq && apt-get install -y build-essential git nodejs yarn
|
7
|
-
|
8
|
-
|
9
|
-
ENV APP_HOME /usr/src/app/
|
10
|
-
RUN mkdir $APP_HOME
|
11
|
-
WORKDIR $APP_HOME
|
12
|
-
|
13
|
-
COPY Gemfile* $APP_HOME
|
14
|
-
|
15
|
-
ENV BUNDLE_PATH /gems
|
16
|
-
|
17
|
-
RUN bundle install
|
18
|
-
RUN yarn
|
19
|
-
|
20
|
-
COPY . ./$APP_HOME
|
21
|
-
|
22
|
-
|
23
|
-
|
@@ -1,60 +0,0 @@
|
|
1
|
-
version: '3'
|
2
|
-
|
3
|
-
services:
|
4
|
-
|
5
|
-
web:
|
6
|
-
build: .
|
7
|
-
depends_on:
|
8
|
-
- database
|
9
|
-
- webpack_dev_server
|
10
|
-
- redis
|
11
|
-
# entrypoint: ./docker-entrypoint.sh
|
12
|
-
command: ["bin/rails", "s", "-b", "0.0.0.0"]
|
13
|
-
|
14
|
-
ports:
|
15
|
-
- "3000:3000"
|
16
|
-
- "4000:4000"
|
17
|
-
volumes:
|
18
|
-
- .:/usr/src/app
|
19
|
-
- gem_cache:/gems
|
20
|
-
env_file:
|
21
|
-
- .env/development/web
|
22
|
-
- .env/development/database
|
23
|
-
environment:
|
24
|
-
- WEBPACKER_DEV_SERVER_HOST=webpack_dev_server
|
25
|
-
|
26
|
-
webpack_dev_server:
|
27
|
-
build: .
|
28
|
-
command: ./bin/webpack-dev-server
|
29
|
-
ports:
|
30
|
-
- 3035:3035
|
31
|
-
volumes:
|
32
|
-
- .:/usr/src/app
|
33
|
-
- gem_cache:/gems
|
34
|
-
env_file:
|
35
|
-
- .env/development/database
|
36
|
-
- .env/development/web
|
37
|
-
environment:
|
38
|
-
- WEBPACKER_DEV_SERVER_HOST=0.0.0.0
|
39
|
-
|
40
|
-
redis:
|
41
|
-
image: redis
|
42
|
-
|
43
|
-
database:
|
44
|
-
image: postgres
|
45
|
-
env_file:
|
46
|
-
- .env/development/database
|
47
|
-
volumes:
|
48
|
-
- db_data:/var/lib/postgresql/data
|
49
|
-
|
50
|
-
system_tests:
|
51
|
-
image: selenium/standalone-chrome-debug
|
52
|
-
logging:
|
53
|
-
driver: none
|
54
|
-
ports:
|
55
|
-
- "35729:35729"
|
56
|
-
- "5900:5900"
|
57
|
-
|
58
|
-
volumes:
|
59
|
-
db_data:
|
60
|
-
gem_cache:
|
@@ -1,20 +0,0 @@
|
|
1
|
-
FROM ruby:<%= config[:ruby_version] %>
|
2
|
-
|
3
|
-
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
|
4
|
-
RUN mkdir /myapp
|
5
|
-
WORKDIR /myapp
|
6
|
-
COPY Gemfile /myapp/Gemfile
|
7
|
-
COPY Gemfile.lock /myapp/Gemfile.lock
|
8
|
-
|
9
|
-
RUN gem install bundler
|
10
|
-
RUN bundle install
|
11
|
-
COPY . /myapp
|
12
|
-
|
13
|
-
# Add a script to be executed every time the container starts.
|
14
|
-
COPY entrypoint.sh /usr/bin/
|
15
|
-
RUN chmod +x /usr/bin/entrypoint.sh
|
16
|
-
ENTRYPOINT ["entrypoint.sh"]
|
17
|
-
EXPOSE 3000
|
18
|
-
|
19
|
-
# Start the main process.
|
20
|
-
CMD ["rails", "server", "-b", "0.0.0.0"]
|
@@ -1,85 +0,0 @@
|
|
1
|
-
# PostgreSQL. Versions 9.3 and up are supported.
|
2
|
-
#
|
3
|
-
# Install the pg driver:
|
4
|
-
# gem install pg
|
5
|
-
# On macOS with Homebrew:
|
6
|
-
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
|
7
|
-
# On macOS with MacPorts:
|
8
|
-
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
|
9
|
-
# On Windows:
|
10
|
-
# gem install pg
|
11
|
-
# Choose the win32 build.
|
12
|
-
# Install PostgreSQL and put its /bin directory on your path.
|
13
|
-
#
|
14
|
-
# Configure Using Gemfile
|
15
|
-
# gem 'pg'
|
16
|
-
#
|
17
|
-
default: &default
|
18
|
-
adapter: postgresql
|
19
|
-
encoding: unicode
|
20
|
-
# For details on connection pooling, see Rails configuration guide
|
21
|
-
# https://guides.rubyonrails.org/configuring.html#database-pooling
|
22
|
-
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
23
|
-
|
24
|
-
development:
|
25
|
-
<<: *default
|
26
|
-
database: sandbox_development
|
27
|
-
|
28
|
-
# The specified database role being used to connect to postgres.
|
29
|
-
# To create additional roles in postgres see `$ createuser --help`.
|
30
|
-
# When left blank, postgres will use the default role. This is
|
31
|
-
# the same name as the operating system user that initialized the database.
|
32
|
-
#username: sandbox
|
33
|
-
|
34
|
-
# The password associated with the postgres role (username).
|
35
|
-
#password:
|
36
|
-
|
37
|
-
# Connect on a TCP socket. Omitted by default since the client uses a
|
38
|
-
# domain socket that doesn't need configuration. Windows does not have
|
39
|
-
# domain sockets, so uncomment these lines.
|
40
|
-
#host: localhost
|
41
|
-
|
42
|
-
# The TCP port the server listens on. Defaults to 5432.
|
43
|
-
# If your server runs on a different port number, change accordingly.
|
44
|
-
#port: 5432
|
45
|
-
|
46
|
-
# Schema search path. The server defaults to $user,public
|
47
|
-
#schema_search_path: myapp,sharedapp,public
|
48
|
-
|
49
|
-
# Minimum log levels, in increasing order:
|
50
|
-
# debug5, debug4, debug3, debug2, debug1,
|
51
|
-
# log, notice, warning, error, fatal, and panic
|
52
|
-
# Defaults to warning.
|
53
|
-
#min_messages: notice
|
54
|
-
|
55
|
-
# Warning: The database defined as "test" will be erased and
|
56
|
-
# re-generated from your development database when you run "rake".
|
57
|
-
# Do not set this db to the same as development or production.
|
58
|
-
test:
|
59
|
-
<<: *default
|
60
|
-
database: sandbox_test
|
61
|
-
|
62
|
-
# As with config/credentials.yml, you never want to store sensitive information,
|
63
|
-
# like your database password, in your source code. If your source code is
|
64
|
-
# ever seen by anyone, they now have access to your database.
|
65
|
-
#
|
66
|
-
# Instead, provide the password as a unix environment variable when you boot
|
67
|
-
# the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
|
68
|
-
# for a full rundown on how to provide these environment variables in a
|
69
|
-
# production deployment.
|
70
|
-
#
|
71
|
-
# On Heroku and other platform providers, you may have a full connection URL
|
72
|
-
# available as an environment variable. For example:
|
73
|
-
#
|
74
|
-
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
|
75
|
-
#
|
76
|
-
# You can use this database configuration with:
|
77
|
-
#
|
78
|
-
# production:
|
79
|
-
# url: <%= ENV['DATABASE_URL'] %>
|
80
|
-
#
|
81
|
-
production:
|
82
|
-
<<: *default
|
83
|
-
database: sandbox_production
|
84
|
-
username: sandbox
|
85
|
-
password: <%= ENV['SANDBOX_DATABASE_PASSWORD'] %>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
version: '3'
|
2
|
-
services:
|
3
|
-
db:
|
4
|
-
image: postgres
|
5
|
-
volumes:
|
6
|
-
- ./tmp/db:/var/lib/postgresql/data
|
7
|
-
environment:
|
8
|
-
POSTGRES_PASSWORD: password
|
9
|
-
web:
|
10
|
-
build: .
|
11
|
-
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
|
12
|
-
volumes:
|
13
|
-
- .:/myapp
|
14
|
-
ports:
|
15
|
-
- "3000:3000"
|
16
|
-
depends_on:
|
17
|
-
- db
|
@@ -1,122 +0,0 @@
|
|
1
|
-
defaults: &defaults
|
2
|
-
working_directory: /repo
|
3
|
-
|
4
|
-
version: 2
|
5
|
-
|
6
|
-
jobs:
|
7
|
-
|
8
|
-
build:
|
9
|
-
machine: true
|
10
|
-
steps:
|
11
|
-
- checkout
|
12
|
-
|
13
|
-
test:
|
14
|
-
docker:
|
15
|
-
- image: circleci/ruby:2.5.3
|
16
|
-
steps:
|
17
|
-
- checkout
|
18
|
-
- setup_remote_docker
|
19
|
-
- run: gem install bundler
|
20
|
-
- run: bundle
|
21
|
-
- run: rake install
|
22
|
-
- run: mkdir tmp
|
23
|
-
- run: docker-compose up app
|
24
|
-
|
25
|
-
test_all:
|
26
|
-
docker:
|
27
|
-
- image: circleci/ruby:2.5.3
|
28
|
-
steps:
|
29
|
-
- checkout
|
30
|
-
- setup_remote_docker
|
31
|
-
- run: gem install bundler
|
32
|
-
- run: bundle
|
33
|
-
- run: rake install
|
34
|
-
- run: mkdir tmp
|
35
|
-
- run: docker-compose up
|
36
|
-
|
37
|
-
build-greenfield:
|
38
|
-
machine: true
|
39
|
-
steps:
|
40
|
-
- checkout
|
41
|
-
- run: bundle
|
42
|
-
- run: rake install
|
43
|
-
- run:
|
44
|
-
name: Greenfield
|
45
|
-
working_directory: sooperdooper
|
46
|
-
command: |
|
47
|
-
bundle
|
48
|
-
sleep 2s
|
49
|
-
rake install
|
50
|
-
sleep 5s
|
51
|
-
roro greenfield
|
52
|
-
sleep 5s
|
53
|
-
curl -Is localhost:3000 | head -n 1
|
54
|
-
|
55
|
-
build-rollon:
|
56
|
-
machine: true
|
57
|
-
steps:
|
58
|
-
- checkout
|
59
|
-
- run: bundle
|
60
|
-
- run: rake install
|
61
|
-
- run:
|
62
|
-
name: Rollon
|
63
|
-
working_directory: test_apps/dummy
|
64
|
-
command: |
|
65
|
-
roro rollon
|
66
|
-
docker-compose up -d
|
67
|
-
docker-compose exec app bin/rails db:create
|
68
|
-
docker-compose exec app rake test
|
69
|
-
curl -Is localhost:3000 | head -n 1
|
70
|
-
|
71
|
-
release:
|
72
|
-
docker:
|
73
|
-
- image: circleci/ruby:2.5.3
|
74
|
-
steps:
|
75
|
-
- checkout
|
76
|
-
- setup_remote_docker
|
77
|
-
- run: gem install bundler
|
78
|
-
- run: bundle
|
79
|
-
- run: rake install
|
80
|
-
- run: roro expose
|
81
|
-
- run: echo 'source docker/env_files/circleci.env' >> $BASH_ENV
|
82
|
-
- run: bash .circleci/setup-gem-credentials.sh
|
83
|
-
- run: rake release
|
84
|
-
|
85
|
-
|
86
|
-
workflows:
|
87
|
-
version: 2
|
88
|
-
build-and-deploy:
|
89
|
-
jobs:
|
90
|
-
- build
|
91
|
-
- test:
|
92
|
-
filters:
|
93
|
-
branches:
|
94
|
-
except:
|
95
|
-
- build-greenfield
|
96
|
-
- build-rollon
|
97
|
-
- release
|
98
|
-
- master
|
99
|
-
- build-greenfield:
|
100
|
-
filters:
|
101
|
-
branches:
|
102
|
-
only:
|
103
|
-
- build-greenfield
|
104
|
-
- master
|
105
|
-
- build-rollon:
|
106
|
-
filters:
|
107
|
-
branches:
|
108
|
-
only:
|
109
|
-
- build-rollon
|
110
|
-
- master
|
111
|
-
- test_all:
|
112
|
-
filters:
|
113
|
-
branches:
|
114
|
-
only:
|
115
|
-
- development
|
116
|
-
- master
|
117
|
-
|
118
|
-
- release:
|
119
|
-
filters:
|
120
|
-
branches:
|
121
|
-
only:
|
122
|
-
- release
|
@@ -1,10 +0,0 @@
|
|
1
|
-
FROM ruby:<%= config[:ruby_version] %>-alpine
|
2
|
-
|
3
|
-
RUN apk add --no-cache --update build-base linux-headers \
|
4
|
-
postgresql-dev nodejs tzdata libxml2-dev libxslt-dev git
|
5
|
-
|
6
|
-
WORKDIR /usr/src/app
|
7
|
-
COPY . /usr/src/app/
|
8
|
-
RUN rake install
|
9
|
-
RUN gem install bundler
|
10
|
-
RUN bundle
|