-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsfileDeployIntero
71 lines (71 loc) · 2.17 KB
/
JenkinsfileDeployIntero
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
pipeline {
agent {
node {
label 'master'
}
}
triggers {
pollSCM('H/5 * * * *')
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
parameters {
string(name: 'BASE_REF', defaultValue: 'https://lymbo.intero.berlin/', description: 'URL the app shall be accessible from')
string(name: 'WEB_ROOT', defaultValue: '/var/www/lymbo', description: 'Web root directory for this app')
}
stages {
stage('Clean') {
steps {
sh "rm -rf ${WORKSPACE}/dist/*"
sh "rm -rf ${WORKSPACE}/reports/*"
sh "rm -rf ${WORKSPACE}/coverage/*"
sh "mkdir -p ${WORKSPACE}/reports"
}
}
stage('Init submodules') {
steps {
sh "git submodule init"
sh "git submodule update"
}
}
stage('Build Angular') {
steps {
sh "npm install"
sh "npm run build-prod -- --verbose --base-href ${params.BASE_REF}"
}
}
stage('Lint') {
steps {
sh "npm run lint-junit"
junit allowEmptyResults: true, testResults: 'reports/**/lint-results.xml'
}
}
stage('Compodoc') {
steps {
sh "npm run compodoc"
publishHTML (target: [
allowMissing: true,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'reports/documentation',
reportFiles: 'index.html',
reportName: "Compodoc"
])
}
}
// stage('Test') {
// steps {
// sh "npm run test"
// junit allowEmptyResults: true, testResults: 'reports/**/test-results.xml'
// }
// }
stage('Deploy') {
steps {
sh "mkdir -p ${params.WEB_ROOT}"
sh "rm -rf ${params.WEB_ROOT}/*"
sh "cp -R ${WORKSPACE}/dist/lymbo/* ${params.WEB_ROOT}"
}
}
}
}