-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
73 lines (60 loc) · 1.48 KB
/
Jenkinsfile
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
@Library('conservify') _
properties([
pipelineTriggers([githubPush()]),
buildDiscarder(logRotator(numToKeepStr: '5')),
disableConcurrentBuilds()
])
def getBranch(scmInfo) {
def (remoteOrBranch, branch) = scmInfo.GIT_BRANCH.tokenize('/')
if (branch) {
return branch;
}
return remoteOrBranch;
}
timestamps {
node ("jenkins-aws-ubuntu") {
try {
def scmInfo
stage ('git') {
scmInfo = checkout scm
}
def branch = getBranch(scmInfo)
stage ('build') {
withEnv(["GIT_LOCAL_BRANCH=${branch}"]) {
withEnv(["PATH+GOLANG=${tool 'golang-amd64'}/bin"]) {
sh """
# Permissions errors:
# docker exec -u 0:0 docker_jenkins_1 chmod 777 /var/run/docker.sock
docker ps -a
export PATH=$PATH:node_modules/.bin
make clean
make ci
make ci-db-tests
make docker-images
make write-version
"""
}
}
}
def version = readFile('version.txt')
currentBuild.description = version.trim()
stage ('container') {
dir ('dev-ops') {
git branch: 'main', url: "https://github.com/conservify/dev-ops.git"
withAWS(credentials: 'aws-default', region: 'us-east-1') {
sh "cd amis && make clean && make portal-stack charting-stack -j3"
}
}
}
stage ('archive') {
archiveArtifacts artifacts: 'build/fktool, build/sanitizer, build/movedata, build/webhook, dev-ops/amis/build/*.tar'
print("fktool binary needs to be updated manually")
}
notifySuccess()
}
catch (Exception e) {
notifyFailure(e)
throw e;
}
}
}