-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_ezbake.sh
executable file
·49 lines (37 loc) · 1.31 KB
/
build_ezbake.sh
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
#!/bin/bash
set -e
PROJECTS="${PROJECTS:-puppetserver puppetdb}"
BRANCHES="${BRANCHES:-main 7.x}"
RUBY_VERSION="${RUBY_VERSION:-3.1.2}"
source /etc/os-release
javac -version >/dev/null || sudo -E apt -y install openjdk-17-jdk-headless
cowpoke --version >/dev/null || sudo -E apt -y install devscripts
if ! [ -x /usr/local/bin/lein ] ; then
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
chmod +x lein
sudo cp -f lein /usr/local/bin/lein
fi
lein --version >/dev/null
command -v rbenv >/dev/null || sudo -E apt -y install rbenv
eval "$(rbenv init -)"
## build
for PROJECT in $PROJECTS ; do
[ -d ${PROJECT}/.git ] || git clone https://github.com/puppetlabs/${PROJECT}.git
pushd ${PROJECT} >/dev/null
if ! rbenv local ${RUBY_VERSION} ; then
rbenv install ${RUBY_VERSION}
rbenv local ${RUBY_VERSION}
fi
for BRANCH in $BRANCHES ; do
echo "**> ${PROJECT}/${BRANCH}"
git reset --hard origin/${BRANCH}
export GEM_SOURCE="https://rubygems.org"
export MOCK=""
export COW="base-${VERSION_CODENAME}-all.cow"
export EZBAKE_ALLOW_UNREPRODUCIBLE_BUILDS=true
export EZBAKE_NODEPLOY=true
export DEBIAN_FRONTEND=noninteractive
lein clean && lein install && lein with-profile ezbake,provided ezbake local-build
done
popd >/dev/null
done