From fede2c3f8e398ea45a59ee23d02b200f3adcd64a Mon Sep 17 00:00:00 2001 From: Araozu Date: Mon, 7 Oct 2024 06:45:58 -0500 Subject: [PATCH] fix: add static files to jenkins pipeline --- Jenkinsfile | 15 ++++++++++++++- package.json | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3cc2a18..1258b14 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent any stages { - stage('Install') { + stage('Build go binary') { agent { docker { image 'golang:1.23-alpine' @@ -13,6 +13,19 @@ pipeline { sh 'go build main.go' } } + stage('Build static assets') { + agent { + docker { + image 'node:22' + reuseNode true + } + } + steps { + sh 'npm i -g pnpm' + sh 'pnpm i' + sh 'pnpm build' + } + } stage('Populate env') { steps { sh 'rm .env || true' diff --git a/package.json b/package.json index 1b68bdd..245bd95 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,9 @@ "description": "", "main": "main.go", "scripts": { - "dev": "concurrently 'air' 'tailwindcss -i ./public/css/input.css -o ./public/css/output.css --watch' 'templ generate --watch'", "air": "air", + "build": "tailwindcss -i ./public/css/input.css -o ./public/css/output.css --minify", + "dev": "concurrently 'air' 'tailwindcss -i ./public/css/input.css -o ./public/css/output.css --watch' 'templ generate --watch'", "tailwind:watch": "tailwindcss -i ./public/css/input.css -o ./public/css/output.css --watch", "tailwind:build": "tailwindcss -i ./public/css/input.css -o ./public/css/output.css --minify", "temple:watch": "templ generate --watch"