-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci_setup
executable file
·63 lines (49 loc) · 1.61 KB
/
ci_setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# These values need to be bumped when producing new RPMs
# version = version of software you are compiling
# iteration = the iteration number of the RPM you are producing
# NOTE: The RPM which is produced will overwrite the RPM on the S3 bucket on successful run
export version=1.3
export iteration=3
# Remove Gemfile.lock if it exists
if [ -f Gemfile.lock ]; then
echo "Removing Gemfile.lock file... this could be handled by clearing jenkins workspace"
rm -f Gemfile.lock
fi
# Source my jenkins config if available
if [ -f ~/.jenkins.sh ]; then
. ~/.jenkins.sh
fi
# Set ruby version
RUBY_VERSION=2.0.0-p247
echo RUBY_VERSION = $RUBY_VERSION
echo GIT_BRANCH = $GIT_BRANCH
# Install ruby version
rvm install ruby-$RUBY_VERSION --disable-binary --verify-downloads 1
# Set ruby / gemset
rvm use $RUBY_VERSION@omnibus-intu_aws_cfn_bootstrap --create
# Reload RVM to fix Seg Fault that was going to drive Weaver instance
rvm reload
# Function to cleanup any running instances and exit
function clean_up_and_exit {
echo "--- Cleaning Up Build Instances ---"
ruby ./script/cleanup.rb
echo "--- Build Completed With Status $1 ---"
exit $1
}
# Install bundler
gem install bundler --no-ri --no-rdoc
# Run bundle
bundle install
if [ $? -ne 0 ]; then
clean_up_and_exit 1
fi
# Create an instance
knife ec2 server create -c ./script/knife/config/knife.rb \
--template-file ./script/knife/templates/omnibus.erb \
--groups=build \
--node-name='intu-aws-cfn-bootstrap-omnibus-build'
if [ $? -ne 0 ]; then
clean_up_and_exit 1
fi
clean_up_and_exit 0