handsome_fencer-circle_c_i 0.1.39 → 0.1.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/lib/handsome_fencer/circle_c_i/cli/dockerize.rb +15 -4
- data/lib/handsome_fencer/circle_c_i/templates/docker/containers/database/development.env +1 -3
- data/lib/handsome_fencer/circle_c_i/templates/docker/containers/database/production.env +0 -5
- data/lib/handsome_fencer/circle_c_i/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c2d157627c52291111579687d10bc3278cd9ba89e64c9eda1e119fda18a6dd2
|
4
|
+
data.tar.gz: ebbf1880c8d04be0bcdc471d79b0792c5ec79e76d5cf64bd09bd29670cf7d248
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d354527aec03f7925a0ebbdf7780519e951e1165b632f5fbddcdafe9648472acca525c9faafe4b5112920ee9d0de499303519dcaadd21b040c5b40f7d1fb9d69
|
7
|
+
data.tar.gz: 9f17cf1473d3063db1758046ae390eac41c4a8e1cec8712648ab7e112b24df4eb476278b9986ef5c8984adc3b4246aad57dd80fc71c1f0edca5624474681cb9d
|
data/README.md
CHANGED
@@ -57,10 +57,12 @@ $ cd sooperdooperapp
|
|
57
57
|
$ handsome_fencer-circle_c_i dockerize
|
58
58
|
```
|
59
59
|
|
60
|
-
|
60
|
+
You will be prompted to over-write a number of files. Please do so.
|
61
|
+
|
62
|
+
3) Ask Docker to use Rails to generate our dockerized Rails app in our current directory. Do NOT write over the :
|
61
63
|
|
62
64
|
```bash
|
63
|
-
$ docker-compose run app rails new .
|
65
|
+
$ docker-compose run app rails new . --skip
|
64
66
|
```
|
65
67
|
|
66
68
|
3a) If you're on a linux machine, you may need to chown the newly created files:
|
@@ -69,18 +71,18 @@ $ docker-compose run app rails new .
|
|
69
71
|
$ sudo chown <username><user group> -R .
|
70
72
|
```
|
71
73
|
|
72
|
-
|
74
|
+
If that doesn't work, Docker's [documentation](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) should get you pointed in the right direction.
|
73
75
|
|
74
76
|
4) Ask Docker to build the necessary images for our app and spool up containers using them:
|
75
77
|
|
76
78
|
```bash
|
77
|
-
$ docker-compose
|
79
|
+
$ docker-compose build
|
78
80
|
```
|
79
81
|
|
80
|
-
4)
|
82
|
+
4) Now we need to ask Docker to execute a command on the container started in the previous step. Issue the following command in a new terminal:
|
81
83
|
|
82
84
|
```bash
|
83
|
-
$ docker-compose
|
85
|
+
$ docker-compose run app bin/rails db:create db:migrate
|
84
86
|
```
|
85
87
|
|
86
88
|
You should now be able to see the Rails welcome screen upon clicking [http://localhost:3000/](http://localhost:3000/).
|
@@ -20,6 +20,15 @@ module HandsomeFencer
|
|
20
20
|
append_to_file ".gitignore", "\ndocker/**/*.env"
|
21
21
|
append_to_file ".gitignore", "\ndocker/**/*.key"
|
22
22
|
|
23
|
+
default_values = {
|
24
|
+
"APP_NAME" => "greenfield",
|
25
|
+
"SERVER_HOST" => "ip-address-of-your-server",
|
26
|
+
"DOCKERHUB_EMAIL" => "your-docker-hub-emaill",
|
27
|
+
"DOCKERHUB_USER" => "your-docker-hub-user-name",
|
28
|
+
"POSTGRES_USER" => "your-postgres-username",
|
29
|
+
"POSTGRES_PASSWORD" => "your-postgres-password",
|
30
|
+
"DOCKERHUB_PASS" => "your-docker-hub-password"
|
31
|
+
}
|
23
32
|
prompts = {
|
24
33
|
"APP_NAME" => "the name of your app",
|
25
34
|
"SERVER_HOST" => "the ip address of your server",
|
@@ -31,15 +40,17 @@ module HandsomeFencer
|
|
31
40
|
}
|
32
41
|
|
33
42
|
prompts.map do |key, prompt|
|
34
|
-
prompts[key] = ask("Please provide #{prompt}:")
|
43
|
+
prompts[key] = ask("Please provide #{prompt}:") || default_values[key]
|
35
44
|
end
|
36
45
|
|
37
46
|
account_type = ask("Will you be pushing images to Docker Hub under your user name or under your organization name instead?", :limited_to => %w[org user])
|
38
|
-
|
47
|
+
case account_type
|
48
|
+
when "org"
|
39
49
|
prompts['DOCKERHUB_ORG_NAME']= ask("Organization name:")
|
40
|
-
|
50
|
+
when "user"
|
51
|
+
prompts['DOCKERHUB_ORG_NAME']= "${DOCKERHUB_USER}"
|
52
|
+
when nil
|
41
53
|
prompts['DOCKERHUB_ORG_NAME']= "${DOCKERHUB_USER}"
|
42
|
-
end
|
43
54
|
|
44
55
|
prompts.map do |key, value|
|
45
56
|
append_to_file 'docker/env_files/circleci.env', "\nexport #{key}=#{value}"
|