This commit is contained in:
parent
1a1873c77a
commit
ad8452b3d4
@ -1,20 +1,3 @@
|
||||
local AnsibleVersions(version="latest", package="ansible") = {
|
||||
name: "ansible-" + version,
|
||||
image: "python:3.7",
|
||||
pull: "always",
|
||||
environment: {
|
||||
PY_COLORS: 1
|
||||
},
|
||||
commands: [
|
||||
"pip install " + package + " ansible-later~=0.2.0 -qq",
|
||||
"git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy",
|
||||
"ansible-later -c ~/policy/config.yml"
|
||||
],
|
||||
depends_on: [
|
||||
"clone",
|
||||
],
|
||||
};
|
||||
|
||||
local PipelineLinting = {
|
||||
kind: "pipeline",
|
||||
name: "linting",
|
||||
@ -23,8 +6,17 @@ local PipelineLinting = {
|
||||
arch: "amd64",
|
||||
},
|
||||
steps: [
|
||||
AnsibleVersions(version="latest", package="ansible"),
|
||||
AnsibleVersions(version="master", package="git+https://github.com/ansible/ansible.git@devel"),
|
||||
{
|
||||
name: "ansible-later",
|
||||
image: "xoxys/ansible-later:latest",
|
||||
environment: {
|
||||
PY_COLORS: 1
|
||||
},
|
||||
commands: [
|
||||
"git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy",
|
||||
"ansible-later -c ~/policy/config.yml"
|
||||
],
|
||||
},
|
||||
],
|
||||
trigger: {
|
||||
ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"],
|
||||
@ -38,15 +30,17 @@ local PipelineDeployment = {
|
||||
os: "linux",
|
||||
arch: "amd64",
|
||||
},
|
||||
concurrency: {
|
||||
limit: 1
|
||||
},
|
||||
workspace: {
|
||||
base: "/drone/src",
|
||||
path: "xoxys.droneci"
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: "molecule",
|
||||
name: "ansible-molecule",
|
||||
image: "xoxys/molecule:do-linux-amd64",
|
||||
pull: "always",
|
||||
environment: {
|
||||
DO_API_KEY: { "from_secret": "do_api_key" },
|
||||
USER: "root",
|
||||
@ -68,9 +62,55 @@ local PipelineDeployment = {
|
||||
},
|
||||
};
|
||||
|
||||
local PipelineNotifications = {
|
||||
local PipelineDocumentation = {
|
||||
kind: "pipeline",
|
||||
name: "notifications",
|
||||
name: "documentation",
|
||||
platform: {
|
||||
os: "linux",
|
||||
arch: "amd64",
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: "ansible-doctor",
|
||||
image: "xoxys/ansible-doctor:latest",
|
||||
environment: {
|
||||
ANSIBLE_DOCTOR_LOG_LEVEL: "INFO",
|
||||
ANSIBLE_DOCTOR_FORCE_OVERWRITE: true,
|
||||
ANSIBLE_DOCTOR_EXCLUDE_FILES: "molecule/",
|
||||
ANSIBLE_DOCTOR_CUSTOM_HEADER: "HEADER.md",
|
||||
PY_COLORS: 1
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "push-to-repo",
|
||||
image: "plugins/git-action:latest",
|
||||
settings: {
|
||||
actions: ["commit", "push"],
|
||||
author_email: "shipper@rknet.org",
|
||||
author_name: "DroneShipper",
|
||||
branch: "master",
|
||||
message: "[SKIP CI] update readme",
|
||||
remote: "https://gitea.rknet.org/ansible/xoxys.droneci",
|
||||
netrc_machine: "gitea.rknet.org",
|
||||
netrc_username: {"from_secret": "gitea_username"},
|
||||
netrc_password: {"from_secret": "gitea_token"},
|
||||
},
|
||||
when: {
|
||||
ref: ["refs/heads/master"],
|
||||
},
|
||||
},
|
||||
],
|
||||
depends_on: [
|
||||
"deployment",
|
||||
],
|
||||
trigger: {
|
||||
ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"],
|
||||
},
|
||||
};
|
||||
|
||||
local PipelineNotification= {
|
||||
kind: "pipeline",
|
||||
name: "notification",
|
||||
platform: {
|
||||
os: "linux",
|
||||
arch: "amd64",
|
||||
@ -83,8 +123,8 @@ local PipelineNotifications = {
|
||||
name: "matrix",
|
||||
image: "plugins/matrix",
|
||||
settings: {
|
||||
homeserver: "https://matrix.rknet.org",
|
||||
roomid: "MtidqQXWWAtQcByBhH:rknet.org",
|
||||
homeserver: { "from_secret": "matrix_homeserver" },
|
||||
roomid: { "from_secret": "matrix_roomid" },
|
||||
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}",
|
||||
username: { "from_secret": "matrix_username" },
|
||||
password: { "from_secret": "matrix_password" },
|
||||
@ -92,7 +132,7 @@ local PipelineNotifications = {
|
||||
},
|
||||
],
|
||||
depends_on: [
|
||||
"deployment",
|
||||
"documentation",
|
||||
],
|
||||
trigger: {
|
||||
status: [ "success", "failure" ],
|
||||
@ -103,5 +143,6 @@ local PipelineNotifications = {
|
||||
[
|
||||
PipelineLinting,
|
||||
PipelineDeployment,
|
||||
PipelineNotifications,
|
||||
PipelineDocumentation,
|
||||
PipelineNotification,
|
||||
]
|
||||
|
85
.drone.yml
85
.drone.yml
@ -7,29 +7,13 @@ platform:
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: ansible-latest
|
||||
pull: always
|
||||
image: python:3.7
|
||||
- name: ansible-later
|
||||
image: xoxys/ansible-later:latest
|
||||
commands:
|
||||
- pip install ansible ansible-later~=0.2.0 -qq
|
||||
- git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy
|
||||
- ansible-later -c ~/policy/config.yml
|
||||
environment:
|
||||
PY_COLORS: 1
|
||||
depends_on:
|
||||
- clone
|
||||
|
||||
- name: ansible-master
|
||||
pull: always
|
||||
image: python:3.7
|
||||
commands:
|
||||
- "pip install git+https://github.com/ansible/ansible.git@devel ansible-later~=0.2.0 -qq"
|
||||
- git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy
|
||||
- ansible-later -c ~/policy/config.yml
|
||||
environment:
|
||||
PY_COLORS: 1
|
||||
depends_on:
|
||||
- clone
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
@ -45,13 +29,15 @@ platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
concurrency:
|
||||
limit: 1
|
||||
|
||||
workspace:
|
||||
base: /drone/src
|
||||
path: xoxys.droneci
|
||||
|
||||
steps:
|
||||
- name: molecule
|
||||
pull: always
|
||||
- name: ansible-molecule
|
||||
image: xoxys/molecule:do-linux-amd64
|
||||
commands:
|
||||
- /bin/bash /docker-entrypoint.sh
|
||||
@ -74,7 +60,54 @@ depends_on:
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: notifications
|
||||
name: documentation
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: ansible-doctor
|
||||
image: xoxys/ansible-doctor:latest
|
||||
environment:
|
||||
ANSIBLE_DOCTOR_CUSTOM_HEADER: HEADER.md
|
||||
ANSIBLE_DOCTOR_EXCLUDE_FILES: molecule/
|
||||
ANSIBLE_DOCTOR_FORCE_OVERWRITE: true
|
||||
ANSIBLE_DOCTOR_LOG_LEVEL: INFO
|
||||
PY_COLORS: 1
|
||||
|
||||
- name: push-to-repo
|
||||
image: plugins/git-action:latest
|
||||
settings:
|
||||
actions:
|
||||
- commit
|
||||
- push
|
||||
author_email: "shipper@rknet.org"
|
||||
author_name: DroneShipper
|
||||
branch: master
|
||||
message: "[SKIP CI] update readme"
|
||||
netrc_machine: gitea.rknet.org
|
||||
netrc_password:
|
||||
from_secret: gitea_token
|
||||
netrc_username:
|
||||
from_secret: gitea_username
|
||||
remote: https://gitea.rknet.org/ansible/xoxys.droneci
|
||||
when:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
- "refs/tags/**"
|
||||
- "refs/pull/**"
|
||||
|
||||
depends_on:
|
||||
- deployment
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: notification
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
@ -87,10 +120,12 @@ steps:
|
||||
- name: matrix
|
||||
image: plugins/matrix
|
||||
settings:
|
||||
homeserver: https://matrix.rknet.org
|
||||
homeserver:
|
||||
from_secret: matrix_homeserver
|
||||
password:
|
||||
from_secret: matrix_password
|
||||
roomid: MtidqQXWWAtQcByBhH:rknet.org
|
||||
roomid:
|
||||
from_secret: matrix_roomid
|
||||
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
|
||||
username:
|
||||
from_secret: matrix_username
|
||||
@ -104,10 +139,10 @@ trigger:
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- deployment
|
||||
- documentation
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: e9eabb9d399e38f77f8fb1a28ee5579922fd93dcb7c766573c6ea7e03e02661c
|
||||
hmac: 17f9b58b6ccc3675fe5d1b425680c2316f1a1d4002f35d3509dcb477c05c9b02
|
||||
|
||||
...
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,5 +9,3 @@ __pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# ---> Molecule
|
||||
.yamllint
|
||||
|
4
HEADER.md
Normal file
4
HEADER.md
Normal file
@ -0,0 +1,4 @@
|
||||
# xoxys.droneci
|
||||
|
||||
[![Build Status](https://drone.rknet.org/api/badges/ansible/xoxys.droneci/status.svg)](https://drone.rknet.org/ansible/xoxys.droneci)
|
||||
|
@ -4,8 +4,9 @@ droneci_service_directory: /var/lib/docker/services/drone-ci
|
||||
droneci_docker_socket_path: /var/run/docker.sock
|
||||
droneci_host: http://localhost
|
||||
droneci_secret: myveryownsecret
|
||||
# Path to the license key file
|
||||
# droneci_license_key: # defaults to not set
|
||||
|
||||
# @var droneci_license_key:description Path to the license key file
|
||||
# @var droneci_license_key: $ "_unset_"
|
||||
|
||||
droneci_restart_policy: always
|
||||
|
||||
@ -13,16 +14,25 @@ droneci_server_container_name: drone-server
|
||||
droneci_server_image: "drone/drone:{{ droneci_version }}"
|
||||
droneci_server_exposed_port: 8080
|
||||
droneci_server_exposed_ip: 127.0.0.1
|
||||
# droneci_server_memory_limit: 512m # defaults to not set
|
||||
# droneci_server_memory_reservation: 256m # defaults to not set
|
||||
# droneci_server_extra_hosts: []
|
||||
|
||||
# @var droneci_server_memory_limit: $ "_unset_"
|
||||
# @var droneci_server_memory_limit:example: 512m
|
||||
# @var droneci_server_memory_reservation: $ "_unset_"
|
||||
# @var droneci_server_memory_reservation:example: 256m
|
||||
|
||||
droneci_server_extra_hosts: []
|
||||
|
||||
droneci_server_privileged: False
|
||||
|
||||
droneci_agent_container_name: drone-agent
|
||||
droneci_agent_image: "drone/agent:{{ droneci_version }}"
|
||||
droneci_agent_capacity: 2
|
||||
# droneci_agent_memory_limit: 512m # defaults to not set
|
||||
# droneci_agent_memory_reservation: 256m # defaults to not set
|
||||
|
||||
# @var droneci_agent_memory_limit:example 512m
|
||||
# @var droneci_agent_memory_limit: $ "_unset_"
|
||||
# @var droneci_agent_memory_reservation:example 256m
|
||||
# @var droneci_agent_memory_reservation: $ "_unset_"
|
||||
|
||||
droneci_agent_privileged: False
|
||||
|
||||
droneci_postgres_enabled: False
|
||||
@ -63,16 +73,17 @@ droneci_postgres_user:
|
||||
droneci_gitea_enabled: False
|
||||
droneci_gitea_server: http://my-git.example.com
|
||||
droneci_gitea_skip_verify: False
|
||||
|
||||
# To enable gitea oauth set both
|
||||
# droneci_gitea_oauth_client_id: 1111-222-33333-44444 # defaults to not set
|
||||
# droneci_gitea_oauth_client_secret: 1234abcd5678efgh # defaults to not set
|
||||
|
||||
# droneci_admin: # defaults to not set
|
||||
# droneci_http_proxy: # defaults to not set
|
||||
# droneci_https_proxy: # defaults to not set
|
||||
# droneci_no_proxy: (see below)
|
||||
# - drone-server
|
||||
# - drone-agent
|
||||
# @var droneci_admin: $ "_unset_"
|
||||
# @var droneci_http_proxy: $ "_unset_"
|
||||
# @var droneci_https_proxy: $ "_unset_"
|
||||
|
||||
# @var droneci_no_proxy: $ ["drone-server", "drone-agent"]
|
||||
droneci_no_proxy: []
|
||||
|
||||
droneci_iptables_enabled: False
|
||||
droneci_open_ports:
|
||||
|
Loading…
Reference in New Issue
Block a user