Open filippomc opened 3 years ago
Pure frontend strategy using env variables
Inside the Docker image:
RUN VERSION=$(grep version setup.py | sed 's/^.*version="//g' | sed 's/\",//g') &&\ npm run build --env.VERSION=$VERSION --env.COMMIT=$COMMIT
Inside the webpack:
module.exports = function (env){ if (env === undefined) { env = {} } if (!env.COMMIT) { env.COMMIT = 'x.x.x' } if (!env.VERSION) { env.VERSION = PACKAGE.version } ...
Then use the following to get version
const PRESENT_COMMIT = process.env.COMMIT; const PRESENT_VERSION = process.env.VERSION;
Pure frontend strategy using env variables
Inside the Docker image:
Inside the webpack:
Then use the following to get version