-
Notifications
You must be signed in to change notification settings - Fork 17
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
Symlink target issue #7
Comments
Should be, I'll look into it tonight. |
@tlartaud Would it work for you if So your |
Let me know if that solves your issue. I published this to https://github.com/timkelty/shipit-shared/tree/2.1.0 |
I've already tried the absolute path. The absolute path might NOT work because my deploy user do not have the same paths to the website, than the apache user. Example Well, if i do this, the symlink created will be : So, the following paths would work In your shipit shared option, can't you add, next to the "baseDir" option, a new option called 'basePath', which could be optionnal, and which could allow user to ovveride the default deploy path with a custom one, different from the deploy path into shipit ? PS : i will try again with your last update to see if it changes something. |
I'm not seeing how using an absolute path and this latest update wouldn't fix this. In your shipitfile:
Note, this will only work with the latest version. It basically does what you suggested, but without the additional setting. If the path is relative (not starting with /), it will make it relative to the |
Hi, I apologize for the answer time .. i've been really busy theses last days. I tried your solution, with last updates. Symlink creation works fine, but results paths are not correct for my server configuration. This is my config file
As you can see, i am deploying with shipit, using a chrooted user.
On my server configuration, this is not correct, and it should look like this instead :
or
Maybe that in your configuration file, you could add an option to allow people like me which use a chrooted user to deploy, to prepend a custom path to symlinks you create.
Do you think it is possible ? It would be really helpful. |
I also tried to change
Which is normal, because i am connected with a chrooted user which do not have access to I only need to prepend symlinks paths with my own custom path, which is only required for apache user. |
I see now, thanks. I'll take a look at your PR and merge it in. |
Thank you :) |
If I understand correctly, your issue is with the permissions on the If you set your That way, once, you could either create the dirs manually, or run I'm just wondering if an option to skip the creating of the dirs every time is a better option, rather than adding such a specific option as you've suggested. Let me know what you think. |
If that suggestion works, I'd rather add that option, as it's not so specific, and because I'm not thrilled about the fact that So we might have an option that was |
dude, do you know what a chroot is ? "If I understand correctly, your issue is with the permissions on the mkdir -p command, right?" My issue is about paths written inside symlinks files that are not correct. Did you read my post. I d'ont know how i can explain this better than with full explanation + a pull request.... |
its NOT a permission issue. It is chroot. Server structure
As you can see in that structure, the chrooted user cant access any of the parent folder of domain.org. "That way, once, you could either create the dirs manually, or run shipit shared:dirs with the non-chrooted user, and then never do it again." |
"I'm just wondering if an option to skip the creating of the dirs every time is a better option, rather than adding such a specific option as you've suggested." i think that if i add thats why i suggested an option specific to chrooted environments, because if does ONLY affect datas INSIDE symlinks files. I know theses explanations are not very clear, and i aploogize for that. i'm not really good in english, and i try to explain myself as I can, sorry if I confused you. |
I know what a I think it might make more sense just to simplify the options a bit.
This config should Does that look like it will work for you? |
Hey there, I just tried to deploy a new fresh website with your last node version. The only "bug" that is still remaining, is that symlinks are not created if the source path (eg.
What do you think ? PS : Anyway, it actually works if i create all the shared files before deploying, but it could be great to have the symlinks created even if the linked file does not exist, in some cases. Thanks a lot for your updates and time. |
It also give me another idea, you could really improve our development workflow, by allowing us to upload the missing files from our local environment, so we could have some option like below
This could be really awesome, because with that options, we don't even need to connect via SSH or FTP to our server to copy or create the missing and required files into the shared folder. What do you think about this ? :) |
Well, I think i spoked to fast .. Checkout 7-chroot branch, ran npm install, deployed. My complete config file
Am i doing something wrong ? As i can see in your last post, you wrapped the "staging" array into "shared", but i think its a mistake, right ? The result on remote server
As you can see, symlinks for folders are created, but the symlink for public/.htaccess is missing.
Do you have an idea of what is going on ? |
Nope, but I'll look today. This is a good excuse to get some tests in here so we don't keep running into this stuff, too :). |
Ok, i know why it failed. My console
The wrong argument is
and should be
EDIT : After thinking about it, i may correct myself, this previous test should be simply removed, as it force the symlink creation to already have a file in place before creating it. Thats why it fail in some cases. It could work for my So, the first ran command should be
EDIT 2 : You should use |
I think that ideally, the result command should be this
Untested but it should work well. |
Final solution tested and working for me. I changed link.js line 27 to 32 https://github.com/timkelty/shipit-shared/blob/issues/7-chroot/tasks/shared/link.js#L27 to this.
And in init.js
And you can replace all
by
( -r argument on a file won't throw an error ) Alternatively, you can choose to not join paths in init.js, but you should warn users that they need to add the correct value in each environnments, like this
Everything is ok now
|
Nice! Hmmm....I think I'm going to opt to not do the path joining in |
@tlartaud I pushed those changes, can you make sure they work for you? |
"I like the creation/upload ideas you had" Yep :) |
PS : I'm sorry, i just deleted my 2 olds comments. i was looking at the 7-chroot and didn't see the changes you made. Sorry. I will make a last test with your merged version and let you know if it works for me. |
I fixed some typos errors in the bash command.
Success !
The config file used
I hope that helps |
@tlartaud Ok, I pushed that to Also - I don't think |
Yep, you are totally right, i've just added it back for sample purposes. Thanks. |
@timkelty sorry, last fix
|
@timkelty I am just wondering myself if it wouldn't be better to create symlinks which looks like this
I didn't test yet, but maybe that if the source symlink include Actually, this is just a supposition, i didn't test, and i don't know if a |
@tlartaud Ok, Pushed that last fix. |
@timkelty Thanks a lot. It works fine now. I've tested the thing about dirname(), and it always return the full path, so we can't make php use Maybe that you should prefer this in init.js so the option is not required (i think grunt will throw an error if shipit.config.shared.symlinkPath does not exist)
It will prevent users that update your node without adding the new (optional) |
Just a strange behaviour,
I replaced it with the correct one and merged and pushed to all branches
The strange thing is that i had to totally remove current/ and releases/ folders on my remote and deploy again, otherwise, each time i deployed, i got symlinks created with Anyway, thanks a lot. |
@tlartaud Grunt, or JS in general should be fine with
Since |
Glad we worked this one out! |
@tlartaud in the |
|
Hi there,
Thank you for for your node. its usefull.
I'm using some Chrooted environments on my remote, so my deploy user, and apache, use different root paths. shipit-shared us the "deployTo" path which is for the deploy user. The apache user may have some really different rights on some servers configurations.
Is there a way to allow shipit-shared to use symlinks on files as this :
ln -s ../../shared/.env .env
replacing
shared
bygrunt.shipit.config.shared.baseDir
instead of
ln -s /httpdocs/shared/.env .env
Thank you by advance
The text was updated successfully, but these errors were encountered: