update
This commit is contained in:
17
Jenkinsfile
vendored
17
Jenkinsfile
vendored
@@ -1,6 +1,7 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
// Build + deploy stages require Docker CLI/daemon access on the Jenkins node.
|
// Build + deploy stages require Docker CLI/daemon access on the Jenkins node.
|
||||||
// Ensure this label maps to an agent with Docker installed and usable.
|
// Ensure this label maps to an agent with Docker installed and usable.
|
||||||
|
//update
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
@@ -12,8 +13,6 @@ pipeline {
|
|||||||
APP_USER = "${env.APP_USER ?: 'deploy'}"
|
APP_USER = "${env.APP_USER ?: 'deploy'}"
|
||||||
DEPLOY_PATH = "${env.DEPLOY_PATH ?: '/opt/plesk-agency-portal'}"
|
DEPLOY_PATH = "${env.DEPLOY_PATH ?: '/opt/plesk-agency-portal'}"
|
||||||
APP_BASE_URL = "${env.APP_BASE_URL ?: 'http://192.168.68.89:3000'}"
|
APP_BASE_URL = "${env.APP_BASE_URL ?: 'http://192.168.68.89:3000'}"
|
||||||
NEXT_PUBLIC_SUPABASE_URL = "${env.NEXT_PUBLIC_SUPABASE_URL ?: ''}"
|
|
||||||
NEXT_PUBLIC_SUPABASE_ANON_KEY = "${env.NEXT_PUBLIC_SUPABASE_ANON_KEY ?: ''}"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,13 +63,23 @@ pipeline {
|
|||||||
|
|
||||||
stage('Build application') {
|
stage('Build application') {
|
||||||
steps {
|
steps {
|
||||||
sh 'npm run build'
|
withCredentials([
|
||||||
|
string(credentialsId: 'supabase-public-url', variable: 'NEXT_PUBLIC_SUPABASE_URL'),
|
||||||
|
string(credentialsId: 'supabase-public-anon-key', variable: 'NEXT_PUBLIC_SUPABASE_ANON_KEY')
|
||||||
|
]) {
|
||||||
|
sh 'npm run build'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build Docker image') {
|
stage('Build Docker image') {
|
||||||
steps {
|
steps {
|
||||||
sh 'docker build --build-arg NEXT_PUBLIC_SUPABASE_URL="${NEXT_PUBLIC_SUPABASE_URL}" --build-arg NEXT_PUBLIC_SUPABASE_ANON_KEY="${NEXT_PUBLIC_SUPABASE_ANON_KEY}" -t ${IMAGE_LATEST} -t ${IMAGE_BUILD} .'
|
withCredentials([
|
||||||
|
string(credentialsId: 'supabase-public-url', variable: 'NEXT_PUBLIC_SUPABASE_URL'),
|
||||||
|
string(credentialsId: 'supabase-public-anon-key', variable: 'NEXT_PUBLIC_SUPABASE_ANON_KEY')
|
||||||
|
]) {
|
||||||
|
sh 'docker build --build-arg NEXT_PUBLIC_SUPABASE_URL="$NEXT_PUBLIC_SUPABASE_URL" --build-arg NEXT_PUBLIC_SUPABASE_ANON_KEY="$NEXT_PUBLIC_SUPABASE_ANON_KEY" -t ${IMAGE_LATEST} -t ${IMAGE_BUILD} .'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user