Merge pull request 'jenkins-docker' (#17) from jenkins-docker into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #17
This commit was merged in pull request #17.
This commit is contained in:
@@ -6,7 +6,7 @@ WORKDIR /app
|
|||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
COPY . ./
|
COPY . ./
|
||||||
COPY config.json_dev ./config.json
|
COPY config_dev.json ./config.json
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# --- Production stage ---
|
# --- Production stage ---
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ WORKDIR /app
|
|||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
COPY . ./
|
COPY . ./
|
||||||
COPY config.json_prod ./config.json
|
COPY config_prod.json ./config.json
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# --- Production stage ---
|
# --- Production stage ---
|
||||||
|
|||||||
79
Jenkinsfile
vendored
79
Jenkinsfile
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
def didRun = false
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
@@ -7,9 +9,8 @@ pipeline {
|
|||||||
|
|
||||||
environment {
|
environment {
|
||||||
REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/'
|
REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/'
|
||||||
IMAGE = 'tatort-app'
|
USER = 'jenkins'
|
||||||
USER = 'jared'
|
TOKEN = credentials('JenkinsGitea')
|
||||||
TOKEN = credentials('c661e484bb4f032f8a0a5b02cda6f3344ca584b5')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parameters {
|
parameters {
|
||||||
@@ -29,47 +30,55 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Install Dependencies') {
|
stage('Install Dependencies') {
|
||||||
steps {
|
steps {
|
||||||
|
script {
|
||||||
|
didRun = true
|
||||||
|
}
|
||||||
sh 'npm ci'
|
sh 'npm ci'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Test & Security Audit') {
|
stage('Test & Security Audit') {
|
||||||
steps {
|
steps {
|
||||||
|
script {
|
||||||
|
didRun = true
|
||||||
|
}
|
||||||
echo 'Start checking security vulnerabilities in npm packages'
|
echo 'Start checking security vulnerabilities in npm packages'
|
||||||
sh 'npm audit'
|
sh 'npm audit --audit-level=moderate'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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')
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// stage('Build') {
|
post {
|
||||||
// when {
|
success {
|
||||||
// branch 'development'
|
script {
|
||||||
// }
|
if (didRun) {
|
||||||
// steps {
|
echo 'Pipeline erfolgreich!'
|
||||||
// sh 'npm run build'
|
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'
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
// stage('Push image in gitea registry') {
|
failure {
|
||||||
// steps {
|
script {
|
||||||
// echo 'Start Pushing'
|
if (didRun) {
|
||||||
// script {
|
echo 'Pipeline fehlgeschlagen!'
|
||||||
// docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') {
|
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'
|
||||||
// docker.build('innohub/tatort-app').push('latest')
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// post {
|
|
||||||
// success {
|
|
||||||
// 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 {
|
|
||||||
// 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": {
|
"jwt": {
|
||||||
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",
|
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",
|
||||||
"expiresIn": 36000
|
"expiresIn": 3600
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"admin": { "password": "A-InnoHUB_2025!", "admin": true },
|
"admin": { "password": "A-InnoHUB_2025!", "admin": true },
|
||||||
"user": { "password": "U-InnoHUB_2025!", "admin": false }
|
"user": { "password": "U-InnoHUB_2025!", "admin": false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user