This commit is contained in:
parent
4847473772
commit
dff4b91525
@ -107,6 +107,53 @@ local PipelineBuild = {
|
||||
},
|
||||
};
|
||||
|
||||
local PipelineDocumentation = {
|
||||
kind: 'pipeline',
|
||||
name: 'documentation',
|
||||
platform: {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: 'publish',
|
||||
image: 'plugins/gh-pages',
|
||||
settings: {
|
||||
netrc_machine: 'gitea.rknet.org',
|
||||
pages_directory: 'docs/',
|
||||
password: {
|
||||
from_secret: 'gitea_token',
|
||||
},
|
||||
remote_url: 'https://gitea.rknet.org/ansible/${DRONE_REPO_NAME}',
|
||||
target_branch: 'docs',
|
||||
username: {
|
||||
from_secret: 'gitea_username',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'trigger',
|
||||
image: 'plugins/downstream',
|
||||
settings: {
|
||||
fork: true,
|
||||
repositories: [
|
||||
'ansible/ansible-galaxy',
|
||||
],
|
||||
server: 'https://drone.rknet.org',
|
||||
token: {
|
||||
from_secret: 'drone_token',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
depends_on: [
|
||||
'build',
|
||||
],
|
||||
trigger: {
|
||||
ref: ['refs/heads/master', 'refs/tags/**'],
|
||||
},
|
||||
};
|
||||
|
||||
local PipelineNotifications = {
|
||||
kind: 'pipeline',
|
||||
name: 'notifications',
|
||||
@ -128,7 +175,7 @@ local PipelineNotifications = {
|
||||
},
|
||||
],
|
||||
depends_on: [
|
||||
'build',
|
||||
'documentation',
|
||||
],
|
||||
trigger: {
|
||||
ref: ['refs/heads/master', 'refs/tags/**'],
|
||||
@ -140,5 +187,6 @@ local PipelineNotifications = {
|
||||
PipelineLint,
|
||||
PipelineTest,
|
||||
PipelineBuild,
|
||||
PipelineDocumentation,
|
||||
PipelineNotifications,
|
||||
]
|
||||
|
43
.drone.yml
43
.drone.yml
@ -128,6 +128,45 @@ trigger:
|
||||
depends_on:
|
||||
- test
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: documentation
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: publish
|
||||
image: plugins/gh-pages
|
||||
settings:
|
||||
netrc_machine: gitea.rknet.org
|
||||
pages_directory: docs/
|
||||
password:
|
||||
from_secret: gitea_token
|
||||
remote_url: https://gitea.rknet.org/ansible/${DRONE_REPO_NAME}
|
||||
target_branch: docs
|
||||
username:
|
||||
from_secret: gitea_username
|
||||
|
||||
- name: trigger
|
||||
image: plugins/downstream
|
||||
settings:
|
||||
fork: true
|
||||
repositories:
|
||||
- ansible/ansible-galaxy
|
||||
server: https://drone.rknet.org
|
||||
token:
|
||||
from_secret: drone_token
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
- refs/tags/**
|
||||
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: notifications
|
||||
@ -159,10 +198,10 @@ trigger:
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- build
|
||||
- documentation
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: a9bdb4a4a7aaab0c2a68a9c5f48ad4fcd0172a41f299ab7efff9917522ccae77
|
||||
hmac: 6577f5addbd95475811bbdc61f8d02528ad73703e4b7c598afd4a7e8e827327f
|
||||
|
||||
...
|
||||
|
9
_index.md
Normal file
9
_index.md
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
title: Filters
|
||||
geekdocFlatSection: true
|
||||
---
|
||||
|
||||
Collection of some useful custom Jinja2 filters for Ansible.
|
||||
|
||||
{{< toc-tree >}}
|
||||
|
26
prefix.md
Normal file
26
prefix.md
Normal file
@ -0,0 +1,26 @@
|
||||
Simple filter to prefix all items from a list. Default prefix will be `--` but you can also pass a custom one.
|
||||
|
||||
## Example
|
||||
|
||||
```Yaml
|
||||
my_list:
|
||||
- item1
|
||||
- item2
|
||||
|
||||
{{ my_list | prefix | join(' ') }}
|
||||
|
||||
# result:
|
||||
# "--item1 --item2"
|
||||
```
|
||||
|
||||
Or pass a custom prefix:
|
||||
```Yaml
|
||||
my_list:
|
||||
- item1
|
||||
- item2
|
||||
|
||||
{{ my_list | prefix(prefix='-') | join(' ') }}
|
||||
|
||||
# result:
|
||||
# "-item1 -item2"
|
||||
```
|
26
wrap.md
Normal file
26
wrap.md
Normal file
@ -0,0 +1,26 @@
|
||||
Simple filter to wrap all items form a list. Default will wrap items in single quotes but you can also pass a custom wrapper character.
|
||||
|
||||
## Example
|
||||
|
||||
```Yaml
|
||||
my_list:
|
||||
- item1
|
||||
- item2
|
||||
|
||||
{{ my_list | wrap | join(',') }}
|
||||
|
||||
# result:
|
||||
# "'item1','item2'"
|
||||
```
|
||||
|
||||
Or pass a custom wrapper:
|
||||
```Yaml
|
||||
my_list:
|
||||
- item1
|
||||
- item2
|
||||
|
||||
{{ my_list | wrap(wrapper='/') | join(',') }}
|
||||
|
||||
# result:
|
||||
# "/item1/,/item2/"
|
||||
```
|
Loading…
Reference in New Issue
Block a user