forked from Megh2507/React-Crypto-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenfile for backend
49 lines (47 loc) · 1.48 KB
/
jenfile for backend
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
pipeline {
agent any
environment {
//Environment variables
GITHUB_USERNAME = credentials('github-username')
GITHUB_ACCESS_TOKEN = credentials('github-access-token')
}
options {
buildDiscarder(logRotator(numToKeepStr: '3'))
disableConcurrentBuilds()
timestamps()
timeout(time: 10, unit: 'MINUTES')
}
stages {
//checkout the code in stage SCM
stage('Clone repository') {
steps {
cleanWs()
sh 'ls -lrt'
echo 'pulling the changes from soure code...'
checkout([$class: 'GitSCM',
branches: [[name: '*/main']], doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'CleanBeforeCheckout']],
gitTool: 'default',
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'github-access-token',
url: "https://${GITHUB_USERNAME}:${GITHUB_ACCESS_TOKEN}@github.com/Adecin/crowd_backend.git"]]])
echo 'workspace for the project'
sh 'pwd'
echo 'pulled source code'
sh 'ls -lrt'
}
}
stage('install') {
steps {
sh 'npm cache clean --force'
sh 'npm install || exit 1'
}
}
stage('Docker Build') {
steps {
sh "docker build -t my-node-backend ."
sh 'docker images'
}
}
}
}