Files
talk/scripts/docker.sh
T
Wyatt Johnson df57b4eb17 [next] Email (#2261)
* feat: suspending, banning, now propogation

* feat: added email rendering + localization support

* fix: fix related to lib

* refactor: moved juicer to queue task

* refactor: cleanup of job processor

* refactor: improved error messaging around failed email

* feat: initial forgot passwor impl

* fix: fixed rebase errors

* feat: send back Content-Language header with requests

* feat: added ban email

* feat: implemented forgotten password API

* fix: linting

* feat: support more emails

* fix: promise patches

* feat: initial confirm email API

* feat: added rate limiting

* feat: added URL support

* feat: added email docs

* fix: updated docs

* chore: documentation review

* fix: fixed build bug

* feat: implement forgot password in auth popup

* test: add tests + fixes

* chore: rename StatelessComponent to FunctionComponent

* fix: types and test fixes

* chore: upgrade deps

* fix: THANK YOU TESTS FOR SAVING MY A**

* chore: reorder imports

* chore: remove obsolete !

* feat: implement accounts bundle

* refactor: review suggestion

* fix: rebase upgrade error

* fix: rebase bug

* feat: reset password link support

* test: add tests for account password reset page

* fix: remove redirect uri

* fix: revert local state changes
2019-05-09 22:54:56 +02:00

91 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
set -e
# Inspired by https://segment.com/blog/ci-at-segment/
deploy_tag() {
# Find our individual versions from the tags. If the tag contains prerelease
# tag, it will fall back to the next step which will just tag it as is. For
# Example:
#
# v5.0.0-beta.1 will be tagged with 5.0.0-beta.1
# v5.0.0 will be tagged with 5, 5.0, 5.0.0
#
if [[ -n "$(echo $CIRCLE_TAG | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$')" ]]
then
major=$(echo ${CIRCLE_TAG/#v} | cut -d. -f1)
minor=$(echo ${CIRCLE_TAG/#v} | cut -d. -f2)
patch=$(echo ${CIRCLE_TAG/#v} | cut -d. -f3)
major_version_tag=$major
minor_version_tag=$major.$minor
patch_version_tag=$major.$minor.$patch
tag_list="$major_version_tag $minor_version_tag $patch_version_tag"
else
tag_list=${CIRCLE_TAG/#v}
fi
# Tag the new image with major, minor and patch version tags.
for version in $tag_list
do
echo "==> tagging $version"
docker tag coralproject/talk:latest coralproject/talk:$version
done
# Push each of the tags to dockerhub, including latest
for version in $tag_list
do
echo "==> pushing $version"
docker push coralproject/talk:$version
done
}
deploy_latest() {
echo "==> pushing latest"
docker push coralproject/talk:latest
}
deploy_branch() {
echo "==> tagging branch $CIRCLE_BRANCH"
docker tag coralproject/talk:latest coralproject/talk:$CIRCLE_BRANCH
echo "==> pushing branch $CIRCLE_BRANCH"
docker push coralproject/talk:$CIRCLE_BRANCH
}
ARGS=""
if [[ -n "$CIRCLE_SHA1" ]]
then
ARGS="--build-arg REVISION_HASH=${CIRCLE_SHA1}"
fi
# build the repo, including the onbuild tagged versions.
docker build -t coralproject/talk:latest ${ARGS} -f Dockerfile .
if [ "$1" = "deploy" ]
then
if [[ -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]]
then
# Log the Docker Daemon in
docker login -u $DOCKER_USER -p $DOCKER_PASS
fi
# deploy based on the env
if [ -n "$CIRCLE_TAG" ]
then
deploy_tag
else
if [ "$CIRCLE_BRANCH" = "master" ]
then
deploy_latest
else
deploy_branch
fi
fi
fi