0
0
Fork 0

refs #6797 feat: deploy dev branch and use bun

This commit is contained in:
Alex Moreno 2024-02-05 09:42:21 +01:00
parent a5064e2e2f
commit 24c42ddbb2
6 changed files with 49 additions and 9302 deletions

View File

@ -1,5 +1,6 @@
FROM node:stretch-slim 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 WORKDIR /app
COPY dist/spa ./ COPY dist/spa ./
CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"] CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"]

73
Jenkinsfile vendored
View File

@ -1,4 +1,33 @@
#!/usr/bin/env groovy #!/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 { pipeline {
agent any agent any
options { options {
@ -9,38 +38,20 @@ pipeline {
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}" STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
} }
stages { 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') { stage('Install') {
environment { environment {
NODE_ENV = "" NODE_ENV = ""
} }
steps { steps {
nodejs('node-v18') { nodejs('node-v18') {
sh 'npm install --no-audit --prefer-offline' sh 'bun install --no-audit --prefer-offline'
} }
} }
} }
stage('Test') { stage('Test') {
when { not { anyOf { when {
branch 'test' expression { !PROTECTED_BRANCH }
branch 'master' }
}}}
environment { environment {
NODE_ENV = "" NODE_ENV = ""
} }
@ -48,17 +59,16 @@ pipeline {
stage('Frontend') { stage('Frontend') {
steps { steps {
nodejs('node-v18') { nodejs('node-v18') {
sh 'npm run test:unit:ci' sh 'bun run test:unit:ci'
} }
} }
} }
} }
} }
stage('Build') { stage('Build') {
when { anyOf { when {
branch 'test' expression { PROTECTED_BRANCH }
branch 'master' }
}}
environment { environment {
CREDENTIALS = credentials('docker-registry') CREDENTIALS = credentials('docker-registry')
} }
@ -70,10 +80,9 @@ pipeline {
} }
} }
stage('Deploy') { stage('Deploy') {
when { anyOf { when {
branch 'test' expression { PROTECTED_BRANCH }
branch 'master' }
}}
environment { environment {
DOCKER_HOST = "${env.SWARM_HOST}" DOCKER_HOST = "${env.SWARM_HOST}"
} }
@ -85,7 +94,7 @@ pipeline {
post { post {
always { always {
script { script {
if (!['master', 'test'].contains(env.BRANCH_NAME)) { if (!PROTECTED_BRANCH) {
try { try {
junit 'junitresults.xml' junit 'junitresults.xml'
junit 'junit.xml' junit 'junit.xml'

View File

@ -5,13 +5,13 @@ Lilium frontend
## Install the dependencies ## Install the dependencies
```bash ```bash
npm install bun install
``` ```
### Install quasar cli ### Install quasar cli
```bash ```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.) ### Start the app in development mode (hot-code reloading, error reporting, etc.)
@ -23,7 +23,7 @@ quasar dev
### Run unit tests ### Run unit tests
```bash ```bash
npm run test:unit bun run test:unit
``` ```
### Run e2e tests ### Run e2e tests

BIN
bun.lockb Executable file

Binary file not shown.

9264
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,8 @@
"engines": { "engines": {
"node": "^20 || ^18 || ^16", "node": "^20 || ^18 || ^16",
"npm": ">= 8.1.2", "npm": ">= 8.1.2",
"yarn": ">= 1.21.1" "yarn": ">= 1.21.1",
"bun": ">= 1.0.25"
}, },
"overrides": { "overrides": {
"@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-vue": "^4.0.0",