From 0d3105fe7edd259ab41aa2df559dcf423dd10ff8 Mon Sep 17 00:00:00 2001 From: Kelly McDonald Date: Mon, 15 Jun 2020 12:32:19 -0400 Subject: [PATCH 1/3] Make changes to the workflow names so that they are placed in the correct order - I made workflows go in order of the name rather than in the order they appear in the XML to allow more control over the way the nav list is displayed. --- tests/data/exclusive_gateway/exclusive_gateway.bpmn | 10 +++++----- .../exclusive_gateway_2/exclusive_gateway_2.bpmn | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/data/exclusive_gateway/exclusive_gateway.bpmn b/tests/data/exclusive_gateway/exclusive_gateway.bpmn index 8467c954..1a3d2ddd 100644 --- a/tests/data/exclusive_gateway/exclusive_gateway.bpmn +++ b/tests/data/exclusive_gateway/exclusive_gateway.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1pnq3kg @@ -21,10 +21,10 @@ SequenceFlow_1lmkn99 - SequenceFlow_Yes_Bananas + SequenceFlow_A_Yes_Bananas SequenceFlow_No_Bananas - + has_bananas == True @@ -36,7 +36,7 @@ - SequenceFlow_Yes_Bananas + SequenceFlow_A_Yes_Bananas SequenceFlow_02z84p5 @@ -75,7 +75,7 @@ - + diff --git a/tests/data/exclusive_gateway_2/exclusive_gateway_2.bpmn b/tests/data/exclusive_gateway_2/exclusive_gateway_2.bpmn index c1709d77..7476de11 100644 --- a/tests/data/exclusive_gateway_2/exclusive_gateway_2.bpmn +++ b/tests/data/exclusive_gateway_2/exclusive_gateway_2.bpmn @@ -1,5 +1,5 @@ - + Flow_1ux3ndu @@ -8,13 +8,13 @@ Flow_1ut95vk Flow_1fok0lz - Flow_01he29w + Flow_21he29w which_branch == 'a' - + which_branch == 'b' @@ -52,7 +52,7 @@ - Flow_01he29w + Flow_21he29w Flow_0ozlczo @@ -88,12 +88,12 @@ - + - + From 706c4afda59915afeced403b77077c9b46532532 Mon Sep 17 00:00:00 2001 From: Kelly McDonald Date: Mon, 15 Jun 2020 12:33:51 -0400 Subject: [PATCH 2/3] Create a parameter 'lane' since we are using the output from the nav-list as the input to the NavigationItem initializer. NB - this doesn't do anything with the lane designation, it just keeps it from blowing up. --- crc/models/api_models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crc/models/api_models.py b/crc/models/api_models.py index b8b535a7..53706a75 100644 --- a/crc/models/api_models.py +++ b/crc/models/api_models.py @@ -16,7 +16,8 @@ class MultiInstanceType(enum.Enum): class NavigationItem(object): - def __init__(self, id, task_id, name, title, backtracks, level, indent, child_count, state, is_decision, task=None): + def __init__(self, id, task_id, name, title, backtracks, level, indent, child_count, state, is_decision, + task=None, lane=None): self.id = id self.task_id = task_id self.name = name, From 14d68f40df8cb979e8358912d3e35335088a6384 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Tue, 16 Jun 2020 11:09:48 -0400 Subject: [PATCH 3/3] Disables AWS SQS message to refresh DCOS --- .travis.yml | 4 ++-- deploy.sh | 49 +++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 568aecb7..ea5e18d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: - psql -c 'create database crc_test;' -U postgres install: - - pip install pipenv pytest coverage awscli + - pip install pipenv pytest coverage - export PATH=$PATH:$HOME/.local/bin; - pipenv install @@ -35,7 +35,7 @@ after_success: deploy: provider: script - script: bash deploy.sh + script: bash deploy.sh sartography/cr-connect-workflow skip_cleanup: true on: all_branches: true diff --git a/deploy.sh b/deploy.sh index a1c5da4b..04e3e81c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,44 +1,45 @@ #!/bin/bash +######################################################################### +# Builds the Docker image for the current git branch on Travis CI and +# publishes it to Docker Hub. +# +# Parameters: +# $1: Docker Hub repository to publish to +# +# Required environment variables (place in Settings menu on Travis CI): +# $DOCKER_USERNAME: Docker Hub username +# $DOCKER_TOKEN: Docker Hub access token +######################################################################### + +echo 'Building Docker image...' +DOCKER_REPO="$1" + function branch_to_tag () { - if [ "$1" == "latest" ]; then echo "production"; else echo "$1" ; fi + if [ "$1" == "master" ]; then echo "latest"; else echo "$1" ; fi } function branch_to_deploy_group() { if [[ $1 =~ ^(rrt\/.*)$ ]]; then echo "rrt"; else echo "crconnect" ; fi } -function branch_to_deploy_stage () { - if [ "$1" == "master" ]; then echo "production"; else echo "$1" ; fi -} +DOCKER_TAG=$(branch_to_tag "$TRAVIS_BRANCH") -REPO="sartography/cr-connect-workflow" -TAG=$(branch_to_tag "$TRAVIS_BRANCH") - -DEPLOY_APP="backend" DEPLOY_GROUP=$(branch_to_deploy_group "$TRAVIS_BRANCH") -DEPLOY_STAGE=$(branch_to_deploy_stage "$TRAVIS_BRANCH") if [ "$DEPLOY_GROUP" == "rrt" ]; then IFS='/' read -ra ARR <<< "$TRAVIS_BRANCH" # Split branch on '/' character - TAG=$(branch_to_tag "rrt_${ARR[1]}") - DEPLOY_STAGE=$(branch_to_deploy_stage "${ARR[1]}") + DOCKER_TAG=$(branch_to_tag "rrt_${ARR[1]}") fi -DEPLOY_PATH="$DEPLOY_GROUP/$DEPLOY_STAGE/$DEPLOY_APP" -echo "REPO = $REPO" -echo "TAG = $TAG" -echo "DEPLOY_PATH = $DEPLOY_PATH" +echo "DOCKER_REPO = $DOCKER_REPO" +echo "DOCKER_TAG = $DOCKER_TAG" -# Build and push Docker image to Docker Hub echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin || exit 1 -docker build -f Dockerfile -t "$REPO:$TAG" . || exit 1 -docker push "$REPO" || exit 1 +docker build -f Dockerfile -t "$DOCKER_REPO:$DOCKER_TAG" . || exit 1 -# Wait for Docker Hub + +# Push Docker image to Docker Hub echo "Publishing to Docker Hub..." -sleep 30 - -# Notify UVA DCOS that Docker image has been updated -echo "Refreshing DC/OS..." -aws sqs send-message --region "$AWS_DEFAULT_REGION" --queue-url "$AWS_SQS_URL" --message-body "$DEPLOY_PATH" || exit 1 +docker push "$DOCKER_REPO" || exit 1 +echo "Done."