Skip to content

Commit 4c3b965

Browse files
committed
build clean trunk
1 parent 3534cb5 commit 4c3b965

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ RUN apt update -y -q && apt upgrade -y -q && apt update -y -q && \
2020
python3 \
2121
s3cmd \
2222
xz-utils \
23+
unzip \
24+
subversion \
2325
texinfo \
2426
zlib1g-dev
2527

build/build-clean.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
PROJNAME=clean
6+
URL=https://gitlab.science.ru.nl/clean-and-itasks/clean-build.git
7+
8+
VERSION=$1
9+
if echo ${VERSION} | grep 'trunk'; then
10+
VERSION=trunk-$(date +%Y%m%d)
11+
BRANCH=master
12+
LAST_REVISION="${3}"
13+
14+
CHECKURL2=https://gitlab.science.ru.nl/clean-and-itasks/clean-libraries.git
15+
CHECKURL3=https://gitlab.science.ru.nl/clean-compiler-and-rts/compiler.git
16+
CHECKURL4=https://gitlab.science.ru.nl/clean-and-itasks/clm.git
17+
18+
REVISION1=$(git ls-remote --heads "${URL}" "refs/heads/${BRANCH}" | cut -f 1)
19+
REVISION2=$(git ls-remote --heads "${CHECKURL2}" "refs/heads/master" | cut -f 1)
20+
REVISION3=$(git ls-remote --heads "${CHECKURL3}" "refs/heads/master" | cut -f 1)
21+
REVISION4=$(git ls-remote --heads "${CHECKURL4}" "refs/heads/master" | cut -f 1)
22+
REVISION=${REVISION1}-${REVISION2}-${REVISION3}-${REVISION4}
23+
echo "ce-build-revision:${REVISION}"
24+
25+
if [[ "${REVISION}" == "${LAST_REVISION}" ]]; then
26+
echo "ce-build-status:SKIPPED"
27+
exit
28+
fi
29+
else
30+
echo "Only builds trunk"
31+
exit
32+
fi
33+
34+
PROJVERSION=${PROJNAME}-${VERSION}
35+
36+
OUTPUT=/root/${PROJVERSION}.tar.xz
37+
S3OUTPUT=""
38+
if echo $2 | grep s3://; then
39+
S3OUTPUT=$2
40+
else
41+
OUTPUT=${2-/root/${PROJVERSION}.tar.xz}
42+
fi
43+
44+
STARTDIR=$(pwd)
45+
DIR=${STARTDIR}/${PROJNAME}
46+
git clone --depth 1 -b ${BRANCH} ${URL} ${DIR}
47+
48+
export CLEANDATE="$(date +%Y-%m-%d)"
49+
50+
PREFIX=/root/clean/build
51+
cd ${DIR}
52+
53+
./generic/cleanup.sh
54+
./generic/setup.sh clean-bundle-complete linux x64
55+
${STARTDIR}/custom-clean-fetch.sh clean-bundle-complete linux x64
56+
./generic/build.sh clean-bundle-complete linux x64
57+
58+
export XZ_DEFAULTS="-T 0"
59+
60+
tar Jcf ${OUTPUT} --transform "s,^./,./${PROJVERSION}/," -C ${PREFIX}/clean .
61+
62+
if [[ ! -z "${S3OUTPUT}" ]]; then
63+
s3cmd put --rr ${OUTPUT} ${S3OUTPUT}
64+
fi

build/custom-clean-fetch.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
SVN_BASEURL="https://svn.cs.ru.nl/repos"
3+
4+
if [ $# -ne 3 ]; then
5+
echo "Usage: $0 <package name> <os name> <architecture name>"
6+
exit 1
7+
fi
8+
9+
PACKAGE=$1
10+
OS=$2
11+
ARCH=$3
12+
13+
mkdir -p src
14+
15+
if [ -e $PACKAGE/$OS-$ARCH/svn-sources.txt ]; then
16+
tr -d '\r' < $PACKAGE/$OS-$ARCH/svn-sources.txt | while read repo branch; do
17+
18+
if [ ! -e src/$repo-`basename $branch` ]; then
19+
echo "Checking out svn repo: $repo / $branch"
20+
svn checkout -r HEAD -q $SVN_BASEURL/$repo/$branch src/$repo-`basename $branch`
21+
else
22+
echo "Skipping svn repo: $repo / $branch"
23+
fi
24+
done
25+
fi
26+
27+
if [ -e $PACKAGE/$OS-$ARCH/git-sources.txt ]; then
28+
tr -d '\r' < $PACKAGE/$OS-$ARCH/git-sources.txt | while read url branch; do
29+
dir="src/$(basename $url)-$branch"
30+
if [ ! -e $dir ]; then
31+
echo "Cloning git repo: $url / $branch"
32+
git clone --recursive --depth 1 -b $branch $url.git $dir
33+
else
34+
echo "Skipping git repo: $url / $branch"
35+
fi
36+
done
37+
fi

0 commit comments

Comments
 (0)