dockerize-stack 0.0.2 → 0.0.3

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
2
  SHA1:
3
- metadata.gz: 30a4642bc8a46cdeedfc6d0062abaeecfd09579a
4
- data.tar.gz: 584a310b2387f69937bc46466e9defe73ec0a195
3
+ metadata.gz: 823ea680469c3eddd93d269e409b046814cea274
4
+ data.tar.gz: 76b84ce3dcc02fea9d4aea187d50909660282c7c
5
5
  SHA512:
6
- metadata.gz: 3c42729dcfee1657fca1aa75616b6da8637dae255de3cabffde2a4e3a5be98fd1b3569a67644af8e46c5cd42022bb81e6ecea4e0ff66e4f980a6c931fe57dcf0
7
- data.tar.gz: fd8d1a0fd1fb4048821fc962a3c6ed8e0c1ade427788139af085e78afc72b13d42999bb7cd2dbea5ddd576abce457f202abd67879b33a9ce96d0ed449da82c21
6
+ metadata.gz: 56f3afc47e86c54b3e3a6ef95bae47aacee460c9870484491011e9ff221d811bac67bc523489e0dce8c5aeee44b36bf04612275521768dcbfa1e5dc4d6356a65
7
+ data.tar.gz: 7bd94a0df553a9acbf037fd0214f99c7306299ea97024eac76c5765c7f8ca56b06277b0ddb864471c19b2889ab3b475847c0d8dbe986738477477352c7dca4e6
data/README.md CHANGED
@@ -44,4 +44,4 @@ example files generate:
44
44
  - [ ] Add phoenix generator
45
45
  - [ ] Solve use rails generator in container
46
46
  - [ ] Add integrations with all database types rails new supported ([mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc])
47
- - [ ] Integrate Build with private repository in the generator
47
+ - [x] Integrate Build with private repository in the generator
@@ -13,14 +13,25 @@ class DockerizeRails < Thor
13
13
  @ruby_version = ask("Ruby Version (default 2.4.3):")
14
14
  @ruby_version = "2.4.3" if @ruby_version == ""
15
15
  @database = ask("What is your Database?", limited_to: ["mysql", "postgresql"])
16
+ @id_rsa = ask("Would you need your id_rsa file to connect with GitHub? Type yes or no (default no):")
17
+ @id_rsa = "no" if @id_rsa == ""
16
18
 
17
19
  template "templates/Dockerfile.erb", "docker/development/Dockerfile"
18
- template "templates/entrypoint.sh", "docker/development/entrypoint.sh"
20
+ template "templates/entrypoint.sh.erb", "docker/development/entrypoint.sh"
19
21
  template "templates/docker-compose.yml.erb", "docker-compose.yml"
20
22
  template "templates/database-docker.yml.erb", "config/database-docker.yml"
21
- template "templates/dockerignore", ".dockerignore"
23
+ template "templates/dockerignore.erb", ".dockerignore"
24
+
22
25
  append_to_file '.gitignore', "
23
26
  volumes"
27
+ if @id_rsa == 'yes'
28
+ template "templates/id_rsa.sample", "docker/development/id_rsa.sample"
29
+ append_to_file '.gitignore', "
30
+ docker/development/id_rsa"
31
+ append_to_file '.gitignore', "
32
+ docker/development/id_rsa.sample"
33
+ end
34
+
24
35
  puts "Update your database.yml based in database-docker.yml"
25
36
  end
26
37
 
@@ -39,3 +39,12 @@ RUN apt-get update && apt-get install yarn
39
39
  RUN mkdir /app
40
40
  WORKDIR /app
41
41
  ADD . /app
42
+
43
+ <% if @id_rsa == 'yes' %>
44
+ RUN mkdir /root/.ssh
45
+ RUN cp id_rsa /root/.ssh/id_rsa
46
+ # RUN chmod 0644 /root/.ssh/id_rsa
47
+ RUN touch /root/.ssh/known_hosts
48
+ RUN eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa && ssh-add -l && ssh-add -L && echo "Host github.com\n\tIdentityFile ~/.ssh/id_rsa" >> /root/.ssh/config
49
+ RUN ssh-keyscan -t rsa github.com > ~/.ssh/known_hosts
50
+ <% end %>
@@ -1,5 +1,8 @@
1
+ gem install bundler
2
+
1
3
  bundle install
2
4
  yarn install
5
+
3
6
  rake db:create db:migrate
4
7
  rm -f tmp/pids/server.pid
5
8
  bundle exec rails server -p 3000 -b 0.0.0.0
@@ -0,0 +1 @@
1
+ Replace this file with your id_rsa file
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DockerizeStack
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerize-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Savignano
@@ -39,8 +39,9 @@ files:
39
39
  - lib/rails/templates/Dockerfile.erb
40
40
  - lib/rails/templates/database-docker.yml.erb
41
41
  - lib/rails/templates/docker-compose.yml.erb
42
- - lib/rails/templates/dockerignore
43
- - lib/rails/templates/entrypoint.sh
42
+ - lib/rails/templates/dockerignore.erb
43
+ - lib/rails/templates/entrypoint.sh.erb
44
+ - lib/rails/templates/id_rsa.sample
44
45
  - lib/version.rb
45
46
  homepage: https://github.com/MiguelSavignano/dockerize-stack
46
47
  licenses: