Skip to content

Commit 07d8c90

Browse files
Łukasz Maksymczuktyacbovi
authored andcommitted
Docker builder for centos 6 CLI
1 parent 8093dc2 commit 07d8c90

3 files changed

Lines changed: 89 additions & 25 deletions

File tree

build.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
export GITHUB_USERNAME=$1
5+
export GITHUB_PASSWORD=$2
6+
export AWS_ACCESS_KEY_ID=$3
7+
export AWS_ACCESS_KEY=$4
8+
export REPO=$5
9+
export BRANCH=$6
10+
export CORE_TAG_NAME="4.5.5.dev1"
11+
export CORE_BRANCH="master"
12+
13+
set +e
14+
. /etc/profile.d/rvm.sh
15+
set -e
16+
17+
curl -u $GITHUB_USERNAME:$GITHUB_PASSWORD https://raw.githubusercontent.com/cloudify-cosmo/${REPO}/${CORE_BRANCH}/packages-urls/common_build_env.sh -o ./common_build_env.sh &&
18+
source common_build_env.sh &&
19+
curl https://raw.githubusercontent.com/cloudify-cosmo/cloudify-common/${CORE_BRANCH}/packaging/common/provision.sh -o ./common-provision.sh &&
20+
source common-provision.sh
21+
22+
install_common_prereqs
23+
cd packaging/omnibus
24+
export CLI_BRANCH="$CORE_BRANCH"
25+
26+
# Get Omnibus software from Chef Omnibus repo
27+
rm -rf omnibus-software
28+
git clone https://github.com/chef/omnibus-software.git --depth 1 -q
29+
list_of_omnibus_softwares="gdbm cacerts config_guess gdbm libffi makedepend
30+
ncurses openssl pkg-config-lite setuptools
31+
util-macros version-manifest xproto zlib"
32+
for omnibus_softwate in $list_of_omnibus_softwares
33+
do
34+
if [[ -e omnibus-software/config/software/$omnibus_softwate.rb ]] ; then
35+
cp -r omnibus-software/config/software/$omnibus_softwate.rb \
36+
config/software/$omnibus_softwate.rb
37+
else
38+
echo "Missing software in Omnibus-Software repo"
39+
exit
40+
fi
41+
42+
[[ -e omnibus-software/config/patches/$omnibus_softwate ]] &&
43+
cp -r omnibus-software/config/patches/$omnibus_softwate config/patches/
44+
done
45+
46+
[ ! -d config/templates/ ] && mkdir config/templates/
47+
cp -r omnibus-software/config/templates/* config/templates/
48+
curl https://raw.githubusercontent.com/chef/omnibus-software/master/config/software/preparation.rb -o config/software/preparation.rb
49+
curl https://raw.githubusercontent.com/systemizer/omnibus-software/master/config/software/pip.rb -o config/software/pip.rb
50+
51+
if [[ "$OSTYPE" == "darwin"* ]]; then
52+
grep -l '/opt' config/software/* | xargs sed -i "" 's|/opt|/usr/local/opt|g'
53+
fi
54+
55+
omnibus build cloudify && result="success"
56+
cd pkg
57+
cat *.json || exit 1
58+
rm -f version-manifest.json
59+
[ $(ls | grep rpm | sed -n 2p ) ] && FILEEXT="rpm"
60+
[ $(ls | grep deb | sed -n 2p ) ] && FILEEXT="deb"
61+
[ $(ls | grep pkg | sed -n 2p ) ] && FILEEXT="pkg"
62+
63+
#remove the -1 - omnibus set the build_iteration to 1 if it null
64+
file=$(basename $(find . -type f -name "*.$FILEEXT"))
65+
echo "file=$file"
66+
file_no_build=$(echo "$file" | sed 's/\(.*\)-1/\1/' | sed 's/cloudify/cloudify-cli/')
67+
echo "file_no_build=$file_no_build"
68+
mv $file $file_no_build
69+
70+
[ "$result" == "success" ] && create_md5 $FILEEXT &&
71+
[ -z ${AWS_ACCESS_KEY} ] || upload_to_s3 $FILEEXT && upload_to_s3 "md5" &&
72+
upload_to_s3 "json"

packaging/Vagrantfile

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,6 @@ BRANCH = ENV['BRANCH']
2525
REPO = ENV['REPO']
2626

2727
Vagrant.configure('2') do |config|
28-
config.vm.define "centos65x64" do |centos65x64|
29-
#dummy box, will be overriden
30-
centos65x64.vm.box = "dummy"
31-
centos65x64.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
32-
centos65x64.vm.provider :aws do |aws, override|
33-
aws.access_key_id = AWS_ACCESS_KEY_ID
34-
aws.secret_access_key = AWS_ACCESS_KEY
35-
# official centos6.5 64bit with omnibus installed
36-
aws.ami = "ami-7f6ba306"
37-
aws.region = "eu-west-1"
38-
aws.instance_type = "m3.large"
39-
aws.keypair_name = "vagrant_build"
40-
override.ssh.username = "root"
41-
override.ssh.private_key_path = "~/.ssh/aws/vagrant_build.pem"
42-
override.nfs.functional = false
43-
aws.tags = { "Name" => "vagrant cli centos 6.5x64 build" }
44-
aws.security_groups = "vagrant_linux_build"
45-
end
46-
centos65x64.vm.provision "shell" do |s|
47-
s.path = "linux/provision.sh"
48-
s.args = "#{GITHUB_USERNAME} #{GITHUB_PASSWORD} #{AWS_ACCESS_KEY_ID} #{AWS_ACCESS_KEY} #{REPO} #{BRANCH}"
49-
s.privileged = false
50-
end
51-
end
52-
5328
config.vm.define "debian_wheezy_x64" do |debian_wheezy_x64|
5429
#dummy box, will be overriden
5530
debian_wheezy_x64.vm.box = "dummy"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM centos:6
2+
RUN yum install -y http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
3+
RUN yum install -y git fakeroot python-devel rpm-build
4+
RUN yum update -y nss
5+
RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
6+
RUN gpg2 --keyserver hkp://keys.gnupg.net --recv-keys \
7+
409B6B1796C275462A1703113804BB82D39DC0E3 \
8+
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
9+
RUN curl -sSL https://get.rvm.io | bash -s stable
10+
RUN /bin/bash -c '''\
11+
source /etc/profile.d/rvm.sh && \
12+
rvm install 2.4.4 && rvm use 2.4.4 && \
13+
gem install bundler -v '=1.16.0' --no-ri --no-rdoc && \
14+
gem install mixlib-cli -v 1.7.0 --no-ri --no-rdoc && \
15+
gem install omnibus --no-ri --no-rdoc \
16+
'''
17+
RUN yum install sudo -y

0 commit comments

Comments
 (0)