-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild-container.sh
executable file
·39 lines (32 loc) · 1.13 KB
/
build-container.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
#!/bin/bash
set -e
export NWJS_BRANCH="$1"
export WORKDIR="/usr/docker"
export NWJSDIR="${WORKDIR}/nwjs"
export DEPOT_TOOLS_DIRECTORY="${WORKDIR}/depot_tools"
export PATH=${PATH}:${DEPOT_TOOLS_DIRECTORY}
export DEPOT_TOOLS_REPO="https://chromium.googlesource.com/chromium/tools/depot_tools.git"
export RED='\033[0;31m'
export NC='\033[0m' # No Color
function getNecessaryUbuntuPackages {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y upgrade
apt-get -y install apt-utils git curl lsb-release sudo tzdata nano
echo "Europe/Zurich" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
apt-get -y install python python-setuptools
apt-get autoclean
apt-get autoremove
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
}
function getDepotTools {
git clone --depth 1 "$DEPOT_TOOLS_REPO" "$DEPOT_TOOLS_DIRECTORY"
}
[ -z "$NWJS_BRANCH" ] && exit 1
echo -e "${RED}Building docker image for branch: $NWJS_BRANCH${NC}"
getNecessaryUbuntuPackages
getDepotTools
./checkout-branch.sh "$NWJS_BRANCH"
echo -e "${RED}Finished building docker image from branch: $NWJS_BRANCH${NC}"