buildserver 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/buildserver.gemspec +1 -1
- data/lib/buildserver/building_block.rb +18 -0
- data/lib/buildserver/instance.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fea7b59f4b3317ae8a59d45a88433bb844ac667
|
4
|
+
data.tar.gz: 28e8c0e22dfba7253f684e3d8d5e5daa73d58bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16a8bae7835f16fe07bd7f286dceee95be357d72d0e72eef321b4816411d91f11c11e8107a5538a4220087dce7edf49074cb8ae996e29955f6f29f1516059ab1
|
7
|
+
data.tar.gz: 1ad4b04a62b7b0863fce1e98183e4a991c7b27479bc05cb0be0f1bbd6502c29a0b0f43cdcdc02ce032dc4ee7000a1777ab482d64a8aefa8da15685440b275900
|
data/buildserver.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "buildserver"
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.5'
|
8
8
|
spec.authors = ["Kasper Grubbe"]
|
9
9
|
spec.email = ["kawsper@gmail.com"]
|
10
10
|
spec.summary = %q{Lets you easily compile bash scripts from Ruby to build server instances on your favorite Linux distro.}
|
@@ -85,6 +85,15 @@ EOF")
|
|
85
85
|
EOF")
|
86
86
|
end
|
87
87
|
|
88
|
+
## SYSTEM SETUP
|
89
|
+
###############################################
|
90
|
+
|
91
|
+
def if_first_system_setup?(direction = nil)
|
92
|
+
run_command("if [ ! -f /root/system_setup_complete ]; then", direction)
|
93
|
+
yield if block_given?
|
94
|
+
run_command("fi", direction)
|
95
|
+
end
|
96
|
+
|
88
97
|
## USER
|
89
98
|
###############################################
|
90
99
|
|
@@ -130,5 +139,14 @@ EOF")
|
|
130
139
|
run_command("fi")
|
131
140
|
end
|
132
141
|
|
142
|
+
## TEXT EDITING
|
143
|
+
###############################################
|
144
|
+
|
145
|
+
def find_and_replace(before, after, filepath)
|
146
|
+
run_command("OLD=\"#{before}\"")
|
147
|
+
run_command("NEW=\"#{after}\"")
|
148
|
+
run_command("sed -i \"s/\${OLD}/\${NEW}/g\" #{filepath}")
|
149
|
+
end
|
150
|
+
|
133
151
|
end
|
134
152
|
end
|
data/lib/buildserver/instance.rb
CHANGED
@@ -40,6 +40,10 @@ module Buildserver
|
|
40
40
|
@commands = []
|
41
41
|
@after_commands = []
|
42
42
|
|
43
|
+
# Safe bash:
|
44
|
+
@commands << "set -eux"
|
45
|
+
@commands << "set -o pipefail"
|
46
|
+
|
43
47
|
@build_blocks.each do |build_block|
|
44
48
|
@commands << "# ! #{build_block.to_s} -------------------------------------"
|
45
49
|
|
@@ -53,6 +57,10 @@ module Buildserver
|
|
53
57
|
|
54
58
|
@commands << @after_commands
|
55
59
|
|
60
|
+
@commands << "if [ ! -f /root/system_setup_complete ]; then"
|
61
|
+
@commands << "echo $(date \"+%Y.%m.%d-%H:%M:%S\") > /root/system_setup_complete"
|
62
|
+
@commands << "fi"
|
63
|
+
|
56
64
|
@commands.flatten
|
57
65
|
end
|
58
66
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Grubbe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|