class TuyaCIDSL::TriggerCreator
Attributes
file_name[RW]
Public Class Methods
new(name)
click to toggle source
# File lib/tuya/ci/DSL/trigger_create.rb, line 4 def initialize(name) @file_name = name end
Public Instance Methods
create()
click to toggle source
# File lib/tuya/ci/DSL/trigger_create.rb, line 8 def create puts "Create trigger file named: #{@file_name}".green default_file = @file_name != 'CIFile' @file_path = './' @file_path = './CIMonitors/' if default_file `mkdir -p #{@file_path}` @file = "#{@file_path}#{@file_name}" `touch #{@file}` @content = trigger_content puts "Trigger: #{@file} saved".green fh = File.new(@file, "w") fh.puts @content fh.close end
Private Instance Methods
trigger_content()
click to toggle source
# File lib/tuya/ci/DSL/trigger_create.rb, line 33 def trigger_content "before_module_build do |options| #repo = options[:repo] #branch = options[:branch] #module_name = options[:moduleName] #version = options[:version] //puts \"module: \#{module_name} build version: \#{version} with branch: \#{branch} on repo: \#{repo}\" // tuya_stop_build 'stop build message here.' end after_module_build do |options| # launch shell from remote #puts tuya_sh_from_git 'go run ./ci-script-test/client.go', 'https://code.registry.wgine.com/tuyaIOS/ci-script-test.git' #puts tuya_sh_from_git 'ruby ./ci-script-test/test.rb', 'https://code.registry.wgine.com/tuyaIOS/ci-script-test.git' # launch shell from local # tuya_sh('python language.py -a 168 -v 3.8.0') end before_sdk_build do |options| end after_sdk_build do |options| end before_project_build do |options| #branch = options[:branch] #depend_branch = options[:dependBranch] #update_components = options[:updateComponents] #delete_components = options[:deleteComponents] #integrate = options[:isIntegrate] //puts \"if this build is integrate: \#{integrate}\" //puts \"this build branch is: \#{branch} base: \#{depend_branch}\" //puts \"this build will update: \#{update_components}\" //puts \"this build will delete: \#{delete_components}\" end after_project_build do |options| end building_project_pod_update_end do |options| end # trigger 执行策略 # strategy_always_close # strategy_always_open # strategy_auto # 如果不指定 strategy 默认为 strategy_open # :test 为trigger 标识符 只有在 strategy_auto 时才有效 strategy do |options| [strategy_auto, :bool_key] # [strategy_always_close, :bool_key] # [strategy_always_open, :bool_key] end error do |exception, position, options, process| end " end