Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

gitflow-feature-stash: auto_deploy_live #52

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inform_staging() {
}

deploy(){
SYSTEM=$1 # [staging, test, demo]
SYSTEM=$1 # [staging.schul-cloud.org, test.schul-cloud.org, demo.schul-cloud.org, ....]

DOCKER_IMAGE=$2 # (editor), autoprefixed with "schulcloud-"
DOCKER_TAG=$3 # version/tag of the image to use. Usually the branch name or a GIT_SHA
Expand All @@ -35,7 +35,7 @@ deploy(){
echo "deploy " $DOCKER_IMAGE ":" $DOCKER_TAG " to " $SYSTEM " as " $DOCKER_SERVICE_NAME

# deploy new dockerfile
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i travis_rsa linux@$SYSTEM.schul-cloud.org /usr/bin/docker service update --force --image schulcloud/schulcloud-$DOCKER_IMAGE:$DOCKER_TAG $DOCKER_SERVICE_NAME
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i travis_rsa linux@$SYSTEM /usr/bin/docker service update --force --image schulcloud/schulcloud-$DOCKER_IMAGE:$DOCKER_TAG $DOCKER_SERVICE_NAME
}

# ----------------
Expand All @@ -61,16 +61,19 @@ case "$TRAVIS_BRANCH" in

master)
inform_live
echo "master"
deploy "schul-cloud.org" "editor" $DOCKERTAG "SC_editor"
deploy "niedersachsen.cloud" "editor" $DOCKERTAG "NBC_editor"
;;

develop)
echo "develop"
# deploy $SYSTEM $DOCKERFILE $DOCKERTAG $DOCKER_SERVICENAME $COMPOSE_DUMMY $COMPOSE_FILE $COMPOSE_SERVICENAME
deploy "test" "editor" $DOCKERTAG "test-schul-cloud_editor"
deploy "test.schul-cloud.org" "editor" $DOCKERTAG "test-schul-cloud_editor"
;;
release* | hotfix*)
echo "release/hotfix"
deploy "staging" "editor" $DOCKERTAG "staging_editor"
deploy "staging.schul-cloud.org" "editor" $DOCKERTAG "staging_editor"
;;
esac

Expand Down