From bfbfd670f4bcc858809224442a590bc568f71adb Mon Sep 17 00:00:00 2001 From: Alexis Pentori Date: Thu, 1 Feb 2024 09:51:54 +0100 Subject: [PATCH] jenkins: adding Strapi variable Signed-off-by: Alexis Pentori --- Dockerfile | 5 +++++ Jenkinsfile | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Dockerfile b/Dockerfile index f1c137e..7822ec1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,11 @@ ARG UNBODY_PROJECT_ID ARG UNBODY_API_KEY ARG SIMPLECAST_ACCESS_TOKEN ARG REVALIDATE_WEBHOOK_TOKEN +ARG STRAPI_API_KEY +# Strapi URL +ARG STRAPI_API_URL +ARG STRAPI_GRAPHQL_URL +ARG NEXT_PUBLIC_ASSETS_BASE_URL ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 diff --git a/Jenkinsfile b/Jenkinsfile index 082dc2f..800aaa8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,21 @@ pipeline { defaultValue: params.IMAGE_TAG ?: '', description: 'Optional Docker image tag to push.' ) + string( + name: 'STRAPI_API_URL', + description: 'URL of Strapi API', + defaultValue: params.STRAPI_API_URL ?: 'https://cms-press.logos.co/api', + ) + string( + name: 'STRAPI_GRAPHQL_URL', + description: 'URL of Strapi GraphQL API', + defaultValue: params.STRAPI_GRAPHQL_URL ?: 'https://cms-press.logos.co/graphql', + ) + string( + name: 'NEXT_PUBLIC_ASSETS_BASE_URL', + description: 'URL for public assets', + defaultValue: params.NEXT_PUBLIC_ASSETS_BASE_URL ?: 'https://cms-press.logos.co', + ) } options { @@ -40,6 +55,10 @@ pipeline { credentialsId: 'logos-press-engine-webhook-token', variable: 'REVALIDATE_WEBHOOK_TOKEN' ), + string( + credentialsId: 'logos-press-engine-strapi-api-key', + variable: 'STRAPI_API_KEY' + ), ]) { image = docker.build( "${IMAGE_NAME}:${GIT_COMMIT.take(8)}", @@ -47,6 +66,10 @@ pipeline { "--build-arg='UNBODY_API_KEY=${env.UNBODY_API_KEY}'", "--build-arg='SIMPLECAST_ACCESS_TOKEN=${SIMPLECAST_ACCESS_TOKEN}'", "--build-arg='REVALIDATE_WEBHOOK_TOKEN=${REVALIDATE_WEBHOOK_TOKEN}'", + "--build-arg='STRAPI_API_URL=${params.STRAPI_API_URL}'", + "--build-arg='STRAPI_GRAPHQL_URL=${params.STRAPI_GRAPHQL_URL}'", + "--build-arg='NEXT_PUBLIC_ASSETS_BASE_URL=${params.NEXT_PUBLIC_ASSETS_BASE_URL}'", + "--build-arg='STRAPI_API_KEY=${STRAPI_API_KEY}'", "."].join(' ') ) }