Compare commits
27 Commits
52e55c569e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| da8cbc96b5 | |||
| f1794abe7e | |||
| 351256483f | |||
| db7e655d4f | |||
| 952c75127a | |||
| fa8e84514a | |||
| 473bd7b05d | |||
| 31df2769a3 | |||
| c01a5e2ef5 | |||
| ac96a7ce44 | |||
| 64ca235045 | |||
| 81737767ee | |||
| 02a0d694a1 | |||
| 8ede8ea80b | |||
| 00e6ba3454 | |||
| 2823b903d4 | |||
| 54f4372629 | |||
| a996ae9c7e | |||
| fb50111261 | |||
| 405a91f45d | |||
| 143371da4b | |||
| 152b710fb8 | |||
| ae865f48e0 | |||
| 25b5a43074 | |||
| 24651d3d1d | |||
| bc87636686 | |||
| 38426b6fff |
4
.vscode/extensions.json
vendored
4
.vscode/extensions.json
vendored
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"],
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
11
.vscode/launch.json
vendored
11
.vscode/launch.json
vendored
@@ -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
71
Jenkinsfile
vendored
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user