forked from alphagov/maslow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
48 lines (37 loc) · 939 Bytes
/
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
#!/usr/bin/env groovy
REPOSITORY = 'maslow'
node {
def govuk = load '/var/lib/jenkins/groovy_scripts/govuk_jenkinslib.groovy'
try {
stage("Checkout") {
checkout scm
}
stage('Clean') {
govuk.cleanupGit()
}
stage('Env') {
govuk.setEnvar('RAILS_ENV', 'test')
}
stage('Bundle') {
govuk.bundleApp()
}
stage('Lint') {
govuk.rubyLinter()
}
stage("Build") {
govuk.runRakeTask('db:mongoid:drop')
sh "bundle exec rake"
}
stage("Result") {
govuk.pushTag(REPOSITORY, env.BRANCH_NAME, 'release_' + env.BUILD_NUMBER)
govuk.deployIntegration(REPOSITORY, env.BRANCH_NAME, 'release', 'deploy')
}
} catch (e) {
currentBuild.result = "FAILED"
step([$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: '[email protected]',
sendToIndividuals: true])
throw e
}
}