Open thejsj opened 10 years ago
I'm also not seeing the build files copied to the trunk
directory. Unfortunately, the proposed change (assuming I am implementing it correctly) didn't resolve it for me. I think this copy fail, must be why I'm getting a notice that the plugin was successfully deployed, yet my svn.plugins.org code never updates.
Thanks @thejsj - apologies for taking so long to get back to you. This seems similar to #1 - where I believe the argument a
(alias for dR
) conflicts with the lowercase r
. Was this on a mac? Linux doesn't seem to care. Is there any reason why you dropped the a
unlike #1?
Hi @helgatheviking have you tried running grunt wp-deploy --verbose
- do you see any error messages?
Yes, I'm on a mac.
No particular reason for not adding the a. It just seemed that R
was enough.
Let me know if I can help in any way!
@stephenharris Sorry for the delay. In my mind I already replied! Here'e the output from the verbose command:
Running tasks: wp_deploy
Running "wp_deploy" task
Running "wp_deploy:deploy" (wp_deploy) task
Verifying property wp_deploy.deploy exists in config...OK
File: [no files]
Options: svn_url="http://plugins.svn.wordpress.org/{plugin-slug}", svn_user="hel
gatheviking", plugin_slug="nav-menu-roles", build_dir="build/"
Reading package.json...OK
Parsing package.json...OK
Reading build/readme.txt...OK
Reading build/nav-menu-roles.php...OK
Checking out http://plugins.svn.wordpress.org/nav-menu-roles
Check out complete.
Clearing trunk.
Copying build/ to /tmp/nav-menu-roles/trunk/
[?] Are you sure you want to commit "1.5.0"? Yes
Committing to trunk
Copying to tag
Committing tag
Done, without errors.
The SVN repo is checked out into the /tmp folder, but the trunk is never updated with the new files.
@helgatheviking - I'm going to release an update shortly. If nothing else, it should throw out any errors it has when trying to copy the build directory to trunk.
@stephenharris cool. I look forward to it.
@stephenharris Did you ever get around to that update?
Sorry @helgatheviking I've been moving house, so I've not had time yet :/. Will try to release it before the weekend!
No rush. I was just double-checking that I hadn't missed something.
On Wed, Mar 26, 2014 at 8:13 PM, Stephen Harris notifications@github.comwrote:
Sorry @helgatheviking https://github.com/helgatheviking I've been moving house, so I've not had time yet :/. Will try to release it before the weekend!
Reply to this email directly or view it on GitHubhttps://github.com/stephenharris/grunt-wp-deploy/issues/2#issuecomment-38726895 .
Updated version (finally!) released.
Well the bad news is it still isn't working for me. The good news, is that now I have an error that reveals what is happening:
Running "wp_deploy:deploy" (wp_deploy) task
[D] Task source: D:\www\wordpress\src\wp-content\plugins\nav-menu-roles\node_mod
ules\grunt-wp-deploy\tasks\wp_deploy.js
Checking out http://plugins.svn.wordpress.org/nav-menu-roles
Checked out revision 890282.
Check out complete.
Clearing trunk.
Copying deploy/nav-menu-roles/ to /tmp/nav-menu-roles/trunk/
Warning: Failed to copy into trunk: Error: Command failed: 'cp' is not recognize
d as an internal or external command,
operable program or batch file.
Use --force to continue.
Aborted due to warnings.
cp
does not exist in Windows. Is there a way to make the copy system agnostic? What about using grunt-contrib-copy
which you already use in your Events Gruntfile?
I could look into using grunt.file.copy
(docs) (which grunt-contrib-copy
uses)...
that'd be awesome!
To follow up, I tested the gruntfile branch and the copying seems resolved! I am now seeing this instead:
Warning: Failed to commit to assets: Error: Command failed: The syste nd the path specified. 'awk' is not recognized as an internal or external command, operable program or batch file. Use --force to continue.
Yeah, over one hurdle and straight into the next :). Seems Windows doesn't support awk
. But apparently you can install gawk (see http://stackoverflow.com/questions/21927944/how-to-run-an-awk-commands-in-windows).
I'm not sure if there is a better alternative (it would of course be nice for the task to run on Windows without requiring third-party software be installed) - but at least that will/should get it working for you.
What is the purpose of awk? i've not seen anything regarding awk in the various bash scripts for deployment http://thereforei.am/2011/04/21/git-to-svn-automated-wordpress-plugin-deployment/
This isn't git to svn. Essentially it copies a folder into trunk, and checks in the changes. The awk allows the script to check in the changes.
(See line 73 of the script linked to by that article: https://github.com/thenbrent/multisite-user-management/blob/master/deploy.sh#L73)
@helgatheviking - so grunt.file.copy
is now used, but I'm guessing the use of awk
still presents a problem for Windows users? I don't know of a way around that, so can I close this with an update to the readme warning Windows users that they will need to install gawk?
I've updated to 1.0.3 and there are still problems on the Windows side of things.
Committing to trunk Copying to tag Committing tag Warning: Failed to comit tag: Error: Command failed: The system cannot find the path specified. Use --force to continue.
When I look at the /tmp folder the new version has been copied into trunk, but the trunk is then not copied into a new tag folder. I didn't think grunt.file.copy
could be used outside of the folder where grunt is installed?
Thanks for continuing to work on this!
grunt.file.copy
is used for copying the build/assets directory to trunk/assets in the tmp directory respectively. For copying trunk
to tags/[version]
, svn copy
is used. If this fails it should display an error (as per https://github.com/stephenharris/grunt-wp-deploy/blob/master/tasks/wp_deploy.js#L164:L166) and abort the process. Perhaps try console.log
-ing stdout
and stderr
, which might give a fuller picture.
Looks like it isn't copying to trunk after all. In verbose mode I get this:
Check out complete. Clearing trunk. Copying build/ to /tmp/radio-buttons-for-taxonomies/trunk/ Warning: Failed to copy into trunk: Error: Command failed: cp: cannot create dir ectory `/tmp/radio-buttons-for-taxonomies/trunk/': No such file or directory Use --force to continue.
Which makes me think that the script is stuck because Windows has a different directory path structure than Mac/Linux? D:/tmp/radio-buttons-for-taxonomies/trunk does exist, but Windows probably doesn't know what '/tmp' is.
I don't know if I have suggested it before, but would it be possible to put the temporary SVN repo inside the project folder? Then you could use relative paths which I think should be less impacted by the OS. Or maybe even grunt.file.copy
would work. At the end the deploy folder could optionally delete itself.
but would it be possible to put the temporary SVN repo inside the project folder
I kept it out of there to avoid clutter (also accidentally overriding stuff). It should be possible, and with a careful choice of name for the svn repo directory, perfectly safe. At least we've got a fairly good idea of what the problem is, so I'll a think a see if there's a way round this.
If you made it an option in the Gruntfile setup, people could set up whatever folder they wanted and nothing would be overwritten. Well, in theory of course! and if the file auto-deleted itself there wouldn't be any clutter.
I was playing with this today and was thinking of
adding a temp_path to the options
var options = this.options({
svn_url: "http://plugins.svn.wordpress.org/{plugin-slug}",
svn_user: false,
plugin_slug: false,
build_dir: false,
assets_dir: false,
max_buffer: 200*1024,
temp_path: "/tmp/"
});
And then the svn path would be var svnpath = options.temp_path.replace(/\/?$/, '/') + slug;
Inside this script svn copy
will not copy the trunk. Outside of the script, svn
commands work fine in the terminal, so I am just as confused as ever.
I never get the error Failed to copy to tag
, but I think this is failing as looking at the folders, I never see the new tag. So then it fails when it trys to when it tries to switch to the new tag folder.
Do you have to commit twice? Don't know if it would make a difference, but you could copy to trunk, svn copy to tag and then commit everything at once?
@stephenharris for this issue hackathon can be obtained from https://github.com/remcotolsma/grunt-rt-wp-deploy xD
Committing to trunk Copying to tag Committing tag Warning: Failed to comit tag: Error: Command failed: The system cannot find the path specified. Use --force to continue.
Please fix this issue as soon :)
If you'd care to make a PR of the fix, I'd be happy to test and merge :)
Cool! I will take care of this bug ASAP, I am hitting roughly right now to fix this ;)
When running the grunt task, the files weren't being copied to the
/tmp
directory.In my case, the following change fixed it: From:
To