handsome_fencer-circle_c_i 0.1.42 → 0.1.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/handsome_fencer/circle_c_i/cli/dockerize.rb +21 -14
- 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: b18dee52b2f957362a3ecd283c67945d8468f9c9d5ca98c2497d60a3c3a90dc5
|
4
|
+
data.tar.gz: ea22ffa16ab6472a6d112f48a5f886f42e324f64cd1c606468db4df864ff075d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0024e6219058607c9bebf03f3129c2787033b0bddf491f0fa323a341145afb3c05915f87c4d9f0866ea5f715b80fe76c96243e1fd3eef747044b15e8e3c13c8e
|
7
|
+
data.tar.gz: 764c6ffb1fd91ed41466c1c3b14ec20c23247aa611a31ec23ce178e174f0bad9826bc6550f9635819a0825d395c01e078bf780a0d755475f85591fc130b0e96c
|
data/README.md
CHANGED
@@ -46,8 +46,8 @@ docker-compose version 1.21.0, build 5920eb0
|
|
46
46
|
1) Create a directory named after your new, greenfield app and change into that directory:
|
47
47
|
|
48
48
|
```bash
|
49
|
-
$ mkdir -p
|
50
|
-
$ cd
|
49
|
+
$ mkdir -p sooperdooper
|
50
|
+
$ cd sooperdooper
|
51
51
|
|
52
52
|
```
|
53
53
|
|
@@ -57,12 +57,12 @@ $ cd sooperdooperapp
|
|
57
57
|
$ handsome_fencer-circle_c_i dockerize
|
58
58
|
```
|
59
59
|
|
60
|
-
You will be prompted
|
60
|
+
You will be prompted with a number of questions. For demonstration purposes and to accept the defaults, hit enter at each prompt without answering, and again hit enter when asked if you'd like to over-write files.
|
61
61
|
|
62
|
-
3) Ask Docker to
|
62
|
+
3) Ask Docker to 'run' the 'rails new' command inside our 'app' container to generate a rails app in '.' (our current directory), with a flag specifying our 'database' as 'postgresql' and another flag so it will 'skip' over-writing our previously generated files:
|
63
63
|
|
64
64
|
```bash
|
65
|
-
$ docker-compose run app rails new . --skip
|
65
|
+
$ docker-compose run app rails new . --database=postgresql --skip
|
66
66
|
```
|
67
67
|
|
68
68
|
3a) If you're on a linux machine, you may need to chown the newly created files:
|
@@ -79,7 +79,7 @@ If that doesn't work, Docker's [documentation](https://docs.docker.com/install/l
|
|
79
79
|
$ docker-compose build
|
80
80
|
```
|
81
81
|
|
82
|
-
4) Now we need to ask Docker to execute a command on the container
|
82
|
+
4) Now we need to ask Docker to execute a command on the container we asked Docker to run in the previous step. Issue the following command in a new terminal:
|
83
83
|
|
84
84
|
```bash
|
85
85
|
$ docker-compose run app bin/rails db:create db:migrate
|
@@ -92,7 +92,7 @@ You should now be able to see the Rails welcome screen upon clicking [http://loc
|
|
92
92
|
1) Execute the install command:
|
93
93
|
|
94
94
|
```bash
|
95
|
-
$ handsome_fencer-circle_c_i
|
95
|
+
$ handsome_fencer-circle_c_i dockerize
|
96
96
|
```
|
97
97
|
|
98
98
|
2) You'll be asked which files to write over. Keep your Gemfile and let it write over everything else, including your .gitignore, any existing docker-compose.yml, .circleci/config.yml, and Gemfile.lock files.
|
@@ -25,33 +25,40 @@ module HandsomeFencer
|
|
25
25
|
"SERVER_HOST" => "ip-address-of-your-server",
|
26
26
|
"DOCKERHUB_EMAIL" => "your-docker-hub-emaill",
|
27
27
|
"DOCKERHUB_USER" => "your-docker-hub-user-name",
|
28
|
+
"DOCKERHUB_ORG" => "your-docker-hub-org-name",
|
29
|
+
"DOCKERHUB_PASS" => "your-docker-hub-password",
|
28
30
|
"POSTGRES_USER" => "your-postgres-username",
|
29
|
-
"POSTGRES_PASSWORD" => "your-postgres-password"
|
30
|
-
"DOCKERHUB_PASS" => "your-docker-hub-password"
|
31
|
+
"POSTGRES_PASSWORD" => "your-postgres-password"
|
31
32
|
}
|
33
|
+
|
32
34
|
prompts = {
|
33
35
|
"APP_NAME" => "the name of your app",
|
34
36
|
"SERVER_HOST" => "the ip address of your server",
|
35
37
|
"DOCKERHUB_EMAIL" => "your Docker Hub email",
|
36
38
|
"DOCKERHUB_USER" => "your Docker Hub username",
|
39
|
+
"DOCKERHUB_ORG" => "your Docker Hub organization name",
|
40
|
+
"DOCKERHUB_PASS" => "your Docker Hub password",
|
37
41
|
"POSTGRES_USER" => "your Postgres username",
|
38
|
-
"POSTGRES_PASSWORD" => "your Postgres password"
|
39
|
-
"DOCKERHUB_PASS" => "your Docker Hub password"
|
42
|
+
"POSTGRES_PASSWORD" => "your Postgres password"
|
40
43
|
}
|
41
44
|
|
42
45
|
prompts.map do |key, prompt|
|
43
|
-
prompts[key] = ask("Please provide #{prompt}:")
|
46
|
+
prompts[key] = ask("Please provide #{prompt}:")
|
47
|
+
if prompts[key].size == 0
|
48
|
+
prompts[key] = default_values[key]
|
49
|
+
end
|
44
50
|
end
|
45
51
|
|
46
|
-
account_type = ask("Will you be pushing images to Docker Hub under your user name or under your organization name instead?", :limited_to =>
|
47
|
-
case account_type
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
# account_type = ask("Will you be pushing images to Docker Hub under your user name or under your organization name instead?", :limited_to => ["org", "user", "skip"])
|
53
|
+
# case account_type
|
54
|
+
#
|
55
|
+
# when "o"
|
56
|
+
# prompts['DOCKERHUB_ORG_NAME']= ask("Organization name:")
|
57
|
+
# when "u"
|
58
|
+
# prompts['DOCKERHUB_ORG_NAME']= "${DOCKERHUB_USER}"
|
59
|
+
# when "s"
|
60
|
+
# prompts['DOCKERHUB_ORG_NAME']= "${DOCKERHUB_USER}"
|
61
|
+
# end
|
55
62
|
prompts.map do |key, value|
|
56
63
|
append_to_file 'docker/env_files/circleci.env', "\nexport #{key}=#{value}"
|
57
64
|
end
|