Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codeship_aws eb_deploy version names frequently collide on parallel steps #115

Open
stretchkennedy opened this issue Aug 9, 2021 · 1 comment

Comments

@stretchkennedy
Copy link

When running codeship_aws eb_deploy, a new version is named VERSION_NAME=${CI_COMMIT_ID}-${CI_BUILD_ID}-$(date +%Y-%m-%d.%H:%M:%S). This is usually fine, but when running two parallel deployment steps to different environments but the same application, it's possible for the steps to start at exactly the same second.

I can think of a few ways to fix this:

  1. Add the environment name to VERSION_NAME, e.g. VERSION_NAME=${CI_COMMIT_ID}-${CI_BUILD_ID}-${ENVIRONMENT_NAME}-$(date +%Y-%m-%d.%H:%M:%S)
  2. Prepend S3_BUCKET_SUBFOLDER_PATH to VERSION_NAME, e.g. VERSION_NAME=${S3_BUCKET_SUBFOLDER_PATH}-${CI_COMMIT_ID}-${CI_BUILD_ID}-$(date +%Y-%m-%d.%H:%M:%S)
  3. Allow VERSION_NAME to be overridden, e.g. VERSION_NAME=${VERSION_NAME:-${CI_COMMIT_ID}-${CI_BUILD_ID}-${ENVIRONMENT_NAME}-$(date +%Y-%m-%d.%H:%M:%S)}
  4. Stick a random UUID on the end
  5. Change the date format to use higher precision, so at least it will happen less

I'm happy to put up a PR for this if we reach a decision on which option is best, although given that it's a one-liner, it might be easier for whoever sees this to just go ahead and make the change themselves.

@stretchkennedy
Copy link
Author

For more context on why anyone would want to do this, we have multiple demo environments for different clients automatically deployed from the same branch in the same parallel step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant