forked from monginadiana/italanta-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
53 lines (47 loc) · 1.72 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
pipeline {
agent any
tools {
nodejs "node16"
}
environment {
FIREBASE_TOKEN = credentials('FIREBASE_TOKEN');
ENV_FILE_DEST = 'apps/conv-learning-manager/src/environments/environment.ts'
ENV_FILE_DEST_PROD = 'apps/conv-learning-manager/src/environments/environment.prod.ts'
}
stages {
stage ('Install firebase-tools'){
steps {
sh "npm install -g firebase-tools"
}
}
stage('Build the project') {
steps {
sh 'npm install --legacy-peer-deps'
}
}
stage('Deploy to Enabel') {
steps {
withCredentials([file(credentialsId: 'enabel-prod-environment-file', variable: 'ENV_FILE')]) {
// some block
sh 'mkdir -p apps/conv-learning-manager/src/environments'
sh 'cat ${ENV_FILE} > ${ENV_FILE_DEST}'
sh 'cat ${ENV_FILE} > ${ENV_FILE_DEST_PROD}'
sh 'firebase use enabel-elearning'
sh 'firebase deploy --token ${FIREBASE_TOKEN} --only hosting'
}
}
}
stage('Deploy to Farmbetter') {
steps {
withCredentials([file(credentialsId: 'farmbetter-prod-environment-file', variable: 'ENV_FILE')]) {
// some block
sh 'mkdir -p apps/conv-learning-manager/src/environments'
sh 'cat ${ENV_FILE} > ${ENV_FILE_DEST}'
sh 'cat ${ENV_FILE} > ${ENV_FILE_DEST_PROD}'
sh 'firebase use farmbetter-prod'
sh 'firebase deploy --token ${FIREBASE_TOKEN} --only hosting'
}
}
}
}
}