rake_circle_ci 0.5.0 → 0.6.0.pre.1

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
  SHA256:
3
- metadata.gz: a42156b7f0a1034b3f2b3cdec6fdc10b4cc4289e1e2b7e7ffec937c7d7b9f874
4
- data.tar.gz: 0746f61eb63fe0fae55b2a01623b81f1fc9a84a0ec4109bd57479025fb021dd2
3
+ metadata.gz: a4d55ed859f806a0e798be995aff55fd6964d479c178ad38d447a5160ec3dbb7
4
+ data.tar.gz: c18cf75c5b0ef55687cb31359711a2807cbf76538ef186269127fc5b0a8b1dfa
5
5
  SHA512:
6
- metadata.gz: eaafb21539508771d3f39965482e52a5388df35ca69d5c9f2816beaeb03a7299eeb260bac6af793bee0166940f39d60b03d6dc9f0b17b42e9d6c5049e38d1a68
7
- data.tar.gz: 64a693855c5fe0af7bd9ea45c26e8426ee64ec5b800b7c3a9c9da580fa380777ff2486366bb245b5920f465d88d0524f5eea4115a60a32a861f90b7a29f7c5d5
6
+ metadata.gz: 7489d7d9bee9df6451375cb030f7bf8adb826a5262589c987ba790a7f06f971ed7baae31601e242826e0b5a5c055a23dffe11a0a5e4177d1c488570e72e1083d
7
+ data.tar.gz: 3fb30d1b89142a3c937835bb0697b3482b08ad81782a847431f4d84b18da93c1c27724f1df25f5ce1026dfdbd8e543d10d67df15f4d7a1c4ec1268d5dac186be
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_circle_ci (0.5.0)
4
+ rake_circle_ci (0.6.0.pre.1)
5
5
  colored2 (~> 3.1)
6
6
  excon (~> 0.72)
7
7
  rake_factory (~> 0.23)
@@ -10,7 +10,7 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (5.2.4.1)
13
+ activesupport (5.2.4.2)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 0.7, < 2)
16
16
  minitest (~> 5.1)
@@ -21,8 +21,8 @@ GEM
21
21
  concurrent-ruby (1.1.6)
22
22
  diff-lcs (1.3)
23
23
  docile (1.3.2)
24
- excon (0.72.0)
25
- faraday (1.0.0)
24
+ excon (0.73.0)
25
+ faraday (1.0.1)
26
26
  multipart-post (>= 1.2, < 3)
27
27
  gem-release (2.1.1)
28
28
  i18n (1.8.2)
@@ -30,20 +30,20 @@ GEM
30
30
  memfs (1.0.0)
31
31
  minitest (5.14.0)
32
32
  multipart-post (2.1.1)
33
- octokit (4.17.0)
33
+ octokit (4.18.0)
34
34
  faraday (>= 0.9)
35
35
  sawyer (~> 0.8.0, >= 0.5.3)
36
- public_suffix (4.0.3)
36
+ public_suffix (4.0.4)
37
37
  rake (13.0.1)
38
- rake_factory (0.25.0)
38
+ rake_factory (0.27.0)
39
39
  activesupport (>= 4)
40
40
  rake (~> 13.0)
41
- rake_github (0.3.0)
41
+ rake_github (0.5.0)
42
42
  colored2 (~> 3.1)
43
43
  octokit (~> 4.16)
44
44
  rake_factory (~> 0.23)
45
45
  sshkey (~> 2.0)
46
- rake_ssh (0.2.0)
46
+ rake_ssh (0.4.0)
47
47
  colored2 (~> 3.1)
48
48
  rake_factory (~> 0.23)
49
49
  sshkey (~> 2.0)
@@ -69,7 +69,7 @@ GEM
69
69
  simplecov-html (0.12.2)
70
70
  sshkey (2.0.0)
71
71
  thread_safe (0.3.6)
72
- tzinfo (1.2.6)
72
+ tzinfo (1.2.7)
73
73
  thread_safe (~> 0.1)
74
74
 
75
75
  PLATFORMS
@@ -10,6 +10,10 @@ module RakeCircleCI
10
10
  @project_slug = opts[:project_slug]
11
11
  end
12
12
 
13
+ def follow_project
14
+ assert_successful(Excon.post(follow_url, headers: headers))
15
+ end
16
+
13
17
  def find_env_vars
