plastic_rails 0.1.0 → 0.1.1

This diff has not been reviewed by any users.
Log in in order to be able to vote.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6da9466a21fafd8f0adf91a52a0cdc8a8c3292774a46e983963c47d39e9084f8
4
- data.tar.gz: ad73731d007875b4e2ccf5df6f2a029e0457071cefadc29a749d570d7ac0806d
3
+ metadata.gz: fdb7c135f44fc073f189797c4e28186ac696dd3253a655a39b20aa655cac2b33
4
+ data.tar.gz: 80496abf6809a62be2d3dada9802f33070f8a8e04071134024d9495e5e3b1699
5
5
  SHA512:
6
- metadata.gz: 72062d13c60db678f6af2acd78e9d6cf9735590a35d0d86e11eb9552446700d84540140f12d8237e8da16505c4f332f05046f8b16a99449b68df6cbb250f49e5
7
- data.tar.gz: 072b6fc02654c3476ce558723ede41157fc93a24c4a9342f224d1ff5de919cbd556a1efa91f2bd7bd1864231e45e604a3acecde713beebfb7efdafae87349b90
6
+ metadata.gz: 8572821cf9ad1da0dd53719a53c959a8d48604a399148a7f6246e6eaea4e00bc4f20cec7ec2dc839a16de4ce8c56566fc75c1b086a3cf9635815142ed2f320fc
7
+ data.tar.gz: feab6b5c1495b63ef607162368cd108d3283e98d255f945900a4ffaeb321a073e3998fc22e2bb5ba455ce4e65adeb654c0590b80e7de45c6f90d3fa4cf5cbbba
@@ -1,3 +1,3 @@
1
1
  module PlasticRails
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plastic_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koki Hashimoto
@@ -77,18 +77,11 @@ files:
77
77
  - lib/tmpl/build.sh
78
78
  - lib/tmpl/docker-compose.yml
79
79
  - lib/tmpl/init/Gemfile
80
+ - lib/tmpl/init/Gemfile.lock
80
81
  - lib/tmpl/init/application_template/template.rb
81
82
  - lib/tmpl/init/application_template/template/config/database.yml
82
83
  - lib/tmpl/setup.sh
83
84
  - plastic_rails.gemspec
84
- - tmpl/Dockerfile
85
- - tmpl/apps/.keep
86
- - tmpl/build.sh
87
- - tmpl/docker-compose.yml
88
- - tmpl/init/Gemfile
89
- - tmpl/init/application_template/template.rb
90
- - tmpl/init/application_template/template/config/database.yml
91
- - tmpl/setup.sh
92
85
  homepage: http://github.com/koki-h/plastic_rails
93
86
  licenses:
94
87
  - MIT
