diff --git a/docs-old/drone.png b/docs-old/drone.png deleted file mode 100644 index 28a162463..000000000 Binary files a/docs-old/drone.png and /dev/null differ diff --git a/docs-old/LICENSE b/docs/LICENSE similarity index 100% rename from docs-old/LICENSE rename to docs/LICENSE diff --git a/docs-old/usage/repo_list.png b/docs/docs/images/repo_list.png similarity index 100% rename from docs-old/usage/repo_list.png rename to docs/docs/images/repo_list.png diff --git a/docs/docs/index.md b/docs/docs/index.md index 49b672259..b2a1741bc 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -82,3 +82,4 @@ pipeline: template: config/k8s/service.yml ``` +See a [detailed plugin example](/usage/bash-plugin). diff --git a/docs-old/usage/pipeline.md b/docs/docs/pipeline.md similarity index 93% rename from docs-old/usage/pipeline.md rename to docs/docs/pipeline.md index b7812b071..b3d891569 100644 --- a/docs-old/usage/pipeline.md +++ b/docs/docs/pipeline.md @@ -1,63 +1,4 @@ - - - -**Table of Contents** _generated with [DocToc](https://github.com/thlorenz/doctoc)_ - -- [Pipeline basics](#pipeline-basics) - - [Activation](#activation) - - [Configuration](#configuration) - - [Execution](#execution) -- [Pipelines](#pipelines) - - [Build Steps](#build-steps) - - [Images](#images) - - [Images from private registries](#images-from-private-registries) - - [GCR Registry Support](#gcr-registry-support) - - [Parallel Execution](#parallel-execution) - - [Conditional Pipeline Execution](#conditional-pipeline-execution) - - [Conditional Step Execution](#conditional-step-execution) - - [Failure Execution](#failure-execution) -- [Services](#services) - - [Configuration](#configuration-1) - - [Detachment](#detachment) - - [Initialization](#initialization) -- [Plugins](#plugins) - - [Plugin Isolation](#plugin-isolation) - - [Plugin Marketplace](#plugin-marketplace) -- [Environment variables](#environment-variables) - - [Built-in environment variables](#built-in-environment-variables) - - [String Substitution](#string-substitution) - - [String Operations](#string-operations) -- [Secrets](#secrets) - - [Adding Secrets](#adding-secrets) - - [Alternate Names](#alternate-names) - - [Pull Requests](#pull-requests) - - [Examples](#examples) -- [Volumes](#volumes) -- [Webhooks](#webhooks) - - [Required Permissions](#required-permissions) - - [Skip Commits](#skip-commits) - - [Skip Branches](#skip-branches) -- [Workspace](#workspace) -- [Cloning](#cloning) - - [Git Submodules](#git-submodules) -- [Privileged mode](#privileged-mode) -- [Promoting](#promoting) - - [Triggering Deployments](#triggering-deployments) -- [Matrix builds](#matrix-builds) - - [Interpolation](#interpolation) - - [Examples](#examples-1) -- [Multi-pipeline builds](#multi-pipeline-builds) - - [Example multi-pipeline definition](#example-multi-pipeline-definition) - - [Flow control](#flow-control) - - [Status lines](#status-lines) - - [Rational](#rational) -- [Badges](#badges) - - - -This document explains the process for activating and configuring a continuous delivery pipeline. - -# Pipeline basics +# Pipelines ## Activation @@ -65,7 +6,7 @@ To activate your project navigate to your account settings. You will see a list Webhooks are used to trigger pipeline executions. When you push code to your repository, open a pull request, or create a tag, your version control system will automatically send a webhook to Drone which will in turn trigger pipeline execution. -![repository list](`repo_list.png) +![repository list](`/images/repo_list.png) ## Configuration diff --git a/docs-old/usage/bash_plugin.md b/docs/docs/usage/bash-plugin.md similarity index 72% rename from docs-old/usage/bash_plugin.md rename to docs/docs/usage/bash-plugin.md index 635854d64..f09ccdfbc 100644 --- a/docs-old/usage/bash_plugin.md +++ b/docs/docs/usage/bash-plugin.md @@ -1,4 +1,10 @@ -This provides a brief tutorial for creating a Drone webhook plugin, using simple shell scripting, to make an http requests during the build pipeline. The below example demonstrates how we might configure a webhook plugin in the Yaml file: +# Writing a plugin + +This provides a brief tutorial for creating a Woodpecker webhook plugin, using simple shell scripting, to make an http requests during the build pipeline. + +## What end users will see + +The below example demonstrates how we might configure a webhook plugin in the Yaml file: ```yaml pipeline: @@ -10,6 +16,8 @@ pipeline: hello world ``` +## Write the logic + Create a simple shell script that invokes curl using the Yaml configuration parameters, which are passed to the script as environment variables in uppercase and prefixed with `PLUGIN_`. ```bash @@ -19,8 +27,10 @@ curl \ -X ${PLUGIN_METHOD} \ -d ${PLUGIN_BODY} \ ${PLUGIN_URL} - ``` + +## Package it + Create a Dockerfile that adds your shell script to the image, and configures the image to execute your shell script as the main entrypoint. ```dockerfile @@ -31,7 +41,7 @@ RUN apk -Uuv add curl ca-certificates ENTRYPOINT /bin/script.sh ``` -Build and publish your plugin to the Docker registry. Once published your plugin can be shared with the broader Drone community. +Build and publish your plugin to the Docker registry. Once published your plugin can be shared with the broader Woodpecker community. ```nohighlight docker build -t foo/webhook . diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 4259ac63c..374ff5765 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -5,6 +5,7 @@ copyright: 'Creative Commons Attribution-ShareAlike 4.0 International Public Lic nav: - Home: index.md - Server setup: server-setup.md + - Pipelines: pipeline.md theme: name: 'material' logo: 'images/favicon.svg'