Skip to content

Commit

Permalink
Pass the build version is as part of the build
Browse files Browse the repository at this point in the history
  • Loading branch information
pgebheim committed Aug 6, 2020
1 parent 3731642 commit 81a45ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/augur-ui/config/webpack.common.config.js
Expand Up @@ -23,11 +23,12 @@ const PATHS = {
const AUGUR_ENV = process.env.AUGUR_ENV || process.env.ETHEREUM_NETWORK || 'local';
const config = buildConfig(AUGUR_ENV);

if(!process.env.CURRENT_COMMITHASH) {
if(!process.env.CURRENT_COMMITHASH || !process.env.CURRENT_VERSION) {
const gitRevisionPlugin = new GitRevisionPlugin({
branch: false
});
process.env.CURRENT_COMMITHASH = gitRevisionPlugin.commithash();
process.env.CURRENT_COMMITHASH = process.env.CURRENT_COMMITHASH || gitRevisionPlugin.commithash();
process.env.CURRENT_VERSION = process.env.CURRENT_VERSION || gitRevisionPlugin.version();
}

module.exports = {
Expand Down Expand Up @@ -237,6 +238,7 @@ module.exports = {
AUGUR_ENV: JSON.stringify(AUGUR_ENV),
AUTO_LOGIN: process.env.AUTO_LOGIN || false,
CURRENT_COMMITHASH: JSON.stringify(process.env.CURRENT_COMMITHASH),
CURRENT_VERSION: JSON.stringify(process.env.CURRENT_VERSION),
ETHEREUM_NETWORK: JSON.stringify(AUGUR_ENV),
IPFS_STABLE_LOADER_HASH: JSON.stringify(process.env.IPFS_STABLE_LOADER_HASH),

Expand Down
2 changes: 2 additions & 0 deletions support/Dockerfile
Expand Up @@ -15,6 +15,8 @@ RUN apk add --no-cache \
musl-dev \
openssl-dev

ARG CURRENT_VERSION
ENV CURRENT_VERSION=$CURRENT_VERSION
ARG CURRENT_COMMITHASH="COMMIT HASH NOT AVAILABLE"
ENV CURRENT_COMMITHASH=$CURRENT_COMMITHASH

Expand Down
1 change: 1 addition & 0 deletions support/build_image.sh
Expand Up @@ -13,5 +13,6 @@ yarn workspace orbit-web build;
docker build . \
-f support/Dockerfile \
--build-arg CURRENT_COMMITHASH="$(git rev-parse HEAD)" \
--build-arg CURRENT_VERSION=$VERSION
-t augurproject/augur:runner \
-t "augurproject/augur:v$VERSION";

0 comments on commit 81a45ed

Please sign in to comment.