-
Notifications
You must be signed in to change notification settings - Fork 12
/
Jenkinsfile
53 lines (49 loc) · 1.65 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
#!groovy
node {
currentBuild.result = "SUCCESS"
try {
stage 'Test'
env.NODE_ENV = "test"
checkout scm
print "Environment will be : ${env.NODE_ENV}"
dir('prototipo'){
sh 'node -v'
sh 'npm prune'
sh 'npm install'
sh 'npm test'
// sh 'npm run test-selenium'
// sh 'npm run test-jmeter'
// sh 'npm run test-integration'
// junit 'test-reports.xml'
// junit 'test-selenium-reports.xml'
// junit 'test-jmeter-reports.xml'
// junit 'test-integration-reports.xml'
}
stage 'Build Docker Images'
sh '/usr/local/bin/docker-compose up -d'
sh 'docker save tesis_uchuva > uchuva.tar'
archiveArtifacts artifacts: 'uchuva.tar', fingerprint: true
stage 'Build NPM package'
dir('prototipo'){
sh 'npm pack'
}
archiveArtifacts artifacts: 'prototipo/uchuva-*.tgz', fingerprint: true
stage 'Build DEB-RPM'
dir('prototipo/debian'){
sh './build'
}
archiveArtifacts artifacts: 'vagrant/deb/*.deb', fingerprint: true
stage 'Cleanup'
sh 'rm node_modules -rf'
sh '/usr/local/bin/docker-compose stop'
sh '/usr/local/bin/docker-compose rm -f'
}
catch (err) {
currentBuild.result = "FAILURE"
throw err
}
}
def version() {
def matcher = readFile('pom.xml') =~ '<version>(.+)</version>'
matcher ? matcher[0][1] : null
}