-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
53 lines (46 loc) · 1.25 KB
/
Jenkinsfile
File metadata and controls
53 lines (46 loc) · 1.25 KB
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
pipeline {
agent any
environment {
DOCKER_CREDENTIALS = credentials('dockerCredentials')
REACT_APP_BACKEND_URL = "/api/"
CI = "true"
}
stages {
stage('Install dependencies with NPM') {
steps {
nodejs('node14.1.0') {
sh('yarn install')
}
}
}
stage('Test') {
steps {
nodejs('node14.1.0') {
sh('yarn test')
}
}
}
stage('Create production build') {
steps {
nodejs('node14.1.0') {
sh('yarn build')
}
}
}
stage('Login to docker') {
steps {
sh('docker login -u $DOCKER_CREDENTIALS_USR -p $DOCKER_CREDENTIALS_PSW')
}
}
stage('Build docker image') {
steps {
sh('docker build -t $DOCKER_CREDENTIALS_USR/help-queue-react .')
}
}
stage('Push docker image to registry') {
steps {
sh('docker push $DOCKER_CREDENTIALS_USR/help-queue-react')
}
}
}
}