-
Notifications
You must be signed in to change notification settings - Fork 185
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
How to make a Symfony application deploy #133
Comments
Ah yeah I have an issue open to allow variables to be set for exactly this reason, I knew it was required in symfony but didn't know exactly what for #108 The problem with creating a step is that it will only exist for that specific step, the environment for each command is independent of the others. If For now what you could do is edit https://github.com/REBELinBLUE/deployer/blob/master/app/Jobs/DeployProject.php#L353 and add
Alternatively, you could add it to the |
Hmm, just re-read what you said, for the command where you've echoed it, wouldn't you need
But, as I said, the variable wouldn't exist in the next command. I shall try and get the bug fixed by the end of the week, it shouldn't be a huge amount of work |
Hi,
And when I log in with the same user and I use in the deployer I got this:
As you can see the SYMFONY_ENV var is present. Well, still not working, so I added the command export before the composer update, and I get this:
The var is not present. Maybe it is because the deployer executes the command directly without starting a ssh session? |
Sorry for the delay, I am working on this now |
OK I figured out why using
In a script doesn't work, because the Now to figure out why the variables from ~/.bashrc aren't available |
if I add the following to export FOO=bar and then echo $FOO to the "Before Clone" script I get Where in For example mine has # If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
sac right near the top, which means any export commands after it are not run, if I put them before they work. [ -z "$PS1" ] && return and [[ $- != *i* ]] && return look like they will do the same thing |
Hi Stephen, Sorry for the delay. What file do you want me to paste? the before deploy? On Wed, Dec 30, 2015 at 1:37 AM, Stephen Ball notifications@github.com
José Cornide |
No problem, busy time of year for everyone. I was just wondering what was in your |
~/.bashrc: executed by bash(1) for non-login shells.see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)for examplesIf not running interactively, don't do anything[ -z "$PS1" ] && return don't put duplicate lines in the history. See bash(1) for more options... or force ignoredups and ignorespaceHISTCONTROL=ignoredups:ignorespace append to the history file, don't overwrite itshopt -s histappend for setting history length see HISTSIZE and HISTFILESIZE in bash(1)HISTSIZE=1000 check the window size after each command and, if necessary,update the values of LINES and COLUMNS.shopt -s checkwinsize make less more friendly for non-text input files, see lesspipe(1)[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" set variable identifying the chroot you work in (used in the prompt below)if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then set a fancy prompt (non-color, unless we know we "want" color)case "$TERM" in uncomment for a colored prompt, if the terminal has the capability; turnedoff by default to not distract the user: the focus in a terminal windowshould be on the output of commands, not on the prompt#force_color_prompt=yes if [ -n "$force_color_prompt" ]; then if [ "$color_prompt" = yes ]; then If this is an xterm set the title to user@host:dircase "$TERM" in enable color support of ls and also add handy aliasesif [ -x /usr/bin/dircolors ]; then
fi some more ls aliasesalias ll='ls -alF' Alias definitions.You may want to put all your additions into a separate file like~/.bash_aliases, instead of adding them here directly.See /usr/share/doc/bash-doc/examples in the bash-doc package.if [ -f ~/.bash_aliases ]; then enable programmable completion features (you don't need to enablethis, if it's already enabled in /etc/bash.bashrc and /etc/profilesources /etc/bash.bashrc).#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion#fi On Thu, Dec 31, 2015 at 5:59 PM, Stephen Ball notifications@github.com
José Cornide |
Yeah so right at the top you have # If not running interactively, don't do anything
[ -z "$PS1" ] && return than mean if you added So if you define it it above that line it should work. Although it doesn't matter as I have always finished the feature to allow variables to be defined in deployer |
I have addressed this in #141 Seems to be working fine for me, can you confirm? (if you aren't able to run development builds, which need gulp & bower don't worry) |
Hi, I'll try on the first week of january, hopefully :) On Thu, Dec 31, 2015 at 7:01 PM, Stephen Ball notifications@github.com
José Cornide |
hi, is in the master branch? i just updated the code but I don't the see the changes |
It is in the env_variables branch |
I have merged into |
* master: Small copy changes Added missing delete option Added missing docblock Silence PHPMD warning about number of children Manage environmental variables. Added missing newline Clean up some StyleCI violations Added UI to manage variables Tweak DB seeder Adding environmental variables for #133 and #108 Updated dependencies
Hi,
This is a great tool, although I'm having a lot of trouble to deploy a Symfony application with it and I don't know if I'm doing something wrong or I came across a bug.
I have set up everything and everything works fine (github connection, ssh connection with the server, etc).
The problem is when I deploy I get the following error:
This error occurs because the post update/install Symfony commands are being executed in development enviroment mode instead production mode.
To solve this I need to create a env var called SYMFONY_ENV with the value prod (see the info box here http://symfony.com/doc/current/cookbook/deployment/tools.html#c-install-update-your-vendors)
So I tried to create a before command for the composer step with this:
But it doesn't work, I even tried to debug it adding this to the bash:
And I don't get nothing, the SYMFONY_ENV is still blank.
Any idea on how to solve this or find a workaround?
P.S.: It would be great for debuggin purposes if you add the command that is being executed in the server in the console output modal window.
Again, great tool :)
The text was updated successfully, but these errors were encountered: