Remove version definition from the application and pass it on build time

This commit is contained in:
ErickSkrauch 2018-03-17 19:13:12 +03:00
parent 5a8c2641c1
commit b743cc69aa
2 changed files with 14 additions and 2 deletions

View File

@ -61,10 +61,22 @@ test:frontend:
build:production: build:production:
image: docker:latest image: docker:latest
stage: build stage: build
variables:
GA_ID: "UA-45299905-3"
SENTRY_CDN: "https://088e7718236a4f91937a81fb319a93f6@sentry.ely.by/2"
before_script: before_script:
- docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by - docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by
- export VERSION="${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA:0:7}}"
- echo "$SSH_PRIVATE_KEY" > id_rsa - echo "$SSH_PRIVATE_KEY" > id_rsa
- echo "$FRONTEND_ENV_CONFIG" > frontend/config/env.js - |
echo "
module.exports = {
version: '$VERSION',
ga: {id: '$GA_ID'},
sentryCdn: "$SENTRY_CDN",
};
" > frontend/config/env.js
- sed -i '' -e 's/{{PLACE_VERSION_HERE}}/$VERSION/g' common/config/config.php
script: script:
- export IMAGE_NAME="$CONTAINER_IMAGE:latest" - export IMAGE_NAME="$CONTAINER_IMAGE:latest"
- docker build --pull -t $IMAGE_NAME . - docker build --pull -t $IMAGE_NAME .

View File

@ -1,6 +1,6 @@
<?php <?php
return [ return [
'version' => '1.1.25-dev', 'version' => '{{PLACE_VERSION_HERE}}', // This will be replaced by build tool
'vendorPath' => dirname(__DIR__, 2) . '/vendor', 'vendorPath' => dirname(__DIR__, 2) . '/vendor',
'components' => [ 'components' => [
'cache' => [ 'cache' => [