redash/.circleci/docker_build
Arik Fraimovich 8907a86e33
Make frontend build in Docker image optional (#4879)
* Add build arg to Dockerfile to control if we should build frontend assets

* Move more env settings into the shared one.

* Use build arg in docker-compose to skip frontend build.

* CirlceCI: Skip building frontend assets in backend tests

* Create dummy template files

* Expand file names manually.

* Add build arg to skip dev dependencies.

* Update Dockerfile

* Reverse logic of skip_dev_deps to what it should be.
2020-05-12 16:46:53 +03:00

17 lines
558 B
Bash
Executable File

#!/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 --build-arg skip_dev_deps=true -t redash/redash:preview -t redash/preview:$VERSION_TAG .
docker push redash/redash:preview
docker push redash/preview:$VERSION_TAG
else
docker build --build-arg skip_dev_deps=true -t redash/redash:$VERSION_TAG .
docker push redash/redash:$VERSION_TAG
fi
echo "Built: $VERSION_TAG"