forked from CyrusBiotechnology/auth0-authorization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
47 lines (40 loc) · 1 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
#!groovy
def IMAGE_REF = ''
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
script {
IMAGE_REF=docker2.imageRef()
}
}
}
stage('Test') {
steps {
withCredentials([file(credentialsId: '8d8b1ca4-4036-477c-b7e8-018f0b1a67dd', variable: 'env_file')]) {
sh "docker build . --target tester --tag ${IMAGE_REF}.test"
sh "docker run --env-file ${env_file} ${IMAGE_REF}.test"
}
}
}
stage('Build') {
steps {
sh "docker build . --target builder"
}
}
stage('Publish package to npm') {
steps {
script {
if (env.BRANCH_NAME == 'master') {
withCredentials([string(credentialsId: 'npm-auth-token', variable: 'npm_token')]) {
sh "docker build . --target publisher --tag ${IMAGE_REF} --build-arg npm_token=${npm_token}"
sh "docker run ${IMAGE_REF}"
}
}
}
}
}
}
}