docToolchain / docToolchain

a AsciiDoc Toolchain for technical Software Documentation, focused on Software Architecture Documentation
https://doctoolchain.github.io/docToolchain/
MIT License
739 stars 235 forks source link

confluence: Various problems when publishing #271

Closed duschata closed 5 years ago

duschata commented 5 years ago

Describe the bug generateHTML, PDF etc works as expected but

when publishing on confluence following problems arise. I have this behavior both installations: the submodule approach (https://docs-as-co.de/getstarted/tutorial1), as well as in the method described in the main manual

Expected behavior

> Task :docToolchain:publishToConfluence 
Putting task artifact state for task ':docToolchain:publishToConfluence' into context took 0.0 secs.
Up-to-date check for task ':docToolchain:publishToConfluence' took 0.0 secs. It is not up-to-date because:
  Task has not declared any outputs.
docToolchain> docDir: /home/tom/src/java/docsascode
publish /home/tom/src/java/docsascode/build/docs/html5/hello.html

hello.html is in this case a very minimalistic html file:

<html>
<head></head>

<body>hello world</body>

</html>

as soon as I try to publish a file actually generated from .adoc I get:

> Task :docToolchain:publishToConfluence FAILED
Putting task artifact state for task ':docToolchain:publishToConfluence' into context took 0.0 secs.
Up-to-date check for task ':docToolchain:publishToConfluence' took 0.0 secs. It is not up-to-date because:
  Task has not declared any outputs.
docToolchain> docDir: /home/tom/src/java/docsascode
publish /home/tom/src/java/docsascode/build/docs/html5/test.html
arc42

:docToolchain:publishToConfluence (Thread[Task worker for ':' Thread 7,5,main]) completed. Took 0.521 secs.

FAILURE: Build failed with an exception.

* Where:
Script '/home/tom/src/java/docsascode/docToolchain/scripts/publishToConfluence.gradle' line: 24

* What went wrong:
Execution failed for task ':docToolchain:publishToConfluence'.
> java.net.URISyntaxException: Illegal character in scheme name at index 0: [:]

test is a generated file from the tutorial2

curl -o src/docs/test.adoc https://gist.githubusercontent.com/mojavelinux/4402636/raw/b8b02adc3c0ddb92df505ba3eb8e625952615b7a/test.asciidoc.txt

Configuration

any suggestions?

rdmueller commented 5 years ago

thanx for reporting this.

I guess your hello.html is too minimalistic. The script looks for headlines to split the page by and create confluence page names with.

regarding the tutorial2 page: this is the AsciiDoc Test page and it seems that it contains a link which java does not like. hm. it references the line def config = new ConfigSlurper().parse(new File(docDir, mainConfigFile).text) - so it looks like a problem with the mainConfiFile setting.

let me check this out - I hope I find some time tomorrow to give it a try...

rdmueller commented 5 years ago

I finally found some time to test this.

I followed the tutorial (just to find out that it does not work with v1.0.0 but with the current master) and ran

./gradlew generateHTML

which ran fine.

I then copied the confluence-part of the Config.groovy from

https://github.com/docToolchain/docToolchain/blob/master/Config.groovy

and updated it with the config for my on-demand cloud confluence instance. (everything but the API key can be found here for reference: https://github.com/aim42/htmlSanityCheck/blob/master/config/docToolchain.groovy)

I created a new confluence space and ran

./gradlew publishToConfluence

and got an error:

> java.io.FileNotFoundException: /c/Users/ralfd/projects/tutorial1/build/docs/html5/images/tiger.png 
(No such file or directory)

yes, I didn't fetch the tiger.png. So I touched the file and reran the publishToConfluence.

This time I've got the following result:

https://arc42-template.atlassian.net/wiki/spaces/dttest/pages/579665927/arc42

rdmueller commented 5 years ago

Can you please check your Config.groovy and compare it with the examples above?

duschata commented 5 years ago

Thank you for your efforts, it is very mysterious but I can not reproduce the mistake anymore. Both the submodule and the 'export PATH=pathToDocToolchain' variant now publish the contents to confluence. I had some in-house gradle settings and init scripts on my machine, maybe those were responsible for the error. There are still some open questions, but I will ask them in a new issue.