This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
65 lines (64 loc) · 1.88 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
@Library('manala') _
pipeline {
agent {
docker {
image 'manala/hugo'
args '--volume ${JENKINS_CACHE_DIR}:/srv/cache --entrypoint='
alwaysPull true
}
}
environment {
YARN_CACHE_FOLDER = '/srv/cache/all/yarn'
MANALA_CACHE_DIR = "/srv/cache/${manalaPathize(env.GIT_URL)}/manala"
APP_URL = credentials('APP_URL')
APP_URL_SUBDOMAIN = manalaDomainize(env.BRANCH_NAME)
DEPLOY_DESTINATION = credentials('DEPLOY_DESTINATION')
DEPLOY_DESTINATION_SUFFIX = manalaDomainize(env.BRANCH_NAME)
DEPLOY_RSYNC_RSH = credentials('DEPLOY_RSYNC_RSH')
}
stages {
stage('Install - Staging') {
when { not { branch 'master' } }
steps {
sh 'make install@staging'
}
}
stage('Install - Production') {
when { branch 'master' }
steps {
sh 'make install@production'
}
}
stage('Build - Staging') {
when { not { branch 'master' } }
steps {
sh 'make build@staging'
}
}
stage('Build - Production') {
when { branch 'master' }
steps {
sh 'make build@production'
}
}
stage('Optimize - Staging') {
when { not { branch 'master' } }
steps {
sh 'make optimize@staging'
}
}
stage('Optimize - Production') {
when { branch 'master' }
steps {
sh 'make optimize@production'
}
}
stage('Deploy - Staging') {
steps {
sshagent (credentials: ['deploy']) {
sh 'make deploy.staging'
}
}
}
}
}