77require 'deploy/cli/websocket_client'
88require 'deploy/cli/deployment_progress_output'
99
10- OptionsStruct = Struct . new ( :config_file , :project )
10+ OptionsStruct = Struct . new ( :config_file , :project , :config_files_deployment )
1111
1212# rubocop:disable Metrics/ClassLength
1313# rubocop:disable Metrics/AbcSize
@@ -25,7 +25,7 @@ class << self
2525 def invoke ( args )
2626 @options = OptionsStruct . new
2727
28- parser = OptionParser . new do |opts |
28+ parser = OptionParser . new do |opts | # rubocop:disable Metrics/BlockLength
2929 opts . banner = 'Usage: deployhq [options] command'
3030 opts . separator ''
3131 opts . separator 'Commands:'
@@ -45,6 +45,11 @@ def invoke(args)
4545 @options . project = project_permalink
4646 end
4747
48+ @options . config_files_deployment = false
49+ opts . on ( '--config-files' , 'Config files deployment' ) do |_config_files_deployment |
50+ @options . config_files_deployment = true
51+ end
52+
4853 opts . on_tail ( '-v' , '--version' , 'Shows Version' ) do
4954 puts Deploy ::VERSION
5055 exit
@@ -127,8 +132,14 @@ def deploy
127132 end
128133 end
129134
130- latest_revision = @project . latest_revision ( parent . preferred_branch )
131- deployment = @project . deploy ( parent . identifier , parent . last_revision , latest_revision )
135+ if @options . config_files_deployment
136+ $stdout. print "\n Starting config files deployment\n "
137+ deployment = @project . config_files_deployment ( parent . identifier )
138+ else
139+ $stdout. print "\n Starting deployment\n "
140+ latest_revision = @project . latest_revision ( parent . preferred_branch )
141+ deployment = @project . deploy ( parent . identifier , parent . last_revision , latest_revision )
142+ end
132143
133144 $stdout. print 'Waiting for an available deployment slot...'
134145 DeploymentProgressOutput . new ( deployment ) . monitor
0 commit comments