wisco 0.3.0 → 0.3.2

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: e7d2ff5de3204724be5413d65d04854a3abbf36b9d04d0fe2331512ba74f6e68
4
- data.tar.gz: 81791bed785af9f096dae7de781a3620a14a96f4a28dc3514d24b4bdabc80e1c
3
+ metadata.gz: c5e683d4cb7283e3e673a02b5829a55baf9c6bed86040559a7486492a45a41fb
4
+ data.tar.gz: 0f6492a182ba109c8d1fd1d8f607465e0cef50962c212bdad414972a978d5a91
5
5
  SHA512:
6
- metadata.gz: b4e9a41746dc88a8ef8d08595dd56c01bae20fcbabaefd6bd08758ab4d2fa8611745a3cce8c8a929a4a433fa76458a821ecf074f96720e30b824d98a9005c51c
7
- data.tar.gz: d5f6560ffec23678d08131a232808f957b4aec436bd17ff87822fd45fcf6fb1bd06d9a438ba76a1904cf6eb6babb7344c1ca7d206f3c042843144f7c917e355b
6
+ metadata.gz: 8237b2e29e141a7305a5a4d042aa6708b45889e2ef7af4be30f4df32665044b2cec06ab08fc686fb458bcc228417e8f37883d6b0d35bcb811a81acff99c350b1
7
+ data.tar.gz: 699227a3116ba74cf5f0bdf4c686f72a0a10eeac87096f043dd155d59a176c99cb2d7c8a48e2e9eb154956238ecda1ce4f8a8ee19b33b4d9d678f65a0f457aae
@@ -0,0 +1,29 @@
1
+ <%#
2
+ ERB template for a GitHub Actions workflow to deploy a Workato connector
3
+ when changes are pushed to the main branch.
4
+
5
+ Template variables:
6
+ connector_name: The name of the connector file to deploy (e.g., 'Confluence.rb')
7
+ workato_base_url: The base URL for the Workato API (e.g., 'https://app.workato.com')
8
+ %>
9
+
10
+ name: Workato Connector Deployment
11
+
12
+ on:
13
+ push:
14
+ branches: [ main ]
15
+ paths:
16
+ - '<%= connector_name %>'
17
+
18
+ jobs:
19
+ deploy-to-workato:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v6
23
+
24
+ - name: Deploy connector to Workato
25
+ uses: billingtonm/Workato-Github-Actions/deploy-connector@v1
26
+ with:
27
+ connector-file: <%= connector_name %>
28
+ workato-base-url: <%= workato_base_url %>
29
+ api-token: ${{ secrets.WORKATO_DEV_ENVIRONMENT_API_TOKEN }}
@@ -0,0 +1,3 @@
1
+ .wisco/*
2
+ /master.key
3
+ working/*
@@ -1,3 +1,4 @@
1
+ require 'erb'
1
2
  require 'fileutils'
2
3
  require_relative '../config'
3
4
  require_relative '../connector'
@@ -5,6 +6,15 @@ require_relative '../connector'
5
6
  module Wisco
6
7
  module Commands
7
8
  module Init
9
+ HOSTNAMES = [
10
+ { region: 'US Data Center', hostname: 'www.workato.com' },
11
+ { region: 'EU Data Center', hostname: 'app.eu.workato.com' },
12
+ { region: 'JP Data Center', hostname: 'app.jp.workato.com' },
13
+ { region: 'SG Data Center', hostname: 'app.sg.workato.com' },
14
+ { region: 'AU Data Center', hostname: 'app.au.workato.com' },
15
+ { region: 'IL Data Center', hostname: 'app.il.workato.com' },
16
+ ].freeze
17
+
8
18
  module_function
9
19
 
10
20
  def run(target_dir)
@@ -36,10 +46,41 @@ module Wisco
36
46
  config['connector']['path'] = target_dir
37
47
  config['connector']['file'] = connector_file
38
48
 
49
+ prompt_hostname(config)
50
+
39
51
  Wisco::Config.save_config(config_path, config)
40
52
  puts "Config written to #{config_path}"
41
53
 
42
54
  update_gitignore(target_dir)
55
+ deploy_github_workflow(target_dir, connector_file, config)
56
+ end
57
+
58
+ def prompt_hostname(config)
59
+ api_cfg = config['workato_developer_api'] ||= {}
60
+ current = api_cfg['hostname']
61
+
62
+ if current && !current.strip.empty?
63
+ puts "Current Workato hostname: #{current}"
64
+ print 'Keep this? (y/n): '
65
+ return if $stdin.gets.strip.downcase == 'y'
66
+ end
67
+
68
+ puts 'Select your Workato instance:'
69
+ HOSTNAMES.each_with_index do |entry, i|
70
+ puts " #{i + 1}. #{entry[:hostname]} (#{entry[:region]})"
71
+ end
72
+
73
+ loop do
74
+ print "Enter number (1-#{HOSTNAMES.size}): "
75
+ input = $stdin.gets.strip
76
+ index = input.to_i
77
+ if index >= 1 && index <= HOSTNAMES.size
78
+ api_cfg['hostname'] = HOSTNAMES[index - 1][:hostname]
79
+ puts "Hostname set to: #{api_cfg['hostname']}"
80
+ return
81
+ end
82
+ warn "Invalid selection. Please enter a number between 1 and #{HOSTNAMES.size}."
83
+ end
43
84
  end
44
85
 
45
86
  def update_gitignore(target_dir)
@@ -55,9 +96,34 @@ module Wisco
55
96
  puts "Added '#{entry}' to .gitignore"
56
97
  end
57
98
  else
58
- puts "Note: No .gitignore found — consider adding '#{entry}' manually."
99
+ asset_path = File.join(__dir__, '..', 'assets', '.gitignore')
100
+ FileUtils.cp(asset_path, gitignore_path)
101
+ puts "Created .gitignore from template"
59
102
  end
60
103
  end
104
+
105
+ def deploy_github_workflow(target_dir, connector_file, config)
106
+ output_path = File.join(target_dir, '.github', 'workflows', 'deploy.yml')
107
+
108
+ if File.exist?(output_path)
109
+ print '.github/workflows/deploy.yml already exists. Overwrite? (y/n): '
110
+ unless $stdin.gets.strip.downcase == 'y'
111
+ puts 'Skipped: .github/workflows/deploy.yml'
112
+ return
113
+ end
114
+ end
115
+
116
+ hostname = config.dig('workato_developer_api', 'hostname')
117
+ workato_base_url = "https://#{hostname}"
118
+ connector_name = connector_file
119
+
120
+ template_path = File.join(__dir__, '..', 'assets', '.github', 'workflows', 'deploy.yml.erb')
121
+ rendered = ERB.new(File.read(template_path)).result(binding)
122
+
123
+ FileUtils.mkdir_p(File.dirname(output_path))
124
+ File.write(output_path, rendered)
125
+ puts 'Created .github/workflows/deploy.yml'
126
+ end
61
127
  end
62
128
  end
63
129
  end
data/lib/wisco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wisco
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wisco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mbillington
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-17 00:00:00.000000000 Z
11
+ date: 2026-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -64,6 +64,8 @@ extra_rdoc_files: []
64
64
  files:
65
65
  - bin/wisco
66
66
  - lib/wisco.rb
67
+ - lib/wisco/assets/.github/workflows/deploy.yml.erb
68
+ - lib/wisco/assets/.gitignore
67
69
  - lib/wisco/commands/exec.rb
68
70
  - lib/wisco/commands/fixtures.rb
69
71
  - lib/wisco/commands/init.rb