docToolchain icon indicating copy to clipboard operation
docToolchain copied to clipboard

publishToConfluence: misleading error message

Open alex0ptr opened this issue 2 years ago • 2 comments

Hey there.

We are trying to setup doctoolchain in a GitLab pipeline to sync our documentation to Confluence. The .gitlab-ci.yml looks like this:

.publishToConfluence:
  image:
    name: rdmueller/doctoolchain:v2.0.3
  script:
    - doctoolchain . publishToConfluence -PmainConfigFile=docToolchainConfig.groovy --no-daemon

Unfortunately the execution fails with the following log:

$ doctoolchain . publishToConfluence -PmainConfigFile=docToolchainConfig.groovy --no-daemon
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.7.1/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
> Configure project :
index.adoc
You are using one or more deprecated Asciidoctor Gradle plugin features. To help with migration run with --warning-mode=all.
> Task :generateHTML
Converting /builds/(...)/documentation/architecture/index.adoc
> Task :publishToConfluence FAILED
publish /builds/(...)/documentation/architecture/index.adoc
convert /builds/(..)/documentation/architecture/index.adoc
FAILURE: Build failed with an exception.
* Where:
Script '/home/dtcuser/docToolchain/scripts/publishToConfluence.gradle' line: 26
* What went wrong:
Execution failed for task ':publishToConfluence'.
> java.io.IOException: Cannot run program "groovy": error=2, No such file or directory
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings

After looking for the sources in this repo (ng-beta branch? there is no tag for 2.0.3?) I can tell there is no groovy installation in the Image but only a Gradle Wrapper. I'm really not familiar with gradle nor groovy. But I think this line should spawn a new groovy process? https://github.com/docToolchain/docToolchain/blob/ng/scripts/asciidoc2confluence.groovy#L792

However the groovy used for gradle is not configured in a GROOVY_HOME or in the Path I guess.

If I'm correct I would like to propose to install a fixed version of groovy in the Dockerfile.

alex0ptr avatar Feb 09 '22 18:02 alex0ptr

thanx for reporting this.

The tag is v2.0.3 : https://github.com/docToolchain/docToolchain/tree/v2.0.3 but the current ng branch should also fit.

Groovy comes with Gradle, so this shouldn't be the problem.

ah! I see the problem: you specified an .adoc file as input and thus the system tries to convert it via a script which somehow got lost. (have to check this).

Why did nobody notice?

Most people seem to first execute generateHTML which converts the .adoc file to html and then specify this output (somewhere in build/html5/...) as input to the publishToConfluence task.

Please give this a try. And I will check where the asciidoc2html file went... :-)

rdmueller avatar Feb 09 '22 19:02 rdmueller

The tag is v2.0.3 : https://github.com/docToolchain/docToolchain/tree/v2.0.3 but the current ng branch should also fit.

I meant that there is no tag on the Docker Image Repo: https://github.com/docToolchain/docker-image/tags The master branch seems to be very old: https://github.com/docToolchain/docker-image/blob/master/alpine/Dockerfile#L39 The ng-beta seems to be the current? https://github.com/docToolchain/docker-image/blob/ng-beta/alpine/Dockerfile#L37

Most people seem to first execute generateHTML which converts the .adoc file to html and then specify this output (somewhere in build/html5/...) as input to the publishToConfluence task.

Ok. I'll try this some time next week. Thanks for the Help, I'll let you know if this fixes my issue.

alex0ptr avatar Feb 10 '22 11:02 alex0ptr

since 3.x we have declared a dependency for publishToConfluence on generateHTML task. Hence, this issue should be fixed, if not please fell free to raise another issue

PacoVK avatar Nov 16 '23 19:11 PacoVK