forked from arangodb-helper/JenkinsScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.docker
84 lines (74 loc) · 2.9 KB
/
Jenkinsfile.docker
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!groovy
// We need these modules:
//
// We need permisions for several string manipulation operations, like take()
def REGISTRY_URL="https://${REGISTRY}/"
// def DOCKER_CONTAINER="debianjessie"
def CONTAINERS=[
[ 'docker': true, 'name': 'centosix', 'packageFormat': 'RPM'],
// [ 'docker': true, 'name': 'centoseven', 'packageFormat': 'RPM'],
[ 'docker': true, 'name': 'opensusethirteen', 'packageFormat': 'RPM'],
[ 'docker': true, 'name': 'debianjessie', 'packageFormat': 'DEB'],
[ 'docker': true, 'name': 'ubuntufourteenofour', 'packageFormat': 'DEB'],
[ 'docker': true, 'name': 'ubuntusixteenofour', 'packageFormat': 'DEB'],
]
// TODO: aus GITTAG bauen
GITTAG_PKG="3.1.rc2"
def OS="Linux"
def RELEASE_OUT_DIR="/net/fileserver/"
def LOCAL_TAR_DIR="/mnt/workspace/tmp/"
def branches = [:]
def failures = ""
def paralellJobNames = []
def ADMIN_ACCOUNT = "[email protected]"
def lastKnownGoodGitFile="${RELEASE_OUT_DIR}/${env.JOB_NAME}.githash"
def lastKnownGitRev=""
def currentGitRev=""
def BUILT_FILE = ""
def DIST_FILE = ""
def fatalError = false
def DOCKER_VENDOR = ""
def BASE_RELEASE="3.1"
def ENTERPRISE = ENTERPRISE == "true"
if (ENTERPRISE) {
ARANGODB_RELEASE="${BASE_RELEASE}-enterprise"
}
else {
ARANGODB_RELEASE=BASE_RELEASE
}
stage("cloning source")
node {
sh "mount"
sh "pwd"
sh "ls -l /jenkins/workspace"
sh "cat /etc/issue /jenkins/workspace/issue"
def someString="1234567890"
echo someString.take(5)
if (fileExists(lastKnownGoodGitFile)) {
lastKnownGitRev=readFile(lastKnownGoodGitFile)
}
echo "git url: 'https://github.com/arangodb/arangodb-docker', branch: official"
git url: 'https://github.com/arangodb/arangodb-docker', branch: "official"
sh "if test ! -d arangodb-mesos-docker; then git clone https://github.com/ArangoDB/arangodb-mesos-docker; fi; cd arangodb-mesos-docker; git pull --all; git checkout ${BASE_RELEASE} "
sh "find"
}
stage("building docker container")
node {
if (ENTERPRISE) {
sh "cp /net/fileserver/EP/debianjessie/arangodb3e-${GITTAG_PKG}-1_amd64.deb arangodb.deb"
}
else {
sh "cp /net/fileserver/debianjessie/arangodb3-${GITTAG_PKG}-1_amd64.deb arangodb.deb"
}
sh "docker build -t arangodb/arangodb:${ARANGODB_RELEASE} -f Dockerfile3.local ."
sh "docker tag -f arangodb/arangodb:${ARANGODB_RELEASE} '${REGISTRY}/arangodb/arangodb:${ARANGODB_RELEASE}'"
sh "docker tag -f arangodb/arangodb:${ARANGODB_RELEASE} '${REGISTRY}/arangodb/arangodb:${ARANGODB_RELEASE}'"
sh "docker push '${REGISTRY}/arangodb/arangodb:${ARANGODB_RELEASE}'"
sh """
cd arangodb-mesos-docker
docker tag -f 'arangodb/arangodb:${ARANGODB_RELEASE}' 'arangodb/arangodb'
docker build -t 'arangodb/arangodb-mesos:${ARANGODB_RELEASE}' .
docker tag 'arangodb/arangodb-mesos:${ARANGODB_RELEASE}' '${REGISTRY}/arangodb/arangodb-mesos:${ARANGODB_RELEASE}'
docker push '${REGISTRY}/arangodb/arangodb-mesos:${ARANGODB_RELEASE}'
"""
}