Merge branch 'development' into f047_Edit-der-Namen, bug gefixt
This commit is contained in:
17
Dockerfile.dev
Normal file
17
Dockerfile.dev
Normal file
@@ -0,0 +1,17 @@
|
||||
# --- Build stage ---
|
||||
FROM node:22 AS build
|
||||
ENV NODE_ENV=production
|
||||
ENV ORIGIN=https://tatort-dev.innovation-hub-niedersachsen.de
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . ./
|
||||
COPY config_dev.json ./config.json
|
||||
RUN npm run build
|
||||
|
||||
# --- Production stage ---
|
||||
FROM node:22-alpine3.20
|
||||
COPY --from=build /app .
|
||||
ENV HOST=0.0.0.0
|
||||
EXPOSE 3000
|
||||
CMD ["sh", "-c", "ORIGIN=https://tatort-dev.innovation-hub-niedersachsen.de node build/index.js"]
|
||||
@@ -6,6 +6,7 @@ WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . ./
|
||||
COPY config_prod.json ./config.json
|
||||
RUN npm run build
|
||||
|
||||
# --- Production stage ---
|
||||
@@ -14,4 +15,3 @@ COPY --from=build /app .
|
||||
ENV HOST=0.0.0.0
|
||||
EXPOSE 3000
|
||||
CMD ["sh", "-c", "ORIGIN=https://tatort.innovation-hub-niedersachsen.de node build/index.js"]
|
||||
|
||||
103
Jenkinsfile
vendored
Normal file
103
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/* groovylint-disable-next-line UnusedVariable */
|
||||
@Library('InnoHub-Library') _
|
||||
|
||||
Boolean didRun = false
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
tools {
|
||||
nodejs 'NodeJS-24.2.0'
|
||||
}
|
||||
|
||||
environment {
|
||||
REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/'
|
||||
USER = 'jenkins'
|
||||
TOKEN = credentials('JenkinsGitea')
|
||||
}
|
||||
|
||||
parameters {
|
||||
string(name: 'REPO_NAME', defaultValue: '', description: 'Repo Name')
|
||||
string(name: 'GIT_REF', defaultValue: '', description: 'Git Ref')
|
||||
}
|
||||
|
||||
options {
|
||||
buildDiscarder(
|
||||
BuildHistoryManager([
|
||||
[ continueAfterMatch: false, matchAtMost: 5 ],
|
||||
[ actions: [ DeleteBuild() ] ]
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Validate Repository') {
|
||||
steps {
|
||||
script {
|
||||
checkRepoName(params.REPO_NAME, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Install Dependencies') {
|
||||
steps {
|
||||
script {
|
||||
didRun = true
|
||||
}
|
||||
sh 'npm ci'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Test & Security Audit') {
|
||||
steps {
|
||||
script {
|
||||
didRun = true
|
||||
}
|
||||
echo 'Start checking security vulnerabilities in npm packages'
|
||||
sh 'npm audit --audit-level=moderate'
|
||||
}
|
||||
}
|
||||
|
||||
stage('SonarQube Analysis') {
|
||||
steps {
|
||||
withSonarQubeEnv('sonarqube') {
|
||||
sh 'sonar-scanner -Dsonar.projectKey=tatort -Dsonar.sources=src'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push image to gitea registry') {
|
||||
when {
|
||||
branch 'development'
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
didRun = true
|
||||
def tag = "innohub/tatort-dev:0.${env.BUILD_ID}"
|
||||
docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') {
|
||||
docker.build(tag, '-f Dockerfile.dev .').push('latest')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
if (didRun) {
|
||||
echo 'Pipeline erfolgreich!'
|
||||
discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc'
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
if (didRun) {
|
||||
echo 'Pipeline fehlgeschlagen!'
|
||||
discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
config_dev.json
Normal file
17
config_dev.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"minio": {
|
||||
"endPoint": "sws3.innovation-hub-niedersachsen.de",
|
||||
"port": 443,
|
||||
"useSSL": true,
|
||||
"accessKey": "wjpKrmaqXra99rX3D61H",
|
||||
"secretKey": "fTPi0u0FR6Lv9Y9IKydWv6WM0EA5XrsK008HCt9u"
|
||||
},
|
||||
"jwt": {
|
||||
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",
|
||||
"expiresIn": 3600
|
||||
},
|
||||
"auth": {
|
||||
"admin": { "password": "A-InnoHUB_2025!", "admin": true },
|
||||
"user": { "password": "U-InnoHUB_2025!", "admin": false }
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@
|
||||
},
|
||||
"jwt": {
|
||||
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",
|
||||
"expiresIn": 36000
|
||||
"expiresIn": 3600
|
||||
},
|
||||
"auth": {
|
||||
"admin": { "password": "A-InnoHUB_2025!", "admin": true },
|
||||
"user": { "password": "U-InnoHUB_2025!", "admin": false }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,5 +5,6 @@ export const load: PageServerLoad = (event: ServerLoadEvent) => {
|
||||
if (!event.locals.user && event.url.pathname !== '/anmeldung') throw redirect(303, '/anmeldung');
|
||||
return {
|
||||
user: event.locals.user
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user