jenkins: adding Strapi variable

Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
Alexis Pentori 2024-02-01 09:51:54 +01:00
parent 0b35b3881b
commit bfbfd670f4
No known key found for this signature in database
GPG Key ID: 65250D2801E47A10
2 changed files with 28 additions and 0 deletions

View File

@ -11,6 +11,11 @@ ARG UNBODY_PROJECT_ID
ARG UNBODY_API_KEY ARG UNBODY_API_KEY
ARG SIMPLECAST_ACCESS_TOKEN ARG SIMPLECAST_ACCESS_TOKEN
ARG REVALIDATE_WEBHOOK_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 NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1

23
Jenkinsfile vendored
View File

@ -7,6 +7,21 @@ pipeline {
defaultValue: params.IMAGE_TAG ?: '', defaultValue: params.IMAGE_TAG ?: '',
description: 'Optional Docker image tag to push.' 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 { options {
@ -40,6 +55,10 @@ pipeline {
credentialsId: 'logos-press-engine-webhook-token', credentialsId: 'logos-press-engine-webhook-token',
variable: 'REVALIDATE_WEBHOOK_TOKEN' variable: 'REVALIDATE_WEBHOOK_TOKEN'
), ),
string(
credentialsId: 'logos-press-engine-strapi-api-key',
variable: 'STRAPI_API_KEY'
),
]) { ]) {
image = docker.build( image = docker.build(
"${IMAGE_NAME}:${GIT_COMMIT.take(8)}", "${IMAGE_NAME}:${GIT_COMMIT.take(8)}",
@ -47,6 +66,10 @@ pipeline {
"--build-arg='UNBODY_API_KEY=${env.UNBODY_API_KEY}'", "--build-arg='UNBODY_API_KEY=${env.UNBODY_API_KEY}'",
"--build-arg='SIMPLECAST_ACCESS_TOKEN=${SIMPLECAST_ACCESS_TOKEN}'", "--build-arg='SIMPLECAST_ACCESS_TOKEN=${SIMPLECAST_ACCESS_TOKEN}'",
"--build-arg='REVALIDATE_WEBHOOK_TOKEN=${REVALIDATE_WEBHOOK_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(' ') "."].join(' ')
) )
} }