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

how to run gulp and chmod storage folder properly #167

Closed
lorvent opened this issue Feb 2, 2016 · 28 comments
Closed

how to run gulp and chmod storage folder properly #167

lorvent opened this issue Feb 2, 2016 · 28 comments
Labels

Comments

@lorvent
Copy link

lorvent commented Feb 2, 2016

Hello,
i know i am bugging you for whole day... sorry :( but i am trying to do it all the ways possible and spent hours but not able to figure out.

I want to deploy my laravel project where, i want to

  • run migrations
  • chmod storage, bootstrap/cache folder
  • npm install
  • gulp

can you please point me in right direction.

thanks

@REBELinBLUE
Copy link
Owner

So I'd have 3 "before activate" tasks where I

Run migrations

cd {{ release_path }}
php artisan migrate --force

Run node

cd {{ release_path }}
npm install --production

Run gulp

cd {{ release_path }}
gulp --production

For the storage folder I would test it up as a "Persistent file" on the "Files" tab with a path of storage/ that will then create a shared folder at the same level as releases and them the storage folder will be moved to there and symlinked between releases

For the bootstrap directory you can also add a "before activate" task with

cd {{ release_path }}
chmod 755 bootstrap/cache

You'd presumably also want a before activate task with

cd {{ release_path }}
php artisan down

as the first one

and an after activate task with

cd {{ release_path }}
php artisan up

Ignore the invalid tag BTW, that is just so it doesn't appear in the changelog

@lorvent
Copy link
Author

lorvent commented Feb 3, 2016

Thanks for the help,
i almost doing same but i added bootstrap/cache also into persistent files,

also,can you please tell me how you are handling .env?

if i put server details into .env.example then there is no use of having .env.example at all,
I am sure you might be handling in a smart way.

@REBELinBLUE
Copy link
Owner

Ah of course I forgot .env. On the files tab put that in configuration files and it'll create it in the folder on each deploy (or you could make it a persistent file and it'll symlink it on each deployer but you'd need to manually add the file with the correct content to the shared folder by hand)

@lorvent
Copy link
Author

lorvent commented Feb 3, 2016

oh ok, i am doing that now... manually adding .env into shared then adding it into persistent files, but i thought you might be using some other flow like adding it into configuration files.

i tried configuration files option last time but i think it failed....

thanks for the info... this helps me in creating doc for a laravel app deployment.

@REBELinBLUE
Copy link
Owner

Hmm that is weird, configuration file should work unless I have broken something. I will have to try later

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

Hey

0.0.28 seems to be broken

its not working for me on fresh install and upgrade

i had to move back to 0.0.27 to make it work properly.

@REBELinBLUE
Copy link
Owner

Hmm you're right, odd it is working on my dev machine fine but not on my production machine. Looking at it now

@REBELinBLUE
Copy link
Owner

My issue "just" turned out to be that my storage/* folders weren't writable for some reason, can you check yours are?

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

for me, first it has shown storage error, after fixing that it started showing lot of manifest.json errors, one after another.

@REBELinBLUE
Copy link
Owner

Can you try the latest release branch?

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

same issue like i told before
screencapture-deploy-lorvent-com-1454665616967

@REBELinBLUE
Copy link
Owner

That makes no sense, it is there https://github.com/REBELinBLUE/deployer/tree/release/public/build

Can you try git reset --hard HEAD

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

that made it work

@REBELinBLUE
Copy link
Owner

👍

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

running npm install, composer install may caused this problem...

@REBELinBLUE
Copy link
Owner

That is very odd, because obviously I did that as well

@REBELinBLUE
Copy link
Owner

Crap, I see why. I tagged the master branch as the release, not the release branch. That explains it. Making a new release now

@REBELinBLUE
Copy link
Owner

Fixed, apologises for that, 0.0.29 is out

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

Hey no problem,
i want to metion one more thing.... mail notification working only 2-3times out of 10 builds, did you face similar issue anytime?

@REBELinBLUE
Copy link
Owner

Honestly, I have never used mail notifications, someone added those as a pull request. I'll see if I can have a play around tomorrow evening, refactoring them as part of the hipchat stuff anyway

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

Oh ok... I want you to be aware of it...
if hipchat notifications are there, i may not use mail notifications 😄

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

another interesting thing is,

before command like

pwd

cd {{ release_path }}

pwd

used to get executed, now its displaying them as plain text , not sure whether its executing them or not.

@REBELinBLUE
Copy link
Owner

Uh, nothing has changed in that. Do you have APP_DEBUG on in .env?

In debug mode I use set -e which means bash will print out the commands along with running them

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

Oh nice...may be thats the reason, yes i do have APP_DEBUG=true

@REBELinBLUE
Copy link
Owner

You may need to run php artisan optimize --force && php artisan config:cache after to change it to ensure the cached version of the config is cleared (app:update normally does it for you)

@lorvent
Copy link
Author

lorvent commented Feb 5, 2016

hmm, its still displaying those commands after making debug false and running above command but that does no hard so we can leave it.

I have few other questions/suggestion beside hipchat notifications

  • can we run deployment only if branch specified matches with branch in github? usually github triggers webhook for push to any branch where as deployer pulls and runs only for specific branch (intened) so can we avoid those extra builds?
  • can we have user roles? i have seen another issue for that....

@REBELinBLUE
Copy link
Owner

The first one is definitely on the list, I just haven't had a chance to look at the github/bitbucket/gitlab etc APIs yet. The Deployer plugin for PHPCI currently does this.

The second one I am still not 100% sure about yet, I want to do it at some point but for me it is quite low priority so I haven't even began to think about it. Of course I am always open to pull requests ;)

@lorvent
Copy link
Author

lorvent commented Feb 6, 2016

Thanks for that.

i really love this project so i will see if my skill set allows me to send PR

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

No branches or pull requests

2 participants