-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
executable file
·112 lines (102 loc) · 3.34 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
pipeline {
environment {
registry = 's20'
registryCredential = '977ae189-bf38-4b7c-a7c4-ccc5f6111858'
dockerImage = ''
}
agent {
docker {
image 'laravelphp/vapor:php82'
}
}
stages {
stage('Backend') {
agent {
docker {
image 'laravelphp/vapor:php82'
}
}
stages {
stage('Composer Install') {
steps {
dir('backend-laravel') {
sh 'php composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction'
}
}
}
stage('Build Laravel Docker') {
steps {
dir('backend-laravel') {
script {
dockerImage = docker.build 's20api:nightly'
}
}
}
}
stage('Push Laravel Docker') {
steps {
dir('backend-laravel') {
script {
docker.withRegistry('https://register.lan', registryCredential) {
dockerImage.push()
}
}
}
}
}
}
}
stage('Frontend') {
agent {
docker {
image 'satantime/puppeteer-node:20-buster-slim'
}
}
stages {
stage('Install NPM Dep') {
steps {
dir('frontend-ionic') {
sh 'npm install -f'
sh 'npm install -g @angular/cli'
sh 'npm i -D puppeteer --legacy-peer-deps && node node_modules/puppeteer/install.mjs'
}
}
}
stage('Run Tests') {
steps {
dir('frontend-ionic') {
sh 'ng test'
}
}
}
stage('Modify Env') {
steps {
dir('frontend-ionic') {
sh 'cp src/app/config.prod.ts src/app/config.ts'
}
}
}
stage('Build Ionic Docker') {
steps {
dir('frontend-ionic') {
script {
dockerImage = docker.build 's20:nightly'
}
}
}
}
stage('Push Ionic Docker') {
steps {
script {
dir('frontend-ionic') {
docker.withRegistry('https://register.lan', registryCredential) {
dockerImage.push()
}
}
}
}
}
}
}
}
}