You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.drone.jsonnet 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. local AnsibleVersions(version="latest", package="ansible") = {
  2. name: "ansible-" + version,
  3. image: "python:3.7",
  4. pull: "always",
  5. environment: {
  6. PY_COLORS: 1
  7. },
  8. commands: [
  9. "pip install " + package + " ansible-later~=0.2.0 -qq",
  10. "git clone https://gitea.rknet.org/ansible/ansible-later-policy.git ~/policy",
  11. "ansible-later -c ~/policy/config.yml"
  12. ],
  13. depends_on: [
  14. "clone",
  15. ],
  16. };
  17. local PipelineLinting = {
  18. kind: "pipeline",
  19. name: "linting",
  20. platform: {
  21. os: "linux",
  22. arch: "amd64",
  23. },
  24. steps: [
  25. AnsibleVersions(version="latest", package="ansible"),
  26. AnsibleVersions(version="master", package="git+https://github.com/ansible/ansible.git@devel"),
  27. ],
  28. trigger: {
  29. ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"],
  30. },
  31. };
  32. local PipelineDeployment = {
  33. kind: "pipeline",
  34. name: "deployment",
  35. platform: {
  36. os: "linux",
  37. arch: "amd64",
  38. },
  39. workspace: {
  40. base: "/drone/src",
  41. path: "xoxys.docker-engine"
  42. },
  43. steps: [
  44. {
  45. name: "molecule",
  46. image: "xoxys/molecule:ec2-linux-amd64",
  47. pull: "always",
  48. environment: {
  49. ANSIBLE_ROLES_PATH: "/drone/src",
  50. AWS_ACCESS_KEY_ID: { "from_secret": "aws_access_key_id" },
  51. AWS_SECRET_ACCESS_KEY: { "from_secret": "aws_secret_access_key" },
  52. AWS_REGION: "eu-central-1",
  53. MOLECULE_CUSTOM_MODULES_REPO: "https://gitea.rknet.org/ansible/custom_modules",
  54. MOLECULE_CUSTOM_FILTERS_REPO: "https://gitea.rknet.org/ansible/custom_filters",
  55. PY_COLORS: 1
  56. },
  57. commands: [
  58. "/bin/bash /docker-entrypoint.sh",
  59. "molecule test --scenario-name ec2-centos-7",
  60. ],
  61. },
  62. ],
  63. depends_on: [
  64. "linting",
  65. ],
  66. trigger: {
  67. ref: ["refs/heads/master", "refs/tags/**"],
  68. },
  69. };
  70. local PipelineNotifications = {
  71. kind: "pipeline",
  72. name: "notifications",
  73. platform: {
  74. os: "linux",
  75. arch: "amd64",
  76. },
  77. clone: {
  78. disable: true,
  79. },
  80. steps: [
  81. {
  82. name: "matrix",
  83. image: "plugins/matrix",
  84. settings: {
  85. homeserver: "https://matrix.rknet.org",
  86. roomid: "MtidqQXWWAtQcByBhH:rknet.org",
  87. template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}",
  88. username: { "from_secret": "matrix_username" },
  89. password: { "from_secret": "matrix_password" },
  90. },
  91. },
  92. ],
  93. depends_on: [
  94. "deployment",
  95. ],
  96. trigger: {
  97. status: [ "success", "failure" ],
  98. ref: ["refs/heads/master", "refs/tags/**"],
  99. },
  100. };
  101. [
  102. PipelineLinting,
  103. PipelineDeployment,
  104. PipelineNotifications,
  105. ]