From b976b1672c291e87cb83e48004a4c991d7f55c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Czoma?= Date: Tue, 2 Jun 2020 19:48:38 +0200 Subject: [PATCH] Fixes deployment fail if create private subnet is not requested (#47) * Template code fix * Added automation coverage for this case --- .travis.yml | 17 ++++++++++++++++- templates/solace.template | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ab298c9..85ad22c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,13 +51,28 @@ script: - until curl http://$url:8080; do sleep 10; done - curl -O https://sftp.solace.com/download/SDKPERF_C_LINUX64 - tar -xvf SDKPERF_C_LINUX64 - - pubSubTools/sdkperf_c -cip=$url -mn=100000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages" - sleep 30 - curl -sS -u admin:admin http://$url:8080/SEMP -d "" - curl -sS -u admin:admin http://$url:8080/SEMP -d "" - bash -c 'if [[ -z `curl -sS -u admin:admin http://$url:8080/SEMP -d "" | grep "Up"` ]] ; then echo "config-sync not up!"; exit 1; fi' + - pubSubTools/sdkperf_c -cip=$url -mn=100000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages" + - aws cloudformation delete-stack --stack-name $TESTSTACKNAME + - echo "Waiting for stack delete complete" + - stackid="$(aws cloudformation describe-stacks --stack-name $TESTSTACKNAME | grep StackId | awk -F '"' '{print $4}')" + - if [ -n "$stackid" ]; then until aws cloudformation describe-stacks --stack-name $stackid | grep -m 1 "DELETE_COMPLETE"; do sleep 10; done; fi + - # Now test No Private Subnet + - export TESTSTACKNAME="$TESTSTACKNAME-1" + - sed -i "s@true@false@g" ci/solace-aws-ha-3az-prod-travistest.json + - aws cloudformation create-stack --stack-name $TESTSTACKNAME --template-body file://templates/solace-master.template --parameters file://ci/solace-aws-ha-3az-prod-travistest.json --on-failure DO_NOTHING --capabilities CAPABILITY_IAM + - echo "Waiting for stack create complete" + - "travis_wait 30 sleep 1800 &" + - until aws cloudformation describe-stacks --stack-name $TESTSTACKNAME | grep -m 1 -E 'CREATE_COMPLETE|DELETE_IN_PROGRESS'; do sleep 10; done + - aws cloudformation describe-stack-events --stack-name $TESTSTACKNAME + - aws cloudformation describe-stacks --stack-name $TESTSTACKNAME + - # This completes forming No Private Subnet + after_success: - echo "Test Success - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)" diff --git a/templates/solace.template b/templates/solace.template index bf7df15..de73b64 100644 --- a/templates/solace.template +++ b/templates/solace.template @@ -611,6 +611,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 55555 Protocol: TCP @@ -627,6 +628,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 55003 Protocol: TCP @@ -643,6 +645,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 55443 Protocol: TCP @@ -659,6 +662,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 1443 Protocol: TCP @@ -675,6 +679,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 8000 Protocol: TCP @@ -691,6 +696,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 5672 Protocol: TCP @@ -707,6 +713,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 9000 Protocol: TCP @@ -723,6 +730,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 1883 Protocol: TCP @@ -739,6 +747,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 8008 Protocol: TCP @@ -755,6 +764,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 8080 Protocol: TCP @@ -771,6 +781,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::TargetGroup DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: Port: 1943 Protocol: TCP @@ -787,6 +798,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -798,6 +810,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -809,6 +822,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -820,6 +834,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -831,6 +846,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -842,6 +858,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -853,6 +870,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -864,6 +882,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -875,6 +894,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -886,6 +906,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward @@ -897,6 +918,7 @@ Resources: Type: AWS::ElasticLoadBalancingV2::Listener DependsOn: - ELB + Condition: UsePrivateSubnetsCondition Properties: DefaultActions: - Type: forward