Compare commits

..

27 Commits

Author SHA1 Message Date
da8cbc96b5 fix(jenkins): new docker host rootless
All checks were successful
Portfolio/pipeline/head This commit looks good
2026-01-27 19:13:34 +00:00
f1794abe7e fix(jenkins): fix lighthouse audit launch in jenkinsfile
All checks were successful
Portfolio/pipeline/head This commit looks good
2026-01-12 19:03:20 +01:00
351256483f refactor(lighthouse): lighthouse local use same docker compose as jenkins 2026-01-12 19:03:20 +01:00
db7e655d4f perf(docker): add npm cache 2026-01-12 19:03:20 +01:00
952c75127a fix(lighthouse): change audit export path and config 2026-01-12 19:03:20 +01:00
fa8e84514a fix(lighthouse): switch to docker volumes 2026-01-12 19:01:53 +01:00
473bd7b05d fix(lighthouse): add mandatory publishHTML setting 2026-01-12 18:35:39 +01:00
31df2769a3 ci(lighthouse): add jenkins lighthouse automated audit 2026-01-12 18:35:39 +01:00
c01a5e2ef5 ci(lighthouse): add local lighthouse audit 2026-01-12 18:35:39 +01:00
ac96a7ce44 chore(git): ignore .vscode folder 2026-01-12 18:35:39 +01:00
64ca235045 chore(git): install husky and commitlint 2026-01-12 18:35:39 +01:00
81737767ee fix(check): missing dependance 2026-01-12 18:35:12 +01:00
02a0d694a1 fix(eslintrc): switch to new config name after update 2026-01-12 18:34:17 +01:00
8ede8ea80b feat(jenkins): deploy lint and check in dockerfile 2026-01-12 18:33:39 +01:00
00e6ba3454 feat(jenkins): manage node version 2026-01-12 18:32:45 +01:00
2823b903d4 test(astro): try to deploy a astro modification 2026-01-12 18:32:19 +01:00
54f4372629 feat(jenkins): manage portfolio version, caddy version and cache 2026-01-12 18:31:43 +01:00
a996ae9c7e fix(jenkins): use docker volume after new permission issues 2026-01-12 18:30:49 +01:00
fb50111261 fix(jenkins): adapt safety path to docker rootless 2026-01-12 18:30:22 +01:00
405a91f45d fix(jenkins): use docker cp for permission issue 2026-01-12 18:29:37 +01:00
143371da4b ci(docker): add docker compose and Caddyfile copy on server for safety 2026-01-12 18:28:25 +01:00
152b710fb8 ci(jenkins): switch to multibranch pipe 2026-01-12 18:28:09 +01:00
ae865f48e0 test(jenkins): try to modify astro to test pipe 2026-01-12 18:27:43 +01:00
25b5a43074 perf(jenkins): disable astro telemetry and add pnpm cache 2026-01-12 18:27:09 +01:00
24651d3d1d fix(ci): jenkinsfile error and docker host env 2026-01-12 18:25:56 +01:00
bc87636686 ci(jenkins): add Jenkinsfile 2026-01-12 18:25:45 +01:00
38426b6fff feat(docker): add initial Dockerfile 2026-01-12 18:25:34 +01:00

71
Jenkinsfile vendored
View File

@@ -1,8 +1,9 @@
pipeline {
agent any
environment {
DOCKER_HOST = "unix:///var/run/docker.sock"
DOCKER_HOST = "unix:///run/user/1001/docker.sock"
APP_VERSION = "${env.BRANCH_NAME}-${env.BUILD_NUMBER}"
DOCKER_CONFIG = "${env.WORKSPACE}/.docker"
}
stages {
stage('Build') {
@@ -16,35 +17,35 @@ pipeline {
sh "docker compose build"
}
}
stage('Lighthouse Audit') {
steps {
// stage('Lighthouse Audit') {
// steps {
// Create volumes but no run with safety
sh "docker rm -f audit-tmp lighthouse-audit || true"
sh "docker compose --profile audit create --no-build --remove-orphans lighthouse-audit"
// // Create volumes but no run with safety
// sh "docker rm -f audit-tmp lighthouse-audit || true"
// sh "docker compose --profile audit create --no-build --remove-orphans lighthouse-audit"
// Extract astro data from temp container to tmp-dist folder
sh "docker create --name audit-tmp portfolio:${env.APP_VERSION}"
sh "mkdir -p ./tmp-dist"
sh "docker cp audit-tmp:/usr/share/caddy/. ./tmp-dist"
sh "docker rm -f audit-tmp"
// // Extract astro data from temp container to tmp-dist folder
// sh "docker create --name audit-tmp portfolio:${env.APP_VERSION}"
// sh "mkdir -p ./tmp-dist"
// sh "docker cp audit-tmp:/usr/share/caddy/. ./tmp-dist"
// sh "docker rm -f audit-tmp"
// Inject data from tmp-dist and config to audit container
sh "docker cp ./tmp-dist/. lighthouse-audit:/app/dist/"
sh "docker cp .lighthouserc.cjs lighthouse-audit:/app/dist/audit-config.cjs"
sh "rm -rf ./tmp-dist"
// // Inject data from tmp-dist and config to audit container
// sh "docker cp ./tmp-dist/. lighthouse-audit:/app/dist/"
// sh "docker cp .lighthouserc.cjs lighthouse-audit:/app/dist/audit-config.cjs"
// sh "rm -rf ./tmp-dist"
// Now run
sh "docker start -a lighthouse-audit"
// // Now run
// sh "docker start -a lighthouse-audit"
// Get reports
sh "mkdir -p ./.lighthouseci"
sh "docker cp lighthouse-audit:/app/.lighthouseci/. ./.lighthouseci/"
// // Get reports
// sh "mkdir -p ./.lighthouseci"
// sh "docker cp lighthouse-audit:/app/.lighthouseci/. ./.lighthouseci/"
// Clean
sh "docker rm -f lighthouse-audit"
}
}
// // Clean
// sh "docker rm -f lighthouse-audit"
// }
// }
stage('Deploy') {
// Deploy only master branch
when {
@@ -56,24 +57,20 @@ pipeline {
// Update caddy-reverse-proxy cache
sh "docker exec caddy-reverse-proxy caddy reload --config /etc/caddy/Caddyfile"
// Keep updated docker-compose.yml and Caddyfile for safety
sh "cp docker-compose.yml /backup-portfolio/docker-compose.yml"
sh "docker cp portfolio:/etc/caddy/Caddyfile /backup-portfolio/Caddyfile"
}
}
}
post {
always {
echo "Publish Lighthouse audit..."
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: false,
reportDir: '.lighthouseci',
reportFiles: '*.html',
reportName: 'Lighthouse Report'
])
// echo "Publish Lighthouse audit..."
// publishHTML([
// allowMissing: true,
// alwaysLinkToLastBuild: true,
// keepAll: false,
// reportDir: '.lighthouseci',
// reportFiles: '*.html',
// reportName: 'Lighthouse Report'
// ])
echo "Clean unused image"
sh "docker image prune -f"
}