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

deployer.php cannot support more than one stage #1712

Closed
ariefbayu opened this issue Sep 25, 2018 · 2 comments
Closed

deployer.php cannot support more than one stage #1712

ariefbayu opened this issue Sep 25, 2018 · 2 comments

Comments

@ariefbayu
Copy link

ariefbayu commented Sep 25, 2018

Q A
Issue Type Question
Deployer Version 6.2.0
Local Machine OS Ubuntu 18.04
Remote Machine OS Ubuntu 18.04

So, please forgive my ignorant if what I wrote here is already supported natively without a little hack.

Here's the situation, I need to deploy my symfony app to both production and staging with a few command differences between them.

At first, I wrote two config files: deploy-prod.php and deploy-staging.php and removed deploy.php for clarity with intent of executing it via: bin/dep deploy staging -f deploy-staging.php. However, I found out that the deployer command required the deploy.php file. So, I need to figure out how to put 2 configs inside that file. I came up with the following gist:

https://gist.github.com/ariefbayu/fb9e564a23c60f6d3582166922b4dbbf

Note that I had to put:

set('env', [
    'SYMFONY_ENV' => 'staging',
]);

to force the env to staging, when deploying to staging server. That code is commented when deploying to production. However, to my surprise, code in that gist doesn't execute the build task. Therefore, it defeated the purpose.

To make the deployer work, I had to hack it, thus, the following gist are born:

https://gist.github.com/ariefbayu/66e2158498e052a6f85fcdb0183c03a2

This gist work flawlessly when I executed: bin/dep deploy staging -vvv.

Please review if what I created here is actually already exists within the deployer. Because, I can't find what I needed in the documentation on deployer.org.

@antonmedv
Copy link
Member

I see your approach. This is possible to do, I think we need better docs here.

@antonmedv
Copy link
Member

Closing this issue as inactive. If you still have this problem, please open a new issue.

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

2 participants