konstruct 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -14
- data/lib/cli/deploy.rb +73 -0
- data/lib/cli/develop.rb +116 -7
- data/lib/cli/project.rb +5 -2
- data/lib/konstruct.rb +86 -55
- data/lib/konstruct/template.rb +32 -2
- data/lib/konstruct/version.rb +1 -1
- data/lib/utilities/gulp.rb +3 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7060840fc67ea5d400dfa5eb23c631f12a246809
|
4
|
+
data.tar.gz: 64186607120c776fac8a4cfdf787d1123c785d89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 483c01386db58e6f9ac3022b4b7ca71d193e461056f301d198452fe3fa982165b71b0c97e4da957a89ac0fe2bff287cb3ae993a7375e675befdf168dec8a35c1
|
7
|
+
data.tar.gz: 3f173c33a6856a4ae0d955b0490d483518f88de70f5c09bc03a8d221ce85902d3d7a85b6ac2d7a8a4a133ae867c6f23f4840947a13efe3d04a25d38157b65131
|
data/README.md
CHANGED
@@ -10,6 +10,7 @@ The Konstruct Cli provides tools to make working with Konstruct painless and qui
|
|
10
10
|
- Scaffold out a new HTML, Jekyll or Angular site in seconds.
|
11
11
|
- Gulp in a central location.
|
12
12
|
- Develop with Browserify & PostCSS.
|
13
|
+
- Build process to optimise assets for deployment.
|
13
14
|
- Quick link to Konstruct Documentation.
|
14
15
|
|
15
16
|
## Installation
|
@@ -24,17 +25,17 @@ The Cli has a few very simple commands. If you get stuck simply `$ konstruct --h
|
|
24
25
|
|
25
26
|
### Konstruct Commands
|
26
27
|
|
27
|
-
* [$ konstruct folders](#)
|
28
|
-
* [$ konstruct create](#)
|
29
|
-
* [$ konstruct refresh](#)
|
30
|
-
* [$ konstruct watch](#)
|
31
|
-
* [$ konstruct
|
28
|
+
* [$ konstruct folders](#folders)
|
29
|
+
* [$ konstruct create](#create)
|
30
|
+
* [$ konstruct refresh](#refresh)
|
31
|
+
* [$ konstruct watch](#watch)
|
32
|
+
* [$ konstruct build](#build)
|
32
33
|
* [$ konstruct documentation](#documentation)
|
33
34
|
|
34
35
|
#### Folders
|
35
36
|
|
36
37
|
$ konstruct folders
|
37
|
-
|
38
|
+
|
38
39
|
Scaffolds a set of project folders from a template to help you organise your project better.
|
39
40
|
|
40
41
|
**Customize Template**: You can customize the folder structure in `~/.konstruct/config.yml`.
|
@@ -42,31 +43,46 @@ Scaffolds a set of project folders from a template to help you organise your pro
|
|
42
43
|
#### Create
|
43
44
|
|
44
45
|
$ konstruct create [options]
|
45
|
-
|
46
|
+
|
46
47
|
**Options:**
|
47
|
-
* --sudo : Run NPM install as root if your node installation requires root privileges.
|
48
|
-
|
48
|
+
* --sudo : Run NPM install as root if your node installation requires root privileges.
|
49
|
+
|
49
50
|
Creates a new Konstruct starter project through an interactive wizard.
|
50
51
|
|
51
52
|
#### Refresh
|
52
53
|
|
53
54
|
$ konstruct refresh [options]
|
54
|
-
|
55
|
+
|
55
56
|
**Options:**
|
56
57
|
* --sudo : Run NPM install as root if your node installation requires root privileges.
|
57
|
-
|
58
|
+
|
58
59
|
Refreshes the project by installing dependencies again. Useful if you inherit a repo from another developer.
|
59
60
|
|
60
61
|
#### Watch
|
61
62
|
|
62
63
|
$ konstruct watch
|
63
|
-
|
64
|
+
|
64
65
|
Runs the global Gulp tools from your current working directory.
|
65
66
|
|
67
|
+
#### Build
|
68
|
+
|
69
|
+
$ konstruct build [options]
|
70
|
+
|
71
|
+
**Options:**
|
72
|
+
* --staging : Run build process on staging branch.
|
73
|
+
* --production : Run build process on production branch.
|
74
|
+
|
75
|
+
Runs build scripts & optimisations on your codebase in the branches you specified in options.
|
76
|
+
|
77
|
+
Currently optimising:
|
78
|
+
|
79
|
+
* Minify app.js
|
80
|
+
* Optimise images
|
81
|
+
|
66
82
|
#### Documentation
|
67
83
|
|
68
84
|
$ konstruct documentation
|
69
|
-
|
85
|
+
|
70
86
|
Loads up the [Konstruct Documentation](http://konstruct.github.io/) in your default browser.
|
71
87
|
|
72
88
|
## Contributing
|
@@ -76,4 +92,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/konstr
|
|
76
92
|
## License
|
77
93
|
|
78
94
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
79
|
-
|
data/lib/cli/deploy.rb
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# KONSTRUCT CLI [ DEVELOPMENT TASKS ] ==========================================
|
2
|
+
|
3
|
+
# ====== INDEX ================================================================
|
4
|
+
# ==
|
5
|
+
# == 1. WATCH
|
6
|
+
# ==
|
7
|
+
# ====== INDEX ================================================================
|
8
|
+
|
9
|
+
module Konstruct
|
10
|
+
|
11
|
+
class Deploy
|
12
|
+
|
13
|
+
# 1. S3 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
14
|
+
|
15
|
+
def s3()
|
16
|
+
|
17
|
+
# 1.1. INITIALISE FUNCTIONS ----------------------------------------------
|
18
|
+
|
19
|
+
msg = Util::Message.new()
|
20
|
+
fs = Util::FS.new()
|
21
|
+
gulp = Util::Gulp.new()
|
22
|
+
|
23
|
+
# 1.1. END ---------------------------------------------------------------
|
24
|
+
|
25
|
+
# 1.2. BUILD DEPLOY COMMAND ----------------------------------------------
|
26
|
+
|
27
|
+
config = fs.read_project(path)
|
28
|
+
s3 = config['deployments']['s3']
|
29
|
+
|
30
|
+
# aws s3 sync . s3://appypet-dev/ --delete --exclude=".DS_Store/*" --exclude=".git/*" --exclude="assets/node_modules/*" --exclude="assets/js/*" --exclude="assets/scss/*"
|
31
|
+
|
32
|
+
# 1.2.1. DELETE
|
33
|
+
|
34
|
+
if s3['delete']
|
35
|
+
|
36
|
+
delete = "--delete"
|
37
|
+
|
38
|
+
else
|
39
|
+
|
40
|
+
delete = ""
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
# 1.2.1. END
|
45
|
+
|
46
|
+
# 1.2.2. EXCLUDE
|
47
|
+
|
48
|
+
config['exclude'].each do |key, array|
|
49
|
+
puts "#{key}-----"
|
50
|
+
puts array
|
51
|
+
end
|
52
|
+
|
53
|
+
# 1.2.2. END
|
54
|
+
|
55
|
+
# 1.2. END ---------------------------------------------------------------
|
56
|
+
|
57
|
+
# 1.3. RUN DEPLOY --------------------------------------------------------
|
58
|
+
|
59
|
+
puts "aws s3 sync . s3://#{s3['bucket']} #{delete} #{exlude}"
|
60
|
+
|
61
|
+
# 1.3. END ---------------------------------------------------------------
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
# 1. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
# B. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
72
|
+
|
73
|
+
# END OF FILE ==================================================================
|
data/lib/cli/develop.rb
CHANGED
@@ -28,15 +28,62 @@ module Konstruct
|
|
28
28
|
|
29
29
|
type = site['type']
|
30
30
|
|
31
|
-
if type == :html
|
31
|
+
if type == :html || type == :angular
|
32
32
|
|
33
|
-
stream = "
|
33
|
+
stream = "default"
|
34
34
|
|
35
35
|
end
|
36
36
|
|
37
|
-
if type == :
|
37
|
+
if type == :jekyll
|
38
|
+
|
39
|
+
stream = "jekyll"
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
gulp.task('default', path, stream)
|
44
|
+
|
45
|
+
# 1.2. END ---------------------------------------------------------------
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
# 1. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
50
|
+
|
51
|
+
# 2. BUILD +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
52
|
+
|
53
|
+
def build(strategy, path)
|
54
|
+
|
55
|
+
# 2.1. INITIALISE FUNCTIONS ----------------------------------------------
|
56
|
+
|
57
|
+
msg = Util::Message.new()
|
58
|
+
fs = Util::FS.new()
|
59
|
+
gulp = Util::Gulp.new()
|
60
|
+
|
61
|
+
config = fs.read_project(path)
|
62
|
+
|
63
|
+
type = config['type']
|
64
|
+
branch = config['branches']
|
65
|
+
|
66
|
+
# 2.1. END ---------------------------------------------------------------
|
67
|
+
|
68
|
+
# 2.2. BUILD CONFIRMATION ------------------------------------------------
|
69
|
+
|
70
|
+
msg.paragraph("You are about to switch to your #{branch['staging']} branch to run gulp build tasks. Please make sure everything in your current branch is committed to avoid any conflicts and errors.")
|
71
|
+
|
72
|
+
continue = choose("Are you ready to continue?", :yes, :no)
|
73
|
+
|
74
|
+
if continue == :no
|
75
|
+
|
76
|
+
exit 0
|
77
|
+
|
78
|
+
end
|
38
79
|
|
39
|
-
|
80
|
+
# 2.2. END ---------------------------------------------------------------
|
81
|
+
|
82
|
+
# 2.3. SET GULP STREAM ---------------------------------------------------
|
83
|
+
|
84
|
+
if type == :html || type == :angular
|
85
|
+
|
86
|
+
stream = "default"
|
40
87
|
|
41
88
|
end
|
42
89
|
|
@@ -46,13 +93,75 @@ module Konstruct
|
|
46
93
|
|
47
94
|
end
|
48
95
|
|
49
|
-
|
96
|
+
# 2.3. END ---------------------------------------------------------------
|
50
97
|
|
51
|
-
#
|
98
|
+
# 2.4. SWITCH REPOS ------------------------------------------------------
|
99
|
+
|
100
|
+
# 2.4.1. CHECKOUT STAGING
|
101
|
+
|
102
|
+
if strategy == 'staging'
|
103
|
+
|
104
|
+
msg.paragraph("Switching to: #{branch['staging']}")
|
105
|
+
`git checkout #{branch['staging']}`
|
106
|
+
msg.success("Switched branch")
|
107
|
+
|
108
|
+
msg.paragraph("Pulling latest from: #{branch['staging']}")
|
109
|
+
`git pull`
|
110
|
+
msg.success("Pulled branch")
|
111
|
+
|
112
|
+
msg.paragraph("Merging #{branch['dev']} into #{branch['staging']}...")
|
113
|
+
`git merge #{branch['dev']}`
|
114
|
+
msg.success("Merged #{branch['dev']} into #{branch['staging']}")
|
115
|
+
|
116
|
+
elsif strategy == 'production'
|
117
|
+
|
118
|
+
msg.paragraph("Switching to: #{branch['production']}")
|
119
|
+
`git checkout #{branch['production']}`
|
120
|
+
msg.success("Switched branch")
|
121
|
+
|
122
|
+
msg.paragraph("Pulling latest from: #{branch['production']}")
|
123
|
+
`git pull`
|
124
|
+
msg.success("Pulled branch")
|
125
|
+
|
126
|
+
msg.paragraph("Merging #{branch['staging']} into #{branch['production']}...")
|
127
|
+
`git merge #{branch['staging']}`
|
128
|
+
msg.success("Merged #{branch['staging']} into #{branch['production']}")
|
129
|
+
|
130
|
+
else
|
131
|
+
|
132
|
+
msg.error("You did not specify a valid build strategy")
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
# 2.4.1. END
|
137
|
+
|
138
|
+
# 2.4. END ---------------------------------------------------------------
|
139
|
+
|
140
|
+
# 2.3. GULP BUILD TASK ---------------------------------------------------
|
141
|
+
|
142
|
+
msg.paragraph("Running build tasks")
|
143
|
+
|
144
|
+
gulp.task('build', path, stream)
|
145
|
+
|
146
|
+
msg.success("Build tasks completed")
|
147
|
+
|
148
|
+
# 2.3. END ---------------------------------------------------------------
|
149
|
+
|
150
|
+
# 2.2. GIT TASKS ---------------------------------------------------------
|
151
|
+
|
152
|
+
msg.paragraph("Committing build")
|
153
|
+
`git commit -m "Konstruct Build - #{ date.year }-#{ date.month }-#{ date.day }"`
|
154
|
+
msg.success("Commit successfull")
|
155
|
+
|
156
|
+
msg.paragraph("Pushing build")
|
157
|
+
`git push`
|
158
|
+
msg.success("Push successfull")
|
159
|
+
|
160
|
+
# 2.2. END ---------------------------------------------------------------
|
52
161
|
|
53
162
|
end
|
54
163
|
|
55
|
-
#
|
164
|
+
# 2. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
56
165
|
|
57
166
|
end
|
58
167
|
|
data/lib/cli/project.rb
CHANGED
@@ -212,8 +212,11 @@ module Konstruct
|
|
212
212
|
|
213
213
|
"konstruct_version" => Konstruct::VERSION,
|
214
214
|
"date_installed" => date_installed,
|
215
|
-
"type" => type
|
216
|
-
|
215
|
+
"type" => type,
|
216
|
+
"branches" => config["branches"],
|
217
|
+
"deploy" => config["deploy"],
|
218
|
+
"deployments" => config["deployments"],
|
219
|
+
"exclude" => config["exclude"]
|
217
220
|
}
|
218
221
|
|
219
222
|
File.open("#{path}/.konstruct.yml","w") do |f|
|
data/lib/konstruct.rb
CHANGED
@@ -2,13 +2,18 @@
|
|
2
2
|
|
3
3
|
# ====== INDEX ================================================================
|
4
4
|
# ==
|
5
|
-
# ==
|
5
|
+
# == 1. LOAD DEPENDENCIES
|
6
|
+
# == 2. COMMANDER SCRIPT
|
7
|
+
# == 3. SYSTEM TOOLS
|
8
|
+
# == 4. PREFLIGHT CHECKS
|
9
|
+
# == 5. PROJECT TOOLS
|
10
|
+
# == 6. DEVELOPER TOOLS
|
6
11
|
# ==
|
7
12
|
# ====== INDEX ================================================================
|
8
13
|
|
9
|
-
#
|
14
|
+
# 1. LOAD DEPENDENCIES +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
10
15
|
|
11
|
-
#
|
16
|
+
# 1.1. EXTERNAL DEPENDENCIES ---------------------------------------------------
|
12
17
|
|
13
18
|
require 'konstruct/version'
|
14
19
|
require 'konstruct/template'
|
@@ -23,25 +28,25 @@ require 'pp'
|
|
23
28
|
require 'net/http'
|
24
29
|
require 'xmlsimple'
|
25
30
|
|
26
|
-
#
|
31
|
+
# 1.1. END ---------------------------------------------------------------------
|
27
32
|
|
28
|
-
#
|
33
|
+
# 1.2. INTERNAL DEPENDENCIES ---------------------------------------------------
|
29
34
|
|
30
|
-
#
|
35
|
+
#1.2.1. UTILITIES
|
31
36
|
|
32
37
|
require_relative 'utilities/utils'
|
33
38
|
require_relative 'utilities/gulp'
|
34
39
|
require_relative 'utilities/git'
|
35
40
|
require_relative 'utilities/system'
|
36
41
|
|
37
|
-
#
|
42
|
+
# 1.2.2. CLI SCRIPTS
|
38
43
|
|
39
44
|
require_relative 'cli/project'
|
40
45
|
require_relative 'cli/develop'
|
41
46
|
|
42
|
-
#
|
47
|
+
# 1.2. END ---------------------------------------------------------------------
|
43
48
|
|
44
|
-
#
|
49
|
+
# 1.3. INITIALISE DEPENDENCIES -------------------------------------------------
|
45
50
|
|
46
51
|
msg = Util::Message.new()
|
47
52
|
fs = Util::FS.new()
|
@@ -49,30 +54,30 @@ sys = Util::System.new()
|
|
49
54
|
project = Konstruct::Project.new()
|
50
55
|
dev = Konstruct::Develop.new()
|
51
56
|
|
52
|
-
#
|
57
|
+
# 1.3. END ---------------------------------------------------------------------
|
53
58
|
|
54
|
-
#
|
59
|
+
# 1. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
55
60
|
|
56
|
-
#
|
61
|
+
# 2. COMMANDER SCRIPT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
57
62
|
|
58
|
-
#
|
63
|
+
# 2.1. GLOBAL VARIABLES --------------------------------------------------------
|
59
64
|
|
60
65
|
projectDir = Dir.pwd
|
61
66
|
|
62
|
-
#
|
67
|
+
# 2.1. END ---------------------------------------------------------------------
|
63
68
|
|
64
|
-
#
|
69
|
+
# 2.1. PROGRAM META ------------------------------------------------------------
|
65
70
|
|
66
71
|
program :version, Konstruct::VERSION
|
67
72
|
program :description, 'The Konstruct CLI provides scaffolding and other tools to help you get up and running quicker, and work faster.'
|
68
73
|
|
69
|
-
#
|
74
|
+
# 2.1. END ---------------------------------------------------------------------
|
70
75
|
|
71
|
-
#
|
76
|
+
# 2. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
72
77
|
|
73
|
-
#
|
78
|
+
# 3. SYSTEM TOOLS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
74
79
|
|
75
|
-
#
|
80
|
+
# 3.1. INSTALL SYSTEM ----------------------------------------------------------
|
76
81
|
|
77
82
|
command :init do |c|
|
78
83
|
|
@@ -87,21 +92,19 @@ command :init do |c|
|
|
87
92
|
|
88
93
|
end
|
89
94
|
|
90
|
-
#
|
95
|
+
# 3.1. END ---------------------------------------------------------------------
|
91
96
|
|
92
|
-
#
|
97
|
+
# 3. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
93
98
|
|
94
|
-
#
|
99
|
+
# 4. PREFLIGHT CHECKS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
95
100
|
|
96
101
|
sys.preflight()
|
97
102
|
|
98
|
-
#
|
103
|
+
# 4. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
99
104
|
|
100
|
-
#
|
105
|
+
# 5. PROJECT TOOLS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
101
106
|
|
102
|
-
#
|
103
|
-
|
104
|
-
# D.1. FOLDERS -----------------------------------------------------------------
|
107
|
+
# 5.1. FOLDERS -----------------------------------------------------------------
|
105
108
|
|
106
109
|
command :folders do |c|
|
107
110
|
|
@@ -116,9 +119,9 @@ command :folders do |c|
|
|
116
119
|
|
117
120
|
end
|
118
121
|
|
119
|
-
#
|
122
|
+
# 5.1. END ---------------------------------------------------------------------
|
120
123
|
|
121
|
-
#
|
124
|
+
# 5.1. CREATE ---------------------------------------------------------------------------------------------------------
|
122
125
|
|
123
126
|
# -- $ konstruct create
|
124
127
|
|
@@ -138,9 +141,9 @@ command :create do |c|
|
|
138
141
|
|
139
142
|
end
|
140
143
|
|
141
|
-
#
|
144
|
+
# 5.1. END ---------------------------------------------------------------------
|
142
145
|
|
143
|
-
#
|
146
|
+
# 5.2. REFRESH -----------------------------------------------------------------
|
144
147
|
|
145
148
|
# -- $ konstruct refresh
|
146
149
|
|
@@ -160,9 +163,9 @@ command :refresh do |c|
|
|
160
163
|
|
161
164
|
end
|
162
165
|
|
163
|
-
#
|
166
|
+
# 5.2. END ---------------------------------------------------------------------
|
164
167
|
|
165
|
-
#
|
168
|
+
# 5.3. DOCUMENTATION -----------------------------------------------------------
|
166
169
|
|
167
170
|
# -- $ konstruct command ::
|
168
171
|
|
@@ -179,21 +182,13 @@ command :documentation do |c|
|
|
179
182
|
|
180
183
|
end
|
181
184
|
|
182
|
-
#
|
183
|
-
|
184
|
-
# D. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
185
|
-
|
186
|
-
# D. DEVELOPER TOOLS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
187
|
-
|
188
|
-
# D.1. INSTALL -----------------------------------------------------------------
|
185
|
+
# 5.3. END ---------------------------------------------------------------------
|
189
186
|
|
190
|
-
#
|
187
|
+
# 5. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
191
188
|
|
189
|
+
# 6. DEVELOPER TOOLS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
192
190
|
|
193
|
-
|
194
|
-
# D.1. END ---------------------------------------------------------------------
|
195
|
-
|
196
|
-
# D.1. WATCH -------------------------------------------------------------------
|
191
|
+
# 6.1. WATCH -------------------------------------------------------------------
|
197
192
|
|
198
193
|
# -- $ konstruct command ::
|
199
194
|
|
@@ -221,32 +216,68 @@ command :watch do |c|
|
|
221
216
|
|
222
217
|
end
|
223
218
|
|
224
|
-
#
|
219
|
+
# 6.1. END ---------------------------------------------------------------------
|
225
220
|
|
226
|
-
#
|
221
|
+
# 6.2. BUILD -------------------------------------------------------------------
|
227
222
|
|
228
223
|
# -- $ konstruct command ::
|
229
224
|
|
225
|
+
command :build do |c|
|
226
|
+
|
227
|
+
c.syntax = 'konstruct build --options'
|
228
|
+
c.summary = 'Build & optimise your code for deployment.'
|
229
|
+
c.description = 'Builds and optimise your code for deployment in staging & production branches.'
|
230
|
+
c.option '--staging', 'Build staging code.'
|
231
|
+
c.option '--production', 'Build production code.'
|
232
|
+
c.action do |args, options|
|
230
233
|
|
234
|
+
# 6.2.1. BUILD STAGING
|
231
235
|
|
232
|
-
|
236
|
+
if options.staging
|
233
237
|
|
234
|
-
|
238
|
+
msg.heading('Building Staging Strategy')
|
235
239
|
|
236
|
-
|
240
|
+
dev.build('staging', projectDir)
|
241
|
+
|
242
|
+
end
|
237
243
|
|
244
|
+
# 6.2.1. END
|
238
245
|
|
246
|
+
# 6.2.2. BUILD STAGING
|
239
247
|
|
240
|
-
|
248
|
+
if options.production
|
241
249
|
|
242
|
-
|
250
|
+
msg.heading('Building Production Strategy');
|
251
|
+
|
252
|
+
puts "Building production strategy"
|
253
|
+
|
254
|
+
end
|
243
255
|
|
244
|
-
#
|
256
|
+
# 6.2.2. END
|
257
|
+
|
258
|
+
# 6.2.2. BUILD ERROR
|
259
|
+
|
260
|
+
unless options.staging || options.production
|
261
|
+
|
262
|
+
msg.error('You did not select a build strategy - Options: [--staging] [--production]');
|
263
|
+
|
264
|
+
end
|
265
|
+
|
266
|
+
# 6.2.2. END
|
267
|
+
|
268
|
+
end
|
269
|
+
|
270
|
+
end
|
271
|
+
# 6.2. END ---------------------------------------------------------------------
|
272
|
+
|
273
|
+
# 6.3. DEPLOY ------------------------------------------------------------------
|
274
|
+
|
275
|
+
# -- $ konstruct command ::
|
245
276
|
|
246
277
|
|
247
278
|
|
248
|
-
#
|
279
|
+
# 6.3. END ---------------------------------------------------------------------
|
249
280
|
|
250
|
-
#
|
281
|
+
# 6. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
251
282
|
|
252
283
|
# END OF FILE ==================================================================
|
data/lib/konstruct/template.rb
CHANGED
@@ -3,7 +3,12 @@ module Konstruct
|
|
3
3
|
TEMPLATE = {
|
4
4
|
"version" => Konstruct::VERSION,
|
5
5
|
"repo" => "https://github.com/konstruct/",
|
6
|
-
"folders" => [
|
6
|
+
"folders" => [
|
7
|
+
"1--ci",
|
8
|
+
"2--design",
|
9
|
+
"3--working",
|
10
|
+
"4--www"
|
11
|
+
],
|
7
12
|
"recipes" => {
|
8
13
|
"html" => {
|
9
14
|
"boilerplate" => [
|
@@ -65,7 +70,32 @@ module Konstruct
|
|
65
70
|
""
|
66
71
|
]
|
67
72
|
}
|
68
|
-
}
|
73
|
+
},
|
74
|
+
"branches" => {
|
75
|
+
"dev" => "develop",
|
76
|
+
"staging" => "staging",
|
77
|
+
"production" => "master"
|
78
|
+
},
|
79
|
+
"deploy" => {
|
80
|
+
"dev" => "",
|
81
|
+
"staging" => "",
|
82
|
+
"production" => ""
|
83
|
+
},
|
84
|
+
"deployments" => {
|
85
|
+
"s3" => {
|
86
|
+
"bucket" => "s3://your-bucket/",
|
87
|
+
"delete" => true
|
88
|
+
},
|
89
|
+
"ftp" => {
|
90
|
+
"host" => "your-domain.com",
|
91
|
+
"path" => "/where/do/you/want/your/files"
|
92
|
+
}
|
93
|
+
},
|
94
|
+
"exclude" => [
|
95
|
+
"assets/js/*",
|
96
|
+
"assets/scss/*",
|
97
|
+
"assets/node_modules/*"
|
98
|
+
]
|
69
99
|
}
|
70
100
|
|
71
101
|
end
|
data/lib/konstruct/version.rb
CHANGED
data/lib/utilities/gulp.rb
CHANGED
@@ -16,7 +16,7 @@ module Util
|
|
16
16
|
|
17
17
|
# 1.1.1. GULP DEFAULT
|
18
18
|
|
19
|
-
def
|
19
|
+
def task(task, path, stream)
|
20
20
|
|
21
21
|
gulp = Util::Gulp.new()
|
22
22
|
msg = Util::Message.new()
|
@@ -24,8 +24,8 @@ module Util
|
|
24
24
|
gulp_path = File.expand_path('~/.konstruct/gulp')
|
25
25
|
|
26
26
|
FileUtils.cd(gulp_path) do
|
27
|
-
|
28
|
-
exec "gulp --path #{path} --stream #{stream}"
|
27
|
+
|
28
|
+
exec "gulp #{task} --path #{path} --stream #{stream}"
|
29
29
|
|
30
30
|
end
|
31
31
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konstruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Kirsten
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- bin/konstruct
|
145
145
|
- bin/setup
|
146
146
|
- konstruct.gemspec
|
147
|
+
- lib/cli/deploy.rb
|
147
148
|
- lib/cli/develop.rb
|
148
149
|
- lib/cli/project.rb
|
149
150
|
- lib/cli/scaffold.rb
|