@@ -1,37 +0,0 @@
1
- FROM ruby:2.6.5-alpine3.9
2
-
3
- RUN apk update
4
- RUN apk upgrade
5
-
6
- RUN apk add --no-cache \
7
- bash git vim openssh openssl yarn sudo su-exec shadow tzdata \
8
- mysql-client mysql-dev\
9
- build-base libxml2-dev libxslt-dev
10
-
11
- ARG UID=1000
12
- ARG GID=1000
13
-
14
- RUN mkdir /var/mail
15
- RUN groupadd -g $GID devel
16
- RUN useradd -u $UID -g devel -m devel
17
- RUN echo "devel ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
18
-
19
- # install rails
20
- WORKDIR /tmp
21
- COPY init/Gemfile /tmp/Gemfile
22
- COPY init/Gemfile.lock /tmp/Gemfile.lock
23
- RUN bundle install
24
-
25
- COPY ./apps /apps
26
-
27
- RUN apk add --no-cache openssl
28
-
29
- WORKDIR /apps
30
-
31
- USER devel
32
-
33
- RUN openssl rand -hex 64 > /home/devel/.secret_key_base
34
- RUN echo $'export SECRET_KEY_BASE=$(cat /home/devel/.secret_key_base)' \
35
- >> /home/devel/.bashrc
36
-
37
- COPY init/application_template/ /tmp/application_template/
File without changes
@@ -1,20 +0,0 @@
1
- #!/bin/bash
2
- set -eu
3
- APPNAME=$1
4
- BUILD_CMD="docker-compose build --no-cache --build-arg APPNAME=$APPNAME"
5
- RUN_ON_WEB_CMD="docker-compose run --rm web"
6
- OSTYPE=$(uname)
7
-
8
- case "$OSTYPE" in
9
- Darwin*)
10
- $BUILD_CMD web
11
- ;;
12
- Linux*)
13
- $BUILD_CMD --build-arg UID=$(id -u) --build-arg GID=$(id -g) web
14
- ;;
15
- *)
16
- echo "Unknown OS Type: $OSTYPE"
17
- ;;
18
- esac
19
-
20
- $RUN_ON_WEB_CMD rails new $APPNAME --database=mysql --skip-bundle --skip-webpack-install -m /tmp/application_template/template.rb
@@ -1,28 +0,0 @@
1
- version: '3'
2
- services:
3
- db:
4
- image: mysql:5.7
5
- environment:
6
- MYSQL_USER: root
7
- MYSQL_ROOT_PASSWORD: password
8
- ports:
9
- - '3316:3306'
10
- volumes:
11
- - %DB_PATH%:/var/lib/mysql
12
-
13
- web:
14
- build: .
15
- command: /bin/sh
16
- environment:
17
- WEBPACKER_DEV_SERVER_HOST: "0.0.0.0"
18
- RAILS_SERVE_STATIC_FILES: "1"
19
- EDITOR: "vim"
20
- volumes:
21
- - ./apps:/apps
22
- ports:
23
- - "3000:3000"
24
- - "3035:3035"
25
- depends_on:
26
- - db
27
- tty: true
28
- working_dir: /apps/
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org'
2
- gem 'rails', '~> 6.0.0'
@@ -1,12 +0,0 @@
1
- @app_name = app_name
2
- def source_paths
3
- ["#{__dir__}/template"]
4
- end
5
-
6
- # Database
7
- inside 'config' do
8
- remove_file "database.yml"
9
- copy_file "database.yml"
10
- gsub_file 'database.yml', /%APPNAME%/, @app_name
11
- gsub_file 'database.yml', /%APPNAME_UPPERCASE%/, @app_name.upcase
12
- end
@@ -1,54 +0,0 @@
1
- # MySQL. Versions 5.5.8 and up are supported.
2
- #
3
- # Install the MySQL driver
4
- # gem install mysql2
5
- #
6
- # Ensure the MySQL gem is defined in your Gemfile
7
- # gem 'mysql2'
8
- #
9
- # And be sure to use new-style password hashing:
10
- # https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html
11
- #
12
- default: &default
13
- adapter: mysql2
14
- encoding: utf8mb4
15
- pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
16
- username: root
17
- password: password
18
- host: db
19
-
20
- development:
21
- <<: *default
22
- database: %APPNAME%_development
23
-
24
- # Warning: The database defined as "test" will be erased and
25
- # re-generated from your development database when you run "rake".
26
- # Do not set this db to the same as development or production.
27
- test:
28
- <<: *default
29
- database: %APPNAME%_test
30
-
31
- # As with config/credentials.yml, you never want to store sensitive information,
32
- # like your database password, in your source code. If your source code is
33
- # ever seen by anyone, they now have access to your database.
34
- #
35
- # Instead, provide the password as a unix environment variable when you boot
36
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
37
- # for a full rundown on how to provide these environment variables in a
38
- # production deployment.
39
- #
40
- # On Heroku and other platform providers, you may have a full connection URL
41
- # available as an environment variable. For example:
42
- #
43
- # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
44
- #
45
- # You can use this database configuration with:
46
- #
47
- # production:
48
- # url: <%= ENV['DATABASE_URL'] %>
49
- #
50
- production:
51
- <<: *default
52
- database: %APPNAME%_production
53
- username: %APPNAME%
54
- password: <%= ENV['%APPNAME_UPPERCASE%_DATABASE_PASSWORD'] %>
@@ -1,19 +0,0 @@
1
- #!/bin/bash
2
- set -eu
3
- ESC="\e["
4
- ESCEND=m
5
- COLOR_OFF=$(printf ${ESC}${ESCEND})
6
- COLOR_CMD=$(printf "${ESC}36;1;${ESCEND}") # front: cyan;bold
7
- RUN_ON_WEB_CMD="docker-compose exec web"
8
- #RUN_ON_WEB_CMD="docker-compose run --rm web"
9
- function docker_run {
10
- cmd=$1
11
- echo ${COLOR_CMD}${cmd}${COLOR_OFF}
12
- $RUN_ON_WEB_CMD $cmd
13
- }
14
- docker-compose up -d
15
- docker_run "bundle install "
16
- docker_run "yarn install --check-files"
17
- docker_run "yarn upgrade"
18
- docker_run "rails webpacker:install"
19
- docker_run "rails db:setup"