14
18
  response = assert_successful(Excon.get(env_vars_url, headers: headers))
15
19
  body = JSON.parse(response.body)
@@ -101,6 +105,11 @@ module RakeCircleCI
101
105
  response
102
106
  end
103
107
 
108
+ def follow_url
109
+ "#{@base_url}/v1.1/project/#{@project_slug}/follow?" +
110
+ "circle-token=#{@api_token}"
111
+ end
112
+
104
113
  def env_vars_url
105
114
  "#{@base_url}/v2/project/#{@project_slug}/envvar"
106
115
  end
@@ -23,6 +23,9 @@ module RakeCircleCI
23
23
  parameter :ssh_keys_provision_task_name, default: :provision
24
24
  parameter :ssh_keys_ensure_task_name, default: :ensure
25
25
 
26
+ parameter :project_namespace, default: :project
27
+ parameter :project_follow_task_name, default: :follow
28
+
26
29
  task Tasks::EnvironmentVariables::Provision,
27
30
  name: RakeFactory::DynamicValue.new { |ts|
28
31
  ts.env_vars_provision_task_name
@@ -59,6 +62,10 @@ module RakeCircleCI
59
62
  provision_task_name: RakeFactory::DynamicValue.new { |ts|
60
63
  ts.ssh_keys_provision_task_name
61
64
  }
65
+ task Tasks::Projects::Follow,
66
+ name: RakeFactory::DynamicValue.new { |ts|
67
+ ts.project_follow_task_name
68
+ }
62
69
 
63
70
  def define_on(application)
64
71
  around_define(application) do
@@ -69,7 +76,7 @@ module RakeCircleCI
69
76
  when /SSHKeys/
70
77
  ssh_keys_namespace
71
78
  else
72
- nil
79
+ project_namespace
73
80
  end
74
81
 
75
82
  application.in_namespace(ns) do
@@ -0,0 +1,31 @@
1
+ require 'rake_factory'
2
+
3
+ require_relative '../../client'
4
+
5
+ module RakeCircleCI
6
+ module Tasks
7
+ module Projects
8
+ class Follow < RakeFactory::Task
9
+ default_name :follow
10
+ default_description RakeFactory::DynamicValue.new { |t|
11
+ "Follow the #{t.project_slug} project"
12
+ }
13
+
14
+ parameter :project_slug, required: true
15
+ parameter :api_token, required: true
16
+ parameter :base_url, default: 'https://circleci.com/api'
17
+
18
+ action do |t|
19
+ client = Client.new(
20
+ base_url: t.base_url,
21
+ api_token: t.api_token,
22
+ project_slug: t.project_slug)
23
+
24
+ print "Following the '#{t.project_slug}' project... "
25
+ client.follow_project
26
+ puts "Done."
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,8 @@
1
+ require_relative 'projects/follow'
2
+
3
+ module RakeCircleCI
4
+ module Tasks
5
+ module Projects
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,4 @@
1
+ require_relative 'tasks/projects'
1
2
  require_relative 'tasks/environment_variables'
2
3
  require_relative 'tasks/ssh_keys'
3
4
 
@@ -1,3 +1,3 @@
1
1
  module RakeCircleCI
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0.pre.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_circle_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-15 00:00:00.000000000 Z
11
+ date: 2020-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake_factory
@@ -252,6 +252,8 @@ files:
252
252
  - lib/rake_circle_ci/tasks/environment_variables/destroy.rb
253
253
  - lib/rake_circle_ci/tasks/environment_variables/ensure.rb
254
254
  - lib/rake_circle_ci/tasks/environment_variables/provision.rb
255
+ - lib/rake_circle_ci/tasks/projects.rb
256
+ - lib/rake_circle_ci/tasks/projects/follow.rb
255
257
  - lib/rake_circle_ci/tasks/ssh_keys.rb
256
258
  - lib/rake_circle_ci/tasks/ssh_keys/destroy.rb
257
259
  - lib/rake_circle_ci/tasks/ssh_keys/ensure.rb
@@ -280,9 +282,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
280
282
  version: '2.6'
281
283
  required_rubygems_version: !ruby/object:Gem::Requirement
282
284
  requirements:
283
- - - ">="
285
+ - - ">"
284
286
  - !ruby/object:Gem::Version
285
- version: '0'
287
+ version: 1.3.1
286
288
  requirements: []
287
289
  rubygems_version: 3.0.1
288
290
  signing_key: