xoxys.homeassistant_docker/.drone.jsonnet

111 lines
2.5 KiB
Plaintext
Raw Normal View History

2019-04-27 11:52:50 +00:00
local AnsibleVersions(version="latest", package="ansible") = {
name: "ansible-" + version,
image: "python:3.7",
pull: "always",
environment: {
PY_COLORS: 1
},
commands: [
2019-05-19 14:25:22 +00:00
"pip install " + package + " ansible-later~=0.2.0 -qq",
2019-04-27 11:52:50 +00:00
"git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy",
"ansible-later -c ~/policy/config.yml"
2019-04-27 11:52:50 +00:00
],
depends_on: [
"clone",
],
};
local PipelineLinting = {
kind: "pipeline",
name: "linting",
platform: {
os: "linux",
arch: "amd64",
},
steps: [
AnsibleVersions(version="latest", package="ansible"),
AnsibleVersions(version="master", package="git+https://github.com/ansible/ansible.git@devel"),
],
trigger: {
ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"],
},
};
local PipelineDeployment = {
kind: "pipeline",
name: "deployment",
platform: {
os: "linux",
arch: "amd64",
},
workspace: {
base: "/drone/src",
2019-09-23 10:52:32 +00:00
path: "xoxys.homeassistant",
},
concurrency: {
limit: 1,
2019-04-27 11:52:50 +00:00
},
steps: [
{
name: "molecule",
2019-09-23 10:49:21 +00:00
image: "xoxys/molecule:do-linux-amd64",
2019-04-27 11:52:50 +00:00
pull: "always",
environment: {
2019-09-23 10:49:21 +00:00
DO_API_KEY: { "from_secret": "do_api_key" },
USER: "root",
2019-04-27 11:52:50 +00:00
MOLECULE_CUSTOM_MODULES_REPO: "https://gitea.rknet.org/ansible/custom_modules",
2019-05-19 14:25:22 +00:00
MOLECULE_CUSTOM_FILTERS_REPO: "https://gitea.rknet.org/ansible/custom_filters",
2019-04-27 11:52:50 +00:00
PY_COLORS: 1
},
commands: [
"/bin/bash /docker-entrypoint.sh",
2019-09-23 10:58:26 +00:00
"molecule test -s default",
2019-04-27 11:52:50 +00:00
],
},
],
depends_on: [
"linting",
],
trigger: {
ref: ["refs/heads/master", "refs/tags/**"],
},
};
local PipelineNotifications = {
kind: "pipeline",
name: "notifications",
platform: {
os: "linux",
arch: "amd64",
},
2019-05-19 14:25:22 +00:00
clone: {
disable: true,
},
2019-04-27 11:52:50 +00:00
steps: [
{
name: "matrix",
image: "plugins/matrix",
settings: {
homeserver: "https://matrix.rknet.org",
roomid: "MtidqQXWWAtQcByBhH:rknet.org",
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" },
},
},
],
depends_on: [
"deployment",
],
trigger: {
status: [ "success", "failure" ],
ref: ["refs/heads/master", "refs/tags/**"],
},
};
[
PipelineLinting,
PipelineDeployment,
PipelineNotifications,
]