This repository has been archived by the owner on Oct 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
60 lines (53 loc) · 1.71 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
def branchName = env.BRANCH_NAME.toLowerCase()
script {
if (branchName.contains("/")) {
// ignore branch type
branchName = branchName.split("/")[1]
}
}
branchName = branchName.replace("-", "")
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '3')) // Aufräum-Strategie des Builds, hier Log Rotation mit 3 aufbewahrten Builds
}
agent any
tools {
nodejs 'NodeJS'
}
stages {
stage('Npm Install') {
steps {
sh "npm install"
sh "npm audit fix"
}
}
stage('Webpack') {
steps {
sh "npm run build"
}
}
stage('Docker Develop') {
when {
branch 'develop'
}
steps {
script {
def dockerfile = "Dockerfile"
def customImage = docker.build("coding-camp-2020:develop", "-f ${dockerfile} --build-arg environment=development .")
docker.withRegistry('https://coding-camp.artifactory.sybit.de', 'sybit_ausbildung_artifactory') {
customImage.push("develop")
}
}
echo "build image for develop"
}
}
stage('Trigger Deploy') {
when {
branch 'develop'
}
steps {
build job: 'CodingCamp-Deploy', quietPeriod: 120, wait: false
}
}
}
}