-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
37 lines (36 loc) · 1.25 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
// Author: Sebastian Warnholz
// EMail: sebastian.warnholz@inwt-statistics.de
pipeline {
agent any
options { disableConcurrentBuilds() }
environment {
CUR_PROJ = 'isomemo-data' // github repo name
CUR_PKG_FOLDER = '.' // defaults to root
TMP_SUFFIX = """${sh(returnStdout: true, script: 'echo `cat /dev/urandom | tr -dc \'a-z\' | fold -w 6 | head -n 1`')}"""
GH_TOKEN = credentials("github-isomemo")
}
stages {
stage('Testing') {
steps {
sh '''
docker build -t tmp-$CUR_PROJ-$TMP_SUFFIX .
docker run --rm --network host tmp-$CUR_PROJ-$TMP_SUFFIX check
docker rmi tmp-$CUR_PROJ-$TMP_SUFFIX
'''
}
}
stage('Deploy R-package') {
when { branch 'main' }
steps {
sh '''
curl https://raw.githubusercontent.com/Pandora-IsoMemo/drat/main/deploy.sh > deploy.sh
# Expects environment variables:
# CUR_PROJ
# TMP_SUFFIX
# GH_TOKEN_PSW -- a GitHub personal access token with write access to the drat repo
bash deploy.sh
'''
}
}
}
}