Copy only the content of the documentation staging directory

This commit is contained in:
Andrea Boriero 2022-05-09 15:55:13 +02:00 committed by Andrea Boriero
parent 298623d2cc
commit a12ca1f100
1 changed files with 2 additions and 1 deletions

View File

@ -54,11 +54,12 @@ public abstract class PublishTask extends DefaultTask {
final String url = normalizedBase + releaseFamily;
final String stagingDirPath = stagingDirectory.get().getAsFile().getAbsolutePath();
final String stagingDirPathContent = stagingDirPath.endsWith( "/" ) ? stagingDirPath : stagingDirPath + "/";
getProject().getLogger().lifecycle( "Uploading documentation `{}` -> `{}`", stagingDirPath, url );
final ExecResult result = getProject().exec( (exec) -> {
exec.executable( "rsync" );
exec.args("--port=2222", "-avz", "--links", "--delete", stagingDirPath, url );
exec.args("--port=2222", "-avz", "--links", "--delete", stagingDirPathContent, url );
} );
getProject().getLogger().lifecycle( "Done uploading documentation - {}", result.getExitValue() == 0 ? "success" : "failure" );
}