Compare commits

..

15 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
3 changed files with 34 additions and 52 deletions

View File

@@ -1,4 +0,0 @@
{
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"],
"unwantedRecommendations": []
}

11
.vscode/launch.json vendored
View File

@@ -1,11 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}

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"
}