forked from BrewBuddyOrg/BrewBuddy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
69 lines (65 loc) · 2.72 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
//def notifySuccessful() {
// slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
//}
pipeline {
agent any
stages {
stage('Clone') {
steps {
stash(name: 'scm', includes: '*')
git(url: 'https://github.com/bliekp/BrouwHulp.git', branch: "${env.BRANCH_NAME}", changelog: true, poll: true)
}
}
stage('Build in Docker') {
steps {
unstash 'scm'
script {
// docker.image('taraworks/lazarus-cross:0.0.2').inside('-u root -v /var/jenkins_home/.lazarus:/var/jenkins_home/.lazarus'){
docker.image('taraworks/lazarus-cross:0.0.2').inside('-u root'){
sh '/usr/bin/apt-get install -y libfann-dev'
sh 'pwd'
sh 'chown -R 1000:1000 .'
sh 'pwd'
// sh 'find . -name "*.o" -exec rm {} \\;'
// sh 'find . -name "*.ppu" -exec rm {} \\;'
sh 'cd Source && lazbuild --lazarusdir=/usr/share/lazarus/1.8.0 --add-package ./3rdParty/ExpandPanels/pexpandpanels.lpk'
sh 'cd Source && lazbuild --lazarusdir=/usr/share/lazarus/1.8.0 --add-package ./3rdParty/uniqueinstance-1.0/uniqueinstance_package.lpk'
sh 'cd Source && lazbuild --lazarusdir=/usr/share/lazarus/1.8.0 --add-package ./3rdParty/Synapse/source/lib/laz_synapse.lpk'
sh 'cd Source && lazbuild --lazarusdir=/usr/share/lazarus/1.8.0 ./brewbuddy_linux-x64.lpi'
sh 'cd Source && PATH=$PATH:/opt/clang/bin:/opt/osxcross/target/bin lazbuild --lazarusdir=/usr/share/lazarus/1.8.0 -B ./brewbuddy_win32.lpi --ws=win32 --cpu=i386 --os=win32 --compiler=/opt/windows/lib/fpc/3.0.4/ppcross386'
sh 'chown -R 1000:1000 .'
}
}
}
}
}
post {
always {
echo ""
}
failure {
echo "Build FAILED..."
echo "Now let's remove the stash:"
script {
docker.image('taraworks/lazarus-cross:0.0.2').inside('-u root -v /var/jenkins_home/.lazarus:/var/jenkins_home/.lazarus'){
sh 'pwd && ls -altrh'
sh 'rm -rf * .git .github'
sh 'ls -altrh'
}
}
}
success {
// notifySuccessful()
archiveArtifacts artifacts: 'Output/brewbuddy', fingerprint: true
archiveArtifacts artifacts: 'Output/brewbuddy.exe', fingerprint: true
echo "SUCCESS!"
script {
docker.image('taraworks/lazarus-cross:0.0.2').inside('-u root -v /var/jenkins_home/.lazarus:/var/jenkins_home/.lazarus'){
sh 'pwd && ls -altrh'
sh 'rm -rf * .git .github'
sh 'ls -altrh'
}
}
}
}
}