Skip to content

Commit

Permalink
retry application deletion and some boyscouting
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsFronius committed Sep 27, 2018
1 parent f904d09 commit f688d83
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
8 changes: 4 additions & 4 deletions codeship-services.yml
Expand Up @@ -3,7 +3,7 @@ base:
image: codeship/aws-base
path: ./base
dockerfile_path: Dockerfile
deployment_ansible:
deployment-ansible:
build:
dockerfile: Dockerfile.ansible
encrypted_env_file: aws.env.encrypted
Expand All @@ -17,17 +17,17 @@ deployment:
encrypted_env_file: aws.env.encrypted
volumes:
- ./deployment:/deploy
dockercfg_generator:
dockercfg-generator:
build:
image: codeship/aws-ecr-dockercfg-generator
path: ./dockercfg-generator
dockerfile_path: Dockerfile
dockercfg_test:
dockercfg-test:
build:
image: 870119404647.dkr.ecr.us-east-1.amazonaws.com/codeship-testing
path: ./dockercfg-generator
dockerfile_path: Dockerfile.test
dockercfg_test_generator:
dockercfg-test-generator:
image: codeship/aws-ecr-dockercfg-generator
add_docker: true
encrypted_env_file: aws.env.encrypted
8 changes: 4 additions & 4 deletions codeship-steps.yml
Expand Up @@ -3,7 +3,7 @@
command: true
- name: Test Deployment Ansible
type: serial
service: deployment_ansible
service: deployment-ansible
steps:
- name: Check for tooling Ansible
command: /deploy/test/test_tools_available.sh
Expand Down Expand Up @@ -47,11 +47,11 @@
- name: Code Deploy
command: /deploy/test/code_deploy/integration-test
- name: Test dockercfg Generator
service: dockercfg_test
service: dockercfg-test
type: push
image_name: 870119404647.dkr.ecr.us-east-1.amazonaws.com/codeship-testing
registry: https://870119404647.dkr.ecr.us-east-1.amazonaws.com
dockercfg_service: dockercfg_test_generator
dockercfg_service: dockercfg-test-generator
- name: Deploy (to Docker Hub)
type: serial
steps:
Expand All @@ -62,7 +62,7 @@
image_name: codeship/aws-deployment
encrypted_dockercfg_path: dockercfg.encrypted
- name: Push dockercfg Generator
service: dockercfg_generator
service: dockercfg-generator
tag: master
type: push
image_name: codeship/aws-ecr-dockercfg-generator
Expand Down
12 changes: 5 additions & 7 deletions deployment/test/elastic_beanstalk/integration-test
Expand Up @@ -11,14 +11,12 @@ function cleanup() {
--application-name "${APPLICATION_NAME}" \
--environment-names "${ENVIRONMENT_NAME}"

info "Terminate Elastic Beanstalk environment called ${ENVIRONMENT_NAME}"
aws elasticbeanstalk terminate-environment \
--environment-name ${ENVIRONMENT_NAME}

info "Delete Elastic Beanstalk application named ${APPLICATION_NAME}"
aws elasticbeanstalk delete-application \
until aws elasticbeanstalk delete-application \
--terminate-env-by-force \
--application-name ${APPLICATION_NAME}
--application-name "${APPLICATION_NAME}"; do
echo "Unable do delete elastic beanstalk application, retrying until success."
done
}
trap cleanup EXIT SIGINT SIGTERM

Expand Down Expand Up @@ -63,7 +61,7 @@ codeship_aws eb_deploy \
"${S3_BUCKET}"

info "Checking Environment if deployment matches ci commit hash"
deployed_commit_id=`curl -s $(environment_cname)`
deployed_commit_id=$(curl -s "$(environment_cname)")

if [ "${deployed_commit_id}" == "${CI_COMMIT_ID}" ]; then
info "Matching commit hashes ${CI_COMMIT_ID}, deployment successful"
Expand Down

0 comments on commit f688d83

Please sign in to comment.