forked from linea-it/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
48 lines (47 loc) · 1.54 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
pipeline {
environment {
registry = "linea/react-template"
registryCredential = 'Dockerhub'
deployment = 'react-template'
namespace = 'react-template'
}
agent any
stages {
stage('Test') {
steps {
sh 'yarn install'
sh 'yarn lint'
sh 'yarn test'
}
}
stage('Building and push image') {
when {
allOf {
expression {
env.TAG_NAME == null
}
expression {
env.BRANCH_NAME.toString().equals('master')
}
}
}
steps {
echo 'DEPLOY'
// script {
// sh 'docker build -t $registry:$GIT_COMMIT .'
// docker.withRegistry( '', registryCredential ) {
// sh 'docker push $registry:$GIT_COMMIT'
// sh 'docker rmi $registry:$GIT_COMMIT'
// }
// sh """
// curl -D - -X \"POST\" \
// -H \"content-type: application/json\" \
// -H \"X-Rundeck-Auth-Token: $RD_AUTH_TOKEN\" \
// -d '{\"argString\": \"-namespace $namespace -image $registry:$GIT_COMMIT -deployment $deployment\"}' \
// https://fox.linea.gov.br/api/1/job/e79ea1f7-e156-4992-98b6-75995ac4c15a/executions
// """
// }
}
}
}
}