-
Notifications
You must be signed in to change notification settings - Fork 24
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
Difficult to change working directory in remote
block
#164
Comments
Hmm, yeah that's a little tricky. For the phoenix digest case, have you looked into https://github.com/labzero/bootleg_phoenix? Granted you'll still probably have some issues as umbrella apps aren't really supported yet. We'd love to hear where it falls down! More generally, we are a little hesitant to add more options to workspace "apps/myapp_web/assets" do
remote :build do
"yarn install"
"./node_modules/brunch/bin/brunch b -p"
end
end Alternately we could do create a breaking change where filter attributes are part of an options Keyword, like While we work on a proper solution, you could create a new role that has the same details as your |
bootleg_phoenix doesn't work with the latest bootleg or umbrella projects or phoenix 1.3. Looking into contributing to it is on my todo list. 😄 I'm not following the filter option. Can you elaborate? The thing I thought of initially, simply due to exposure to it, was a config :myapp_web, MyappWeb.Endpoint,
watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin",
cd: Path.expand("../assets", __DIR__)]] That would obviously collide with the concept of a workspace, unless there was a clean way to enforce that it must be a relative path of workspace, in which case I'd imagine something like... remote :build, cd: "apps/myapp_web/assets" do
"yarn install"
"./node_modules/brunch/bin/brunch b -p"
end |
bootleg_phoenix would love your contributions! 😄 Currently remote :build, cd: "apps/myapp_web/assets", filter: [foo: :bar] do
"yarn install"
"./node_modules/brunch/bin/brunch b -p"
end As for relative vs. absolute, it'd be simple enough to say that relative is relative to the workspace, and absolute is absolute. We use the same rules for workspace cleaning. |
I like the idea of needing to be specific about filters to apply, so user-defined filters are uniquely named and separate from both current and future Bootleg options (e.g. The current behavior may somewhat limit our ability to add options in the future without potentially colliding with users' role options, so a breaking change might be better made now than later. The more I look at that suggestion the more I like it 👍 . We could also detect an improper use based on the absence of known option keys like |
Ah, I see what you're saying now. Yeah, I'd vote for the breaking change. Flexible options for this and other things down the road seems like a better way to go. |
If the filter is just for roles maybe call it |
This is probably too much work to do before the next release, so we might just update the docs to remove the mention of it for now. |
I'm trying to write a custom task that has to cd into different directories and run commands. It does something like the following.
The problem I'm running into is that these commands are prefixed with
cd /path/to/workspace && /usr/bin/env
, so after thecd
completes I'm back to my original context.I can't wrap my entire command in quotes since env will say it can't find the command (thinking the whole string is my command path). The only way I can think of to deal with this with the current code is to explicitly invoke my shell and pass in the commands, like
bash -c "cd ... && ..."
. Alternatively perhaps theremote
block could take a custom directory to cd into within the build workspace? I'm not really sure what is ideal but I thought I'd provide the feedback anyway in case it is helpful.The text was updated successfully, but these errors were encountered: