Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-matt-hillsdon committed Dec 5, 2023
1 parent d03e97d commit 13dc83d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions bin/print-ci-env.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@

const ref = process.env.GITHUB_REF;
let stage;
if (ref === "refs/heads/main") {
stage = "STAGING";
} else if (ref.startsWith("refs/tags/v")) {
stage = "PRODUCTION";
if (ref === 'refs/heads/main') {
stage = 'STAGING';
} else if (ref.startsWith('refs/tags/v')) {
stage = 'PRODUCTION';
} else {
stage = "REVIEW";
stage = 'REVIEW';
}

process.env.STAGE = stage;
// STAGE must be defined before this is imported
const { bucketName, bucketPrefix } = require("../deployment.cjs");
const baseUrl = !bucketPrefix ? "/" : `/${bucketPrefix}/`;
const { bucketName, bucketPrefix } = require('../deployment.cjs');
const baseUrl = !bucketPrefix ? '/' : `/${bucketPrefix}/`;
const fullUrl = `https://${bucketName}${baseUrl}`;

console.log(`STAGE=${stage}`);
console.log(`VITE_STAGE=${stage}`);
console.log(`BASE_URL=${baseUrl}`);
console.log(`E2E_BASE_URL=${baseUrl}`);
// This is used for og:url and similar. Not quite right for review domain but we don't really care.
// This can be used for og:url and similar. Not quite right for review domain but we don't really care.
console.log(`VITE_FULL_URL=${fullUrl}`);

0 comments on commit 13dc83d

Please sign in to comment.