-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
83 lines (83 loc) · 2.5 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
74
75
76
77
78
79
80
81
82
83
pipeline {
agent {
node {
label 'docker-host'
}
}
stages {
stage('Init') {
steps {
sh 'mkdir -p results'
sh 'mkdir -p http'
sh 'rsync -az src/jenkins/root/ ./'
writeFile file: 'default_branch', text: "${BRANCH_NAME},${BUILD_NUMBER}"
}
}
stage('Build Themes') {
agent {
dockerfile {
dir '.'
filename 'docker/runner/Dockerfile'
reuseNode true
}
}
environment {
// Fix for NPM in docker
HOME = "."
}
steps {
echo 'Building Themes!'
sh 'src/jenkins/build_themes.sh'
}
}
stage('Testing') {
stages {
stage('Themes') {
when {
changeset 'src/themes/**'
}
steps {
echo 'Testing themes'
}
}
stage('Chat') {
when {
changeset 'modules/**'
}
steps {
echo 'Testing Chat'
}
}
}
}
stage('Publish') {
environment {
ZIP_NAME = "LalkaChat-${BRANCH_NAME}-${BUILD_NUMBER}"
THEME_NAME = "themes-${BRANCH_NAME}"
UPLOAD_DIR = "/mnt/lc"
BUILDER = "deforce/lc-builder"
SECRETS_FILE = "http://repo.intra.czt.lv/lalkachat/secrets.yaml"
}
steps {
echo "Building Builder"
sh "docker build -t \${BUILDER} -f docker/windows-builder/Dockerfile ."
sh "cp requires_windows.txt requirements.txt"
sh "wget ${SECRETS_FILE}"
sh """docker run -v "\$(pwd):/src/" \${BUILDER}"""
sh "sudo /bin/chown -R jenkins.jenkins ./"
sh "cp -r http/ dist/windows/main/http/"
dir('dist/windows') {
sh "mv main LalkaChat"
sh "zip -r \${ZIP_NAME}.zip LalkaChat"
sh "chmod 664 \${ZIP_NAME}.zip"
sh "mv \${ZIP_NAME}.zip \$UPLOAD_DIR/"
}
}
}
}
post {
cleanup {
cleanWs()
}
}
}