sct 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ecc8e55b65c59245e7d03238bb1218f47761e018c2ca2c0b14df9731b58dbb1
4
- data.tar.gz: cb593b673991d65aa8ca36aad1629f26d18a4e0429b44d11d4a45c48b0f291f0
3
+ metadata.gz: 77a9f9b0da2f262d9c336ee3f6f912bb0e097f0caf9d91adbe1b3dd9ad33059d
4
+ data.tar.gz: 58cbc6da8d20cb35fdc6f1d12d326472ff0a40466010f7b9e4130c7f201a52ec
5
5
  SHA512:
6
- metadata.gz: a85dcbcbb4cbc902cc9cd266b38539d71ec3ac4fdc4e2e1353ab66719eab607efc572c109c7c6efbd23403544dc4fb4aec01700d5858b144fd7fce99c6277e2d
7
- data.tar.gz: 76a9ea0399f166725fa1da20fe3b6bf0b1913ec671c46db970d5460b8180eef089cd4eb76f57bb6145766f24c02fd6d2f513f9d60b15da33afa657663455fa12
6
+ metadata.gz: d8379c969766240db807fb92dea072eea56d7e3e0f0148ee2e9c4318e32eb60903cc5bd9a20353ac5bb031582795e7f20661cfe7a7829151dd6d1d5a12264d57
7
+ data.tar.gz: 30eded070cff1db7d533c2d3f36e850204ff78c7be2696d504e0d4e1eb86f8564da26278f04621b021f3cfb2f29805f4ece5d9c6a3b156a7f6c145118acfb74e
@@ -0,0 +1,34 @@
1
+ module Sct
2
+ class DatabasePullCommand
3
+ def error message
4
+ UI.error message
5
+ exit 1
6
+ end
7
+
8
+ def execute args, options
9
+ branch = ENV['CI_BRANCH'] || 'master'
10
+
11
+ # We need to set this locally, so that we don't save this at the repository
12
+ pipeline_endpoint = ENV['CI_MERGE_REQUEST_PIPELINE']
13
+ if not pipeline_endpoint
14
+ error "Pipeline endpoint not set"
15
+ end
16
+
17
+ # We need to set this locally, so that we don't save this at the repository
18
+ private_token = ENV['CI_PRIVATE_TOKEN']
19
+ if not private_token
20
+ error "Private token not set"
21
+ end
22
+
23
+ if options.proactive_frame
24
+ UI.important("Requesting to pull database for proactive frame")
25
+ process_request = `curl -X POST -F token=#{private_token} -F ref=#{branch} -F variables[DB_PULL_FRAME]=true #{pipeline_endpoint}`
26
+ end
27
+
28
+ if options.proactive_config
29
+ UI.important("Requesting to pull database for proactive config")
30
+ process_request = `curl -X POST -F token=#{private_token} -F ref=#{branch} -F variables[DB_PULL_CONFIG]=true #{pipeline_endpoint}`
31
+ end
32
+ end
33
+ end
34
+ end
@@ -54,6 +54,18 @@ module Sct
54
54
  end
55
55
  end
56
56
 
57
+ command :'database-pull' do |c|
58
+ c.syntax = 'sct database pull'
59
+ c.description = 'pull database changes for proactive frame and proactive config'
60
+ c.option '--proactive-frame', 'pull the database changes from proactive-frame'
61
+ c.option '--proactive-config', 'pull the database changes from proactive-config'
62
+
63
+ c.action do |args, options|
64
+ UI.important("Trying to pull database")
65
+ Sct::DatabasePullCommand.new.execute args, options
66
+ end
67
+ end
68
+
57
69
  run!
58
70
  end
59
71
  end
@@ -1,3 +1,3 @@
1
1
  module Sct
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sct
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reshad Farid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-05 00:00:00.000000000 Z
11
+ date: 2021-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -100,6 +100,20 @@ dependencies:
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 3.0.0
103
+ - !ruby/object:Gem::Dependency
104
+ name: gitlab
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 4.17.0
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: 4.17.0
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: tty-screen
105
119
  requirement: !ruby/object:Gem::Requirement
@@ -206,6 +220,7 @@ files:
206
220
  - sct/lib/sct/.DS_Store
207
221
  - sct/lib/sct/cli_tools_distributor.rb
208
222
  - sct/lib/sct/command.rb
223
+ - sct/lib/sct/commands/databasepull.rb
209
224
  - sct/lib/sct/commands/dev.rb
210
225
  - sct/lib/sct/commands/mysqlproxy.rb
211
226
  - sct/lib/sct/commands/shell.rb