forked from google/docsy
-
Notifications
You must be signed in to change notification settings - Fork 2
/
JenkinsfileGH
36 lines (35 loc) · 1.04 KB
/
JenkinsfileGH
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
pipeline {
environment {
IMAGE = 'docsy'
NS = 'oa-docs'
REGISTRY = 'registry.openanalytics.eu'
BRANCH_NAME_SAFE = env.BRANCH_NAME.toLowerCase().replaceAll(/[^a-z0-9._-]/, '.')
TAG = "${ env.BRANCH_NAME_SAFE == 'oastyle' ? 'latest' : env.BRANCH_NAME_SAFE }"
REGION = 'eu-west-1'
}
agent {
kubernetes {
yamlFile 'agent.pod.yaml'
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '3'))
authorizationMatrix inheritanceStrategy: inheritingGlobal(), permissions: ['hudson.model.Item.Build:oa-infrastructure', 'hudson.model.Item.Read:oa-infrastructure']
}
stages {
stage('image') {
steps {
container('kaniko'){
sh """
/kaniko/executor \
-v info \
--context ${env.WORKSPACE} \
--cache=true \
--cache-repo ${env.REGISTRY}/${env.NS}/${env.IMAGE} \
--destination ${env.REGISTRY}/${env.NS}/${env.IMAGE}:${env.TAG}
"""
}
}
}
}
}