Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
read sha from file
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg committed Apr 26, 2021
1 parent 78dd05b commit 14b13bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
15 changes: 6 additions & 9 deletions common/project.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
module.exports = global.Project = {
api: 'https://api.flagsmith.com/api/v1/',
api: 'https://api-dev.flagsmith.com/api/v1/',
flagsmithClientAPI: 'https://api.flagsmith.com/api/v1/',
flagsmith: '4vfqhypYjcPoGGu8ByrBaj', // This is our Bullet Train API key - Bullet Train runs on Bullet Train!
env: 'prod', // This is used for Sentry tracking
sentry: 'https://[email protected]/5666694',
maintenance: false, // trigger maintenance mode
cookieDomain: '.flagsmith.com',
excludeAnalytics: '[email protected]',
flagsmith: '8KzETdDeMY7xkqkSkY3Gsg', // This is our Bullet Train API key - Bullet Train runs on Bullet Train!
debug: false,
delighted: true, // determines whether to shw delighted feedback widget
env: 'dev', // This is used for Sentry tracking
maintenance: false, // trigger maintenance mode
demoAccount: {
email: '[email protected]',
password: 'demo_account',
},
chargebee: {
site: 'flagsmith',
site: 'flagsmith-test',
},
assetUrl: 'https://cdn.flagsmith.com', // Location of the static files from build/, should contain a directory called static/
};
7 changes: 7 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ require('dotenv').config();
const bodyParser = require('body-parser');
const exphbs = require('express-handlebars');
const express = require('express');
const fs = require('fs');
const path = require('path');
const Project = require('../common/project');

const postToSlack = Project.env === 'prod';
Expand Down Expand Up @@ -39,12 +41,17 @@ app.get('/static/project-overrides.js', (req, res) => {
return ` ${name}: '${value}',
`;
};
let sha = '';
if (fs.existsSync(path.join(__dirname, 'CI_COMMIT_SHA'))) {
sha = fs.readFileSync(path.join(__dirname, 'CI_COMMIT_SHA'));
}

const values = [
{ name: 'preventSignup', value: process.env.PREVENT_SIGNUP },
{ name: 'flagsmith', value: process.env.FLAGSMITH },
{ name: 'ga', value: process.env.GA },
{ name: 'crispChat', value: process.env.CRISP_CHAT },
{ name: 'sha', value: sha },
{ name: 'mixpanel', value: process.env.MIXPANEL },
{ name: 'sentry', value: process.env.SENTRY },
{ name: 'api', value: process.env.PROXY_API_URL ? '/api/v1/' : process.env.API_URL },
Expand Down

0 comments on commit 14b13bf

Please sign in to comment.