This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
forked from teecke/docker-flutter-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
63 lines (57 loc) · 1.7 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
#!groovy
@Library('github.com/red-panda-ci/jenkins-pipeline-library@v3.1.6') _
// Initialize global config
cfg = jplConfig('docker-flutter-builder', 'docker', '', [slack: '', email:'pedroamador.rodriguez+teecke@gmail.com'])
pipeline {
agent { label 'docker' }
stages {
stage ('Initialize') {
steps {
jplStart(cfg)
}
}
stage ('Bash linter') {
steps {
script {
sh "devcontrol run-bash-linter"
}
}
}
stage ('Build') {
steps {
script {
sh "devcontrol build-all"
}
}
}
stage('Make release') {
when { expression { cfg.BRANCH_NAME.startsWith('release/new') } }
steps {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'teeckebot-docker-credentials',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh '''docker login -u ${USERNAME} -p ${PASSWORD}
docker push teecke/docker-flutter-builder
'''
}
jplMakeRelease(cfg, true)
}
post {
always {
sh 'docker logout'
}
}
}
}
post {
always {
jplPostBuild(cfg)
}
}
options {
timestamps()
ansiColor('xterm')
buildDiscarder(logRotator(artifactNumToKeepStr: '20',artifactDaysToKeepStr: '30'))
disableConcurrentBuilds()
timeout(time: 180, unit: 'MINUTES')
}
}