From 4d5828d26d9dc66898da013276e690f3f8f232fe Mon Sep 17 00:00:00 2001 From: Jorge Aguilera Date: Wed, 21 Feb 2024 09:28:45 +0100 Subject: [PATCH] add asciidoctor plugin and gh-pages Signed-off-by: Jorge Aguilera --- .github/workflows/ghpages.yml | 49 +++++++++++++++++++++++ build.gradle | 18 +++++++++ gradle.properties | 1 + src/docs/asciidoc/index.adoc | 8 ++++ src/docs/asciidoc/parts/example.adoc | 58 ++++++++++++++++++++++++++++ src/docs/asciidoc/parts/intro.adoc | 3 ++ src/docs/asciidoc/parts/setup.adoc | 4 ++ 7 files changed, 141 insertions(+) create mode 100644 .github/workflows/ghpages.yml create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 src/docs/asciidoc/index.adoc create mode 100644 src/docs/asciidoc/parts/example.adoc create mode 100644 src/docs/asciidoc/parts/intro.adoc create mode 100644 src/docs/asciidoc/parts/setup.adoc diff --git a/.github/workflows/ghpages.yml b/.github/workflows/ghpages.yml new file mode 100644 index 0000000..a6625b0 --- /dev/null +++ b/.github/workflows/ghpages.yml @@ -0,0 +1,49 @@ +name: ghpages +on: + push: + branches: + - 'main' + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + name: Build docu + runs-on: ubuntu-latest + timeout-minutes: 90 + steps: + - name: Environment + run: env | sort + - uses: actions/checkout@v4 + - name: Set up JDK for x64 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + architecture: x64 + - name: Generate + run: ./gradlew asciidoctor + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./build/docs/asciidoc + + publish-ghpages: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..6ea876a --- /dev/null +++ b/build.gradle @@ -0,0 +1,18 @@ +buildscript { + repositories { + mavenCentral() + } +} + +plugins { + id("org.asciidoctor.jvm.convert") version "3.3.2" +} + +repositories { + mavenCentral() +} + +asciidoctor{ + baseDir 'src/docs/asciidoc' + attributes revnumber : { project.version.toString() } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..8766f31 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +version=0.0.2-rc1 \ No newline at end of file diff --git a/src/docs/asciidoc/index.adoc b/src/docs/asciidoc/index.adoc new file mode 100644 index 0000000..b27b291 --- /dev/null +++ b/src/docs/asciidoc/index.adoc @@ -0,0 +1,8 @@ += nf-nomad +:toc: left + +include::parts/intro.adoc[] + +include::parts/example.adoc[] + +include::parts/setup.adoc[] \ No newline at end of file diff --git a/src/docs/asciidoc/parts/example.adoc b/src/docs/asciidoc/parts/example.adoc new file mode 100644 index 0000000..47df5d6 --- /dev/null +++ b/src/docs/asciidoc/parts/example.adoc @@ -0,0 +1,58 @@ +== Example + +.nextflow.config +[source] +---- +plugins { + id 'nf-nomad@0.0.1' + id 'nf-amazon' +} + +fusion { + enabled = true + exportStorageCredentials=true +} + +wave { + enabled = true +} + +nomad{ + client{ + address = "http://localhost:4646" + } + jobs{ + deleteOnCompletion = false + } +} + +process.executor ='nomad' +---- + +.main.nf +[source] +---- +process sayHello { + container 'ubuntu:20.04' + + input: + val x + output: + stdout + script: + """ + echo '$x world!' + """ +} + +workflow { + Channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello | view +} +---- + +TIP:: You need to use an S3 bucket as working dir + +Run the pipeline + +`$ nextflow run main.nf` + diff --git a/src/docs/asciidoc/parts/intro.adoc b/src/docs/asciidoc/parts/intro.adoc new file mode 100644 index 0000000..2134f38 --- /dev/null +++ b/src/docs/asciidoc/parts/intro.adoc @@ -0,0 +1,3 @@ +== Introduction + +The aim of this plugin \ No newline at end of file diff --git a/src/docs/asciidoc/parts/setup.adoc b/src/docs/asciidoc/parts/setup.adoc new file mode 100644 index 0000000..8fa6735 --- /dev/null +++ b/src/docs/asciidoc/parts/setup.adoc @@ -0,0 +1,4 @@ +== Setup + +Firstly you need a `nomad` cluster. See https://developer.hashicorp.com/nomad/intro +