tenma 0.9.0 → 0.9.1
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 -4
- data/lib/tenma/ichiba/instance.rb +9 -6
- data/lib/tenma/runnable.rb +15 -0
- data/lib/tenma/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5b17dc2244737cd89ae7a2e743fe9c02fbf48c0
|
4
|
+
data.tar.gz: f18d35a347f7129f51fd292d7f9e7c0f541ddf1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f89d786f93a650ce7e9ee8c937a8a8e8dc30bd07fcaae4c197600cdf8acdecd3c572c072833ff6650273ab128d8aad6249c8d0fe324657ae350a751243b16b95
|
7
|
+
data.tar.gz: 66b11cb1553d02f983dc94d7bd2fa932eb601d5f05a96d548184e6fbc0cc0aef580a58296a4525b2221e42828b07e6a6542f391e34c73a0d7c25aa1b41e1eaa9
|
data/README.md
CHANGED
@@ -97,7 +97,11 @@ Options:
|
|
97
97
|
|
98
98
|
### :relaxed::relaxed: Manipulate "Android-remote-build" instance. :relaxed::relaxed:
|
99
99
|
|
100
|
-
#### 1. :
|
100
|
+
#### 1. :cloud: Install and init `gcloud` command.
|
101
|
+
|
102
|
+
[About gcloud](https://cloud.google.com/sdk/gcloud)
|
103
|
+
|
104
|
+
#### 2. :paperclip: Set `TENMA_ICHIBA_INSTANCE_PROJECT` environment.
|
101
105
|
|
102
106
|
Set `TENMA_ICHIBA_INSTANCE_PROJECT` at .zshrc or .bashrc.
|
103
107
|
|
@@ -105,7 +109,7 @@ Set `TENMA_ICHIBA_INSTANCE_PROJECT` at .zshrc or .bashrc.
|
|
105
109
|
export TENMA_ICHIBA_INSTANCE_PROJECT=your-gcp-project
|
106
110
|
```
|
107
111
|
|
108
|
-
####
|
112
|
+
#### 3. :memo: Create `tenma/ichiba.yml`
|
109
113
|
|
110
114
|
```yaml
|
111
115
|
android_sdk:
|
@@ -119,7 +123,7 @@ android_sdk:
|
|
119
123
|
- extra-google-google_play_services
|
120
124
|
```
|
121
125
|
|
122
|
-
####
|
126
|
+
#### 4. :runner: Run command
|
123
127
|
|
124
128
|
Run following command, if you want to create and provision remote-build instance.
|
125
129
|
```
|
@@ -131,7 +135,7 @@ Run following command, if you want to delete remote-build instance.
|
|
131
135
|
bundle exec tenma ichiba --delete-instance
|
132
136
|
```
|
133
137
|
|
134
|
-
####
|
138
|
+
#### 5. :helicopter: Finish!
|
135
139
|
|
136
140
|
Execute the `tenma help ichiba` command, If you want more information.
|
137
141
|
|
@@ -5,6 +5,9 @@ module Tenma
|
|
5
5
|
class Instance
|
6
6
|
|
7
7
|
attr_reader :context, :name, :type, :zone, :project, :disk_size
|
8
|
+
|
9
|
+
include Tenma::Runnable
|
10
|
+
|
8
11
|
def initialize(context)
|
9
12
|
@context = context
|
10
13
|
@name = @context.options.raw.instance_name
|
@@ -16,7 +19,7 @@ module Tenma
|
|
16
19
|
|
17
20
|
def create
|
18
21
|
puts "Create instance..."
|
19
|
-
puts
|
22
|
+
puts run "gcloud compute instances create #{name} --image-family ubuntu-1710 --image-project ubuntu-os-cloud --preemptible --machine-type #{type} --zone #{zone} --project #{project} --boot-disk-size #{disk_size}GB"
|
20
23
|
end
|
21
24
|
|
22
25
|
def provision
|
@@ -29,8 +32,8 @@ module Tenma
|
|
29
32
|
end
|
30
33
|
|
31
34
|
# In order to execute Itamae, it is necessary to set up ssh config.
|
32
|
-
puts
|
33
|
-
puts
|
35
|
+
puts run "gcloud compute config-ssh --remove --ssh-key-file #{file} --project #{project}"
|
36
|
+
puts run "gcloud compute config-ssh --ssh-key-file #{file} --project #{project}"
|
34
37
|
|
35
38
|
puts "Provision instance..."
|
36
39
|
role_file = File.expand_path('../itamae/roles/remote.rb', __FILE__)
|
@@ -47,14 +50,14 @@ module Tenma
|
|
47
50
|
|
48
51
|
def delete
|
49
52
|
puts "Delete instance..."
|
50
|
-
puts
|
53
|
+
puts run "gcloud compute instances delete #{name} --delete-disks all --quiet --zone #{zone} --project #{project}"
|
51
54
|
end
|
52
55
|
|
53
56
|
def restart
|
54
57
|
puts "Reset instance..."
|
55
|
-
puts
|
58
|
+
puts run "gcloud compute instances reset #{name} --zone #{zone} --project #{project}"
|
56
59
|
puts "Start instance..."
|
57
|
-
puts
|
60
|
+
puts run "gcloud compute instances start #{name} --zone #{zone} --project #{project}"
|
58
61
|
end
|
59
62
|
end
|
60
63
|
end
|
data/lib/tenma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tenma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hisaichi5518
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/tenma/prepare/release_branch.rb
|
163
163
|
- lib/tenma/prepare/release_issue.rb
|
164
164
|
- lib/tenma/prepare/release_pullreqs.rb
|
165
|
+
- lib/tenma/runnable.rb
|
165
166
|
- lib/tenma/version.rb
|
166
167
|
- tenma.gemspec
|
167
168
|
homepage: https://github.com/hisaichi5518/tenma
|