Merged in chore/release-pipeline (pull request #3352)
Add scripts for handling deployments Approved-by: Linus Flood
This commit is contained in:
2
apps/partner-sas/env/client.ts
vendored
2
apps/partner-sas/env/client.ts
vendored
@@ -5,11 +5,13 @@ export const env = createEnv({
|
||||
client: {
|
||||
NEXT_PUBLIC_SENTRY_ENVIRONMENT: z.string().default("development"),
|
||||
NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE: z.coerce.number().default(0.001),
|
||||
NEXT_PUBLIC_RELEASE_TAG: z.string().optional(),
|
||||
},
|
||||
emptyStringAsUndefined: true,
|
||||
runtimeEnv: {
|
||||
NEXT_PUBLIC_SENTRY_ENVIRONMENT: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
|
||||
NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE:
|
||||
process.env.NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE,
|
||||
NEXT_PUBLIC_RELEASE_TAG: process.env.NEXT_PUBLIC_RELEASE_TAG,
|
||||
},
|
||||
})
|
||||
|
||||
2
apps/partner-sas/env/server.ts
vendored
2
apps/partner-sas/env/server.ts
vendored
@@ -36,6 +36,7 @@ export const env = createEnv({
|
||||
.refine((s) => s === "true" || s === "false")
|
||||
.transform((s) => s === "true")
|
||||
.default("false"),
|
||||
RELEASE_TAG: z.string().optional(),
|
||||
},
|
||||
emptyStringAsUndefined: true,
|
||||
runtimeEnv: {
|
||||
@@ -52,5 +53,6 @@ export const env = createEnv({
|
||||
SENTRY_ENVIRONMENT: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
|
||||
SENTRY_SERVER_SAMPLERATE: process.env.SENTRY_SERVER_SAMPLERATE,
|
||||
REDEMPTION_ENABLED: process.env.REDEMPTION_ENABLED,
|
||||
RELEASE_TAG: process.env.NEXT_PUBLIC_RELEASE_TAG,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -12,6 +12,7 @@ Sentry.init({
|
||||
denyUrls: denyUrls,
|
||||
// Disable logs for clients, will probably give us too much noise
|
||||
enableLogs: false,
|
||||
release: env.NEXT_PUBLIC_RELEASE_TAG || undefined,
|
||||
beforeSendLog(log) {
|
||||
const ignoredLevels: (typeof log.level)[] = ["debug", "trace", "info"]
|
||||
if (ignoredLevels.includes(log.level)) {
|
||||
|
||||
@@ -21,5 +21,6 @@ async function configureSentry() {
|
||||
tracesSampleRate: env.SENTRY_SERVER_SAMPLERATE,
|
||||
denyUrls: denyUrls,
|
||||
enableLogs: true,
|
||||
release: env.RELEASE_TAG || undefined,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[build]
|
||||
command = "yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas"
|
||||
command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas"
|
||||
publish = "apps/partner-sas/.next"
|
||||
|
||||
ignore = "if [ -z ${CACHED_COMMIT_REF+x} ] ; then echo 'no CACHED_COMMIT_REF found' && false ; else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF apps/partner-sas packages/booking-flow packages/common packages/trpc packages/design-system packages/typescript-config ; fi"
|
||||
|
||||
[context.branch-deploy]
|
||||
command = "yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas"
|
||||
command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas"
|
||||
|
||||
[context.deploy-preview]
|
||||
command = "yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas"
|
||||
command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas"
|
||||
|
||||
[build.environment]
|
||||
# set TERM variable for terminal output
|
||||
|
||||
@@ -27,11 +27,17 @@ export function EnvironmentWatermark() {
|
||||
}
|
||||
|
||||
const { environment, name } = getEnvironmentName()
|
||||
const displayValue = name === environment ? name : `${name} (${environment})`
|
||||
const displayValues = [name]
|
||||
if (name !== environment) {
|
||||
displayValues.push(`(${environment})`)
|
||||
}
|
||||
if (env.NEXT_PUBLIC_RELEASE_TAG) {
|
||||
displayValues.push(`[${env.NEXT_PUBLIC_RELEASE_TAG}]`)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={variants({ environment: environment })}>
|
||||
<span>{displayValue}</span>
|
||||
<span>{displayValues.join(" ")}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
2
apps/scandic-web/env/client.ts
vendored
2
apps/scandic-web/env/client.ts
vendored
@@ -8,6 +8,7 @@ export const env = createEnv({
|
||||
NEXT_PUBLIC_SENTRY_ENVIRONMENT: z.string().default("development"),
|
||||
NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE: z.coerce.number().default(0.001),
|
||||
NEXT_PUBLIC_PUBLIC_URL: z.string().optional(),
|
||||
NEXT_PUBLIC_RELEASE_TAG: z.string().optional(),
|
||||
},
|
||||
emptyStringAsUndefined: true,
|
||||
runtimeEnv: {
|
||||
@@ -17,5 +18,6 @@ export const env = createEnv({
|
||||
NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE:
|
||||
process.env.NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE,
|
||||
NEXT_PUBLIC_PUBLIC_URL: process.env.NEXT_PUBLIC_PUBLIC_URL,
|
||||
NEXT_PUBLIC_RELEASE_TAG: process.env.NEXT_PUBLIC_RELEASE_TAG,
|
||||
},
|
||||
})
|
||||
|
||||
2
apps/scandic-web/env/server.ts
vendored
2
apps/scandic-web/env/server.ts
vendored
@@ -112,6 +112,7 @@ export const env = createEnv({
|
||||
.refine((s) => s === "true" || s === "false")
|
||||
.transform((s) => s === "true")
|
||||
.default("false"),
|
||||
RELEASE_TAG: z.string().optional(),
|
||||
},
|
||||
emptyStringAsUndefined: true,
|
||||
runtimeEnv: {
|
||||
@@ -168,5 +169,6 @@ export const env = createEnv({
|
||||
NEW_STAYS_ON_MY_PAGES: process.env.NEW_STAYS_ON_MY_PAGES,
|
||||
SEO_INERT: process.env.SEO_INERT,
|
||||
ENABLE_PROFILE_CONSENT: process.env.ENABLE_PROFILE_CONSENT,
|
||||
RELEASE_TAG: process.env.NEXT_PUBLIC_RELEASE_TAG,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -12,6 +12,7 @@ Sentry.init({
|
||||
denyUrls: denyUrls,
|
||||
// Disable logs for clients, will probably give us too much noise
|
||||
enableLogs: false,
|
||||
release: env.NEXT_PUBLIC_RELEASE_TAG || undefined,
|
||||
beforeSendLog(log) {
|
||||
const ignoredLevels: (typeof log.level)[] = ["debug", "trace", "info"]
|
||||
if (ignoredLevels.includes(log.level)) {
|
||||
|
||||
@@ -22,5 +22,6 @@ async function configureSentry() {
|
||||
denyUrls: denyUrls,
|
||||
enableLogs: true,
|
||||
enableMetrics: true,
|
||||
release: env.RELEASE_TAG || undefined,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[build]
|
||||
command = "yarn test --filter=@scandic-hotels/scandic-web && yarn build:web"
|
||||
command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build:web"
|
||||
publish = "apps/scandic-web/.next"
|
||||
|
||||
ignore = "if [ -z ${CACHED_COMMIT_REF+x} ] ; then echo 'no CACHED_COMMIT_REF found' && false ; else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF apps/scandic-web packages/booking-flow packages/common packages/trpc packages/design-system packages/typescript-config ; fi"
|
||||
|
||||
[context.branch-deploy]
|
||||
command = "yarn test --filter=@scandic-hotels/scandic-web && yarn build:web"
|
||||
command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build:web"
|
||||
|
||||
[context.deploy-preview]
|
||||
command = "yarn test --filter=@scandic-hotels/scandic-web && yarn build:web"
|
||||
command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build:web"
|
||||
|
||||
[[plugins]]
|
||||
package = "@netlify/plugin-nextjs"
|
||||
|
||||
Reference in New Issue
Block a user