Skip to content

Commit 6595eb2

Browse files
committed
travis support files
1 parent 02b3350 commit 6595eb2

File tree

8 files changed

+258
-4
lines changed

8 files changed

+258
-4
lines changed

.travis/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,17 @@ ENV JAVA_HOME /usr/java/latest
3434
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/MarkLogic/mlcmd/bin
3535

3636
# Install MarkLogic
37-
COPY ./MarkLogic.rpm /tmp/MarkLogic.rpm
37+
COPY .travis/install-ml-8.sh /tmp/install-ml-8.sh
38+
COPY .travis/install-ml-9.sh /tmp/install-ml-9.sh
39+
COPY .travis/install-ml-10.sh /tmp/install-ml-10.sh
40+
COPY .travis/install-ml.sh /tmp/install-ml.sh
3841

39-
RUN yum -y install /tmp/MarkLogic.rpm 2>&1 > /dev/null
42+
ARG MLBUILD_USER
43+
ARG MLBUILD_PASSWORD
44+
ARG ML_VERSION
45+
46+
RUN chmod 755 /tmp/install-ml.sh
47+
RUN /tmp/install-ml.sh "$MLBUILD_USER" "$MLBUILD_PASSWORD" "$ML_VERSION"
4048

4149
# Expose MarkLogic Server ports - add additional ones for your REST, etc
4250
# endpoints

.travis/install-ml-10.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# runs command from parameters and exits with the eoror code of the command
4+
# if it fails
5+
function successOrExit {
6+
"$@"
7+
local status=$?
8+
if [ $status -ne 0 ]; then
9+
echo "$1 exited with error: $status"
10+
exit $status
11+
fi
12+
}
13+
14+
test $1 && MLBUILD_USER=$1
15+
test $2 && MLBUILD_PASSWORD=$2
16+
test $3 && ML_VERSION=$3
17+
18+
suffix=$(sed -e 's#.*\.\(\)#\1#' <<< $ML_VERSION)
19+
if [[ $suffix = 'nightly' ]]; then
20+
# find today
21+
day=$(date +"%Y%m%d")
22+
23+
# if the user passed a day string as a param then use it instead
24+
test $4 && day=$4
25+
# make a version number out of the date
26+
ver="10.0-$day"
27+
28+
echo "********* Downloading MarkLogic nightly $ver"
29+
30+
# fetch/install ML nightly
31+
fname="MarkLogic-$ver.x86_64.rpm"
32+
33+
url="https://root.marklogic.com/nightly/builds/linux64-rh7/rh7v-10-tst-1.marklogic.com/HEAD/pkgs.$day/$fname"
34+
35+
status=$(curl -k --anyauth -u $MLBUILD_USER:$MLBUILD_PASSWORD --head --write-out %{http_code} --silent --output /dev/null $url)
36+
if [[ $status = 200 ]]; then
37+
successOrExit curl -k --anyauth -u $MLBUILD_USER:$MLBUILD_PASSWORD -o ./$fname $url
38+
39+
fname=$(pwd)/$fname
40+
41+
yum -y install $fname 2>&1 > /dev/null
42+
43+
echo "********* MarkLogic nightly $ver installed"
44+
else
45+
echo "CANNOT DOWNLOAD: status = $status for date $day (URL=\"$url\")"
46+
exit 1
47+
fi
48+
else
49+
echo "There is no ML 10, silly!"
50+
exit 1
51+
fi

