Skip to content

Commit 27d34da

Browse files
authored
RemoteServerJob method for custom scripts (#261)
1 parent d0df3ac commit 27d34da

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
.byebug_history
2222

2323
vendor/bundle
24+
25+
*.swp
26+
*.swo

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ GEM
164164
msgpack (1.0.2)
165165
multi_json (1.12.1)
166166
multipart-post (2.0.0)
167-
net-ssh (3.2.0)
167+
net-ssh (5.2.0)
168168
nio4r (2.3.0)
169169
nokogiri (1.8.2)
170170
mini_portile2 (~> 2.3.0)

app/jobs/remote_server_job.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class RemoteServerJob < ActiveJob::Base
2020

2121
RUBY_COMMIT_DISCOURSE = "#{SCRIPTS_PATH}/ruby/discourse/trunk.sh"
2222

23+
RUBY_CUSTOM_SCRIPTS = "#{SCRIPTS_PATH}/ruby/custom_scripts/receiver.sh"
24+
2325
# Use keyword arguments once Rails 4.2.1 has been released.
2426
def perform(initiator_key, benchmark_group, options = {})
2527
Net::SSH.start(
@@ -60,6 +62,15 @@ def ruby_release(ssh, version, options)
6062
)
6163
end
6264

65+
def ruby_custom_scripts(ssh, script_url, options)
66+
commit_a = options[:commit_a]
67+
commit_b = options[:commit_b]
68+
ssh_exec!(
69+
ssh,
70+
"#{RUBY_CUSTOM_SCRIPTS} #{script_url} #{commit_a} #{commit_b} #{secrets.api_name} #{secrets.api_password}"
71+
)
72+
end
73+
6374
def ruby_release_discourse(ssh, ruby_version, options)
6475
execute_ssh_commands(ssh,
6576
[

0 commit comments

Comments
 (0)