cwsteinbach commented on a change in pull request #3008:
URL: https://github.com/apache/iceberg/pull/3008#discussion_r696009617
##########
File path: tasks.gradle
##########
@@ -54,6 +54,18 @@ task refreshJavadoc(type: Exec) {
task deploySite(type: Exec) {
workingDir 'site'
- commandLine 'mkdocs', 'gh-deploy'
-}
+ def remoteName = 'apache'
+ if (project.hasProperty('remote.name')) {
+ remoteName = project.getProperty('remote.name')
+ }
+ // Normally the site directory is removed and built entirely from the docs
+ // directory when `mkdocs gh-deploy` runs. Removing the site directory,
copying
+ // the file by hand, and using --dirty does basically the same thing, but
allows
+ // us to end up with .asf.yaml in the output that gets copied to the asf-site
+ // branch. That's required for publishing now, which is why this workaround
+ // is necessary.
+ commandLine('rm', '-rf', 'site')
+ commandLine('cp', '../.asf.yaml', 'site/')
+ commandLine('mkdocs', 'gh-deploy', '--dirty', '-r', remoteName)
Review comment:
That was the initial approach I took but discovered that only the last
`commandLine` call was getting executed. It turns out that since `Exec` has
both a method and a property named `commandLine`, calling `commandLine foo,
bar` sets the `commandLine` property instead of calling the `commandLine`
method. More info here:
https://stackoverflow.com/questions/48867113/gradle-calling-commandline-multiple-times-only-last-one-runs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]