.travis/install-ml-8.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
# runs command from parameters and exits with the eoror code of the command
4+
# if it fails
5+
function successOrExit {
6+
"$@"
7+
local status=$?
8+
if [ $status -ne 0 ]; then
9+
echo "$1 exited with error: $status"
10+
exit $status
11+
fi
12+
}
13+
14+
test $1 && MLBUILD_USER=$1
15+
test $2 && MLBUILD_PASSWORD=$2
16+
test $3 && ML_VERSION=$3
17+
18+
suffix=$(sed -e 's#.*\.\(\)#\1#' <<< $ML_VERSION)
19+
if [[ $suffix = 'nightly' ]]; then
20+
# find today
21+
day=$(date +"%Y%m%d")
22+
23+
# if the user passed a day string as a param then use it instead
24+
test $4 && day=$4
25+
# make a version number out of the date
26+
ver="8.0-$day"
27+
28+
echo "********* Downloading MarkLogic nightly $ver"
29+
30+
# fetch/install ML nightly
31+
fname="MarkLogic-RHEL7-$ver.x86_64.rpm"
32+
33+
url="https://root.marklogic.com/nightly/builds/linux64-rh7/rh7-intel64-80-test-1.marklogic.com/b8_0/pkgs.$day/$fname"
34+
35+
status=$(curl -k --anyauth -u $MLBUILD_USER:$MLBUILD_PASSWORD --head --write-out %{http_code} --silent --output /dev/null $url)
36+
if [[ $status = 200 ]]; then
37+
successOrExit curl -k --anyauth -u $MLBUILD_USER:$MLBUILD_PASSWORD -o ./$fname $url
38+
39+
fname=$(pwd)/$fname
40+
41+
yum -y install $fname --skip-broken
42+
43+
echo "********* MarkLogic nightly $ver installed"
44+
else
45+
echo "CANNOT DOWNLOAD: status = $status for date $day (URL=\"$url\")"
46+
exit 1
47+
fi
48+
else
49+
ver=${ML_VERSION}
50+
fname=MarkLogic-RHEL7-${ver}.x86_64.rpm
51+
52+
curl -c cookies.txt --data "email=${MLBUILD_USER}&password=${MLBUILD_PASSWORD}" https://developer.marklogic.com/login
53+
dl_link=$(curl -b cookies.txt --data "download=/download/binaries/8.0/${fname}" https://developer.marklogic.com/get-download-url | perl -pe 's/.*"path":"([^"]+).*/\1/')
54+
url="https://developer.marklogic.com${dl_link}"
55+
56+
echo "********* Downloading MarkLogic $ver"
57+
echo "Download URL: $url"
58+
59+
successOrExit curl -k -o ./$fname $url
60+
61+
fname=$(pwd)/$fname
62+
63+
yum -y install $fname --skip-broken
64+
65+
echo "********* MarkLogic $ver installed"
66+
fi

.travis/install-ml-9.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
3+
# runs command from parameters and exits with the eoror code of the command
4+
# if it fails
5+
function successOrExit {
6+
"$@"
7+
local status=$?
8+
if [ $status -ne 0 ]; then
9+
echo "$1 exited with error: $status"
10+
exit $status
11+
fi
12+
}
13+
14+
test $1 && MLBUILD_USER=$1
15+
test $2 && MLBUILD_PASSWORD=$2
16+
test $3 && ML_VERSION=$3
17+
18+
suffix=$(sed -e 's#.*\.\(\)#\1#' <<< $ML_VERSION)
19+
if [[ $suffix = 'nightly' ]]; then
20+
# find today
21+
day=$(date +"%Y%m%d")
22+
23+
# if the user passed a day string as a param then use it instead
24+
test $4 && day=$4
25+
# make a version number out of the date
26+
ver="9.0-$day"
27+
28+
echo "********* Downloading MarkLogic nightly $ver"
29+
30+
# fetch/install ML nightly
31+
fname="MarkLogic-$ver.x86_64.rpm"
32+
33+
url="https://root.marklogic.com/nightly/builds/linux64-rh7/rh7v-intel64-90-test-build.marklogic.com/b9_0/pkgs.$day/$fname"
34+
35+
status=$(curl -k --anyauth -u $MLBUILD_USER:$MLBUILD_PASSWORD --head --write-out %{http_code} --silent --output /dev/null $url)
36+
if [[ $status = 200 ]]; then
37+
successOrExit curl -k --anyauth -u $MLBUILD_USER:$MLBUILD_PASSWORD -o ./$fname $url
38+
39+
fname=$(pwd)/$fname
40+
41+
yum -y install $fname 2>&1 > /dev/null
42+
43+
echo "********* MarkLogic nightly $ver installed"
44+
else
45+
echo "CANNOT DOWNLOAD: status = $status for date $day (URL=\"$url\")"
46+
exit 1
47+
fi
48+
else
49+
ver=${ML_VERSION}
50+
fname=MarkLogic-${ver}.x86_64.rpm
51+
52+
curl -c cookies.txt --data "email=${MLBUILD_USER}&password=${MLBUILD_PASSWORD}" https://developer.marklogic.com/login
53+
dl_link=$(curl -b cookies.txt --data "download=/download/binaries/9.0/${fname}" https://developer.marklogic.com/get-download-url | perl -pe 's/.*"path":"([^"]+).*/\1/')
54+
url="https://developer.marklogic.com${dl_link}"
55+
56+
echo "********* Downloading MarkLogic $ver"
57+
58+
successOrExit curl -k -o ./$fname $url
59+
60+
fname=$(pwd)/$fname
61+
62+
yum -y install $fname 2>&1 > /dev/null
63+
64+
echo "********* MarkLogic $ver installed"
65+
fi

.travis/install-ml.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
test $1 && MLBUILD_USER=$1
4+
test $2 && MLBUILD_PASSWORD=$2
5+
test $3 && ML_VERSION=$3
6+
echo "ML_VERSION = ${ML_VERSION}"
7+
MAJOR_VER=$(sed -e 's#\([^.]*\)\..*#\1#' <<< $ML_VERSION)
8+
echo "major version = ${MAJOR_VER}"
9+
if [ "${MAJOR_VER}" = "8" ]; then
10+
echo "/tmp/install-ml-8.sh"
11+
chmod 755 /tmp/install-ml-8.sh
12+
/tmp/install-ml-8.sh ${MLBUILD_USER} ${MLBUILD_PASSWORD} ${ML_VERSION}
13+
elif [ "${MAJOR_VER}" = "9" ]; then
14+
echo "/tmp/install-ml-9.sh"
15+
chmod 755 /tmp/install-ml-9.sh
16+
/tmp/install-ml-9.sh ${MLBUILD_USER} ${MLBUILD_PASSWORD} ${ML_VERSION}
17+
elif [ "${MAJOR_VER}" = "10" ]; then
18+
echo "/tmp/install-ml-10.sh"
19+
chmod 755 /tmp/install-ml-10.sh
20+
/tmp/install-ml-10.sh ${MLBUILD_USER} ${MLBUILD_PASSWORD} ${ML_VERSION}
21+
else
22+
echo "NOTHING TO INSTALL!"
23+
exit 1
24+
fi

build-docker.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
3+
# This script is used to build the docker images
4+
# used to test the DHF in Travis
5+
6+
# build release images
7+
read -p "DMC User: " myuser
8+
read -s -p "DMC Password: " mypass
9+
10+
test $myuser && export MLBUILD_USER=$myuser
11+
test $mypass && export MLBUILD_PASSWORD=$mypass
12+
echo
13+
14+
for ver in 8.0-7 9.0-1.1 9.0-2 9.0-3
15+
do
16+
export ML_VERSION=$ver
17+
docker-compose build
18+
done
19+
20+
# build nightly images
21+
read -p "Nightly User: " myuser
22+
read -s -p "Nightly Password: " mypass
23+
24+
test $myuser && export MLBUILD_USER=$myuser
25+
test $mypass && export MLBUILD_PASSWORD=$mypass
26+
echo
27+
28+
for ver in 8.nightly 9.nightly 10.nightly
29+
do
30+
export ML_VERSION=$ver
31+
docker-compose build
32+
done

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
allprojects {
22
task resolveAllDependencies {
33
doLast {
4-
configurations.all { it.resolve() }
4+
configurations.all {
5+
if (it.isCanBeResolved()) {
6+
it.resolve()
7+
}
8+
}
59
}
610
}
711
}

docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
version: '3'
22
services:
33
marklogic:
4-
image: marklogiccommunity/marklogic-datahub:${ML_VERSION}
4+
image: "marklogiccommunity/marklogic-datahub:${ML_VERSION}"
55
build:
66
context: .
77
dockerfile: ./.travis/Dockerfile
8+
args:
9+
- MLBUILD_USER
10+
- MLBUILD_PASSWORD
11+
- ML_VERSION
812
ports:
913
- "5005:5005"
1014
- "8000-8020:8000-8020"

0 commit comments

Comments
 (0)