wipeConfluenceSpace

Pascal Euhus

1 minute to read

About This Task

Warning

This task is destructive and can harm your environment

This task will wipe all content from your Confluence space, configured in your docToolchainConfig.groovy. It will not delete the space itself. The task makes it easy if you want to start from scratch with your documentation, or if you want to re-import your documentation from scratch after you did refactor your document structure and want to get rid of all the old pages.

Usage

./dtcw wipeConfluenceSpace -PconfluenceUser=foo.bar@example.corp -PconfluencePass=<REDACTED>

You will be asked to confirm the deletion of all pages in the space. Enter y to confirm.

...
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/8.1.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build

> Task :wipeConfluenceSpace
[ant:input] Do you really want to delete all pages in myDemoSpace (y, n)

Source

Show source code of scripts/publishToConfluence.gradle or go directly to GitHub · docToolchain/scripts/publishToConfluence.gradle.
scripts/publishToConfluence.gradle
task wipeConfluenceSpace(
    description: 'deletes all pages in the configured confluence space',
    group: 'docToolchain'
) {
    doLast {
        ant.input(message: "${'Do you really want to delete all pages in ' + config.confluence.spaceKey}", validargs: 'y,n', addproperty: 'confirm')
        if(ant.confirm.toBoolean()) {
            //TODO default should be false, if the V1 has been removed in cloud
            config.confluence.useV1Api = findProperty("confluence.useV1Api") != null ?
                findProperty("confluence.useV1Api") : config.confluence.useV1Api != [:] ?
                config.confluence.useV1Api :true
            new WipeConfluenceSpaceTask(config).execute()
        } else {
            println("Aborting wipe confluence space, this task needs to be confirmed with 'y'")
        }

    }
}