-
Notifications
You must be signed in to change notification settings - Fork 137
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
Option to use existing version if present, otherwise upload deployment-package #8
Comments
Hmmm, interesting. I can see that it would be useful for some cases, but adds some complexity. So your use case is you're deploying the same build to two environments, and only want to create the version once and then deploy to both? Wouldn't a simple workaround being defining two tasks, where the first creates the version and deploys to env 1 and the second deploys the existing version to env 2? |
We are deploying to staging or production based on monitoring commit messages. If a commit message contains Our workflow is like: - name: deploy to staging
if: contains(github.event.head_commit.message, '[deploy staging]')
uses: einaregilsson/beanstalk-deploy
with:
environment_name: staging
version_label: ${{ github.sha }}
deployment_package: src/deploy.zip
- name: deploy to production
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy production]')
uses: einaregilsson/beanstalk-deploy
with:
environment_name: production
version_label: ${{ github.sha }}
deployment_package: src/deploy.zip This works fine, unless the commit message be like:
In this case, I could imagine a similar issue arising if we were to Basically, it seems like there could be a range of situations where a version already exists but the workflow step doesn't actually know if it does. |
One workaround would be adding a timestamp to |
I kinda wish I'd done it like you said from the beginning. But now I'm thinking whether to add the feature directly, or add it as some kind of option. Could possibly add some kind of optional |
I think the option makes sense for backwards compatibility and out of precaution... I could imagine situations where users don't intend to create a duplicate version number and perhaps the failure would be good in that case. OTOH there are presumably few users currently, so backwards incompatibility probably is not a huge deal. And given the usefulness of this action, I presume it will have many more users in the future. So not a bad time to make changes. Anyways no strong opinion here. Whatever form it's implemented, I think it'd be useful! |
I've just published v5 of the action which adds this parameter, |
refs einaregilsson/beanstalk-deploy#8 allows us to deploy an already existing version via commit message, for example if we want to deploy the same commit to production and staging.
Just FYI, I just tested that attaching AWSElasticBeanstalkWebTier and AWSElasticBeanstalkService managed policies to the user is enough for a successful deployment. |
@juan-ntsprint Thanks, I'll add that to the docs 🙂 |
I'm having the same problem, will I have to keep emptying and deleting S3 bucket if a deployment goes wrong |
From the readme:
I am interested in a solution to the situation where the desired behavior is to:
deployment-package
Basically, ignore
deployment-package
if the version already exists on s3.This would address the following error that occurs if you deploy to multiple environments as demonstrated in #5 (comment):
In our case, XXXX is the source commit hash, so we don't have to worry about version being ambiguous.
The text was updated successfully, but these errors were encountered: