refs #6797 feat: deploy dev branch and use bun
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
a5064e2e2f
commit
24c42ddbb2
|
@ -1,5 +1,6 @@
|
|||
FROM node:stretch-slim
|
||||
RUN npm install -g @quasar/cli
|
||||
RUN curl -fsSL https://bun.sh/install | bash
|
||||
RUN bun install -g @quasar/cli
|
||||
WORKDIR /app
|
||||
COPY dist/spa ./
|
||||
CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"]
|
|
@ -1,4 +1,33 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
def PROTECTED_BRANCH
|
||||
|
||||
pre: {
|
||||
switch (env.BRANCH_NAME) {
|
||||
case 'test':
|
||||
env.NODE_ENV = 'test'
|
||||
env.BACK_REPLICAS = 2
|
||||
break
|
||||
case 'master':
|
||||
env.NODE_ENV = 'production'
|
||||
env.BACK_REPLICAS = 4
|
||||
break
|
||||
default:
|
||||
env.NODE_ENV = 'dev'
|
||||
env.BACK_REPLICAS = 1
|
||||
}
|
||||
|
||||
PROTECTED_BRANCH = [
|
||||
'dev',
|
||||
'test',
|
||||
'master'
|
||||
].contains(env.BRANCH_NAME)
|
||||
|
||||
// Uncomment to enable debugging
|
||||
// https://loopback.io/doc/en/lb3/Setting-debug-strings.html#debug-strings-reference
|
||||
//env.DEBUG = 'strong-remoting:shared-method'
|
||||
}
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
options {
|
||||
|
@ -9,38 +38,20 @@ pipeline {
|
|||
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
|
||||
}
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
script {
|
||||
switch (env.BRANCH_NAME) {
|
||||
case 'master':
|
||||
env.NODE_ENV = 'production'
|
||||
env.FRONT_REPLICAS = 2
|
||||
break
|
||||
case 'test':
|
||||
env.NODE_ENV = 'test'
|
||||
env.FRONT_REPLICAS = 1
|
||||
break
|
||||
}
|
||||
}
|
||||
setEnv()
|
||||
}
|
||||
}
|
||||
stage('Install') {
|
||||
environment {
|
||||
NODE_ENV = ""
|
||||
}
|
||||
steps {
|
||||
nodejs('node-v18') {
|
||||
sh 'npm install --no-audit --prefer-offline'
|
||||
sh 'bun install --no-audit --prefer-offline'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
when { not { anyOf {
|
||||
branch 'test'
|
||||
branch 'master'
|
||||
}}}
|
||||
when {
|
||||
expression { !PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
NODE_ENV = ""
|
||||
}
|
||||
|
@ -48,17 +59,16 @@ pipeline {
|
|||
stage('Frontend') {
|
||||
steps {
|
||||
nodejs('node-v18') {
|
||||
sh 'npm run test:unit:ci'
|
||||
sh 'bun run test:unit:ci'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
when { anyOf {
|
||||
branch 'test'
|
||||
branch 'master'
|
||||
}}
|
||||
when {
|
||||
expression { PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
CREDENTIALS = credentials('docker-registry')
|
||||
}
|
||||
|
@ -70,10 +80,9 @@ pipeline {
|
|||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
when { anyOf {
|
||||
branch 'test'
|
||||
branch 'master'
|
||||
}}
|
||||
when {
|
||||
expression { PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
DOCKER_HOST = "${env.SWARM_HOST}"
|
||||
}
|
||||
|
@ -85,7 +94,7 @@ pipeline {
|
|||
post {
|
||||
always {
|
||||
script {
|
||||
if (!['master', 'test'].contains(env.BRANCH_NAME)) {
|
||||
if (!PROTECTED_BRANCH) {
|
||||
try {
|
||||
junit 'junitresults.xml'
|
||||
junit 'junit.xml'
|
||||
|
|
|
@ -5,13 +5,13 @@ Lilium frontend
|
|||
## Install the dependencies
|
||||
|
||||
```bash
|
||||
npm install
|
||||
bun install
|
||||
```
|
||||
|
||||
### Install quasar cli
|
||||
|
||||
```bash
|
||||
sudo npm install -g @quasar/cli
|
||||
sudo bun install -g @quasar/cli
|
||||
```
|
||||
|
||||
### Start the app in development mode (hot-code reloading, error reporting, etc.)
|
||||
|
@ -23,7 +23,7 @@ quasar dev
|
|||
### Run unit tests
|
||||
|
||||
```bash
|
||||
npm run test:unit
|
||||
bun run test:unit
|
||||
```
|
||||
|
||||
### Run e2e tests
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -46,7 +46,8 @@
|
|||
"engines": {
|
||||
"node": "^20 || ^18 || ^16",
|
||||
"npm": ">= 8.1.2",
|
||||
"yarn": ">= 1.21.1"
|
||||
"yarn": ">= 1.21.1",
|
||||
"bun": ">= 1.0.25"
|
||||
},
|
||||
"overrides": {
|
||||
"@vitejs/plugin-vue": "^4.0.0",
|
||||
|
|
Loading…
Reference in New Issue