mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 17:15:17 +00:00
CircleCI build improvements (#3511)
* Make sure master builds tarball/docker image only when backend and frontend tests pass. * Build a redash/preview image alongside redash/redash image. * Fix version variable
This commit is contained in:
parent
549f878c98
commit
a93741e64b
@ -96,9 +96,7 @@ jobs:
|
||||
- setup_remote_docker
|
||||
- checkout
|
||||
- run: .circleci/update_version
|
||||
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
||||
- run: docker build -t redash/redash:$(.circleci/docker_tag) .
|
||||
- run: docker push redash/redash:$(.circleci/docker_tag)
|
||||
- run: .circleci/docker_build
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
@ -109,21 +107,23 @@ workflows:
|
||||
- frontend-unit-tests
|
||||
- frontend-e2e-tests
|
||||
- build-tarball:
|
||||
requires:
|
||||
- backend-unit-tests
|
||||
filters:
|
||||
tags:
|
||||
only: /v[0-9]+(\.[0-9\-a-z]+)*/
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /release\/.*/
|
||||
requires:
|
||||
- backend-unit-tests
|
||||
- frontend-unit-tests
|
||||
- frontend-e2e-tests
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /release\/.*/
|
||||
- build-docker-image:
|
||||
requires:
|
||||
- backend-unit-tests
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- preview-build
|
||||
- /release\/.*/
|
||||
requires:
|
||||
- backend-unit-tests
|
||||
- frontend-unit-tests
|
||||
- frontend-e2e-tests
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- preview-image
|
||||
- /release\/.*/
|
||||
|
17
.circleci/docker_build
Executable file
17
.circleci/docker_build
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
VERSION=$(jq -r .version package.json)
|
||||
VERSION_TAG=$VERSION.b$CIRCLE_BUILD_NUM
|
||||
|
||||
docker login -u $DOCKER_USER -p $DOCKER_PASS
|
||||
|
||||
if [ $CIRCLE_BRANCH = master ] || [ $CIRCLE_BRANCH = preview-image ]
|
||||
then
|
||||
docker build -t redash/redash:preview -t redash/preview:$VERSION_TAG .
|
||||
docker push redash/redash:preview
|
||||
docker push redash/preview:$VERSION_TAG
|
||||
else
|
||||
docker build -t redash/redash:$VERSION_TAG .
|
||||
docker push redash/redash:$VERSION_TAG
|
||||
fi
|
||||
|
||||
echo "Built: $VERSION_TAG"
|
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $CIRCLE_BRANCH = master ] || [ $CIRCLE_BRANCH = preview-build ]
|
||||
then
|
||||
FULL_VERSION='preview'
|
||||
else
|
||||
VERSION=$(jq -r .version package.json)
|
||||
FULL_VERSION=$VERSION.b$CIRCLE_BUILD_NUM
|
||||
fi
|
||||
|
||||
echo $FULL_VERSION
|
Loading…
Reference in New Issue
Block a user