From a50329945cd26e0fc1e38995913b12831655159c Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 19 May 2019 16:25:22 +0200 Subject: [PATCH] fix drone molecule pipeline --- .drone.jsonnet | 26 ++++++++++++++------------ .drone.yml | 35 +++++++++++++++++------------------ 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 28a0bb8..bca6ffe 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -6,7 +6,7 @@ local AnsibleVersions(version="latest", package="ansible") = { PY_COLORS: 1 }, commands: [ - "pip install " + package + " ansible-later -qq", + "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" ], @@ -45,24 +45,23 @@ local PipelineDeployment = { steps: [ { name: "molecule", - image: "xoxys/molecule:gce-linux-amd64", + image: "xoxys/molecule:ec2-linux-amd64", pull: "always", environment: { - GCE_SSH_KEY: { "from_secret": "gce_ssh_key" }, - GCE_SERVICE_ACCOUNT_EMAIL: { "from_secret": "gce_service_account_email" }, - GCE_PROJECT_ID: { "from_secret": "gce_project_id" }, - GCE_CREDENTIALS_JSON: { "from_secret": "gce_credentials_json" }, - GCE_SSH_USER: { "from_secret": "gce_ssh_user" }, - GCE_CREDENTIALS_FILE: "/root/ansible-testing.json", + ANSIBLE_ROLES_PATH: "/drone/src", + AWS_ACCESS_KEY_ID: { "from_secret": "aws_access_key_id" }, + AWS_SECRET_ACCESS_KEY: { "from_secret": "aws_secret_access_key" }, + AWS_REGION: "eu-central-1", MOLECULE_CUSTOM_MODULES_REPO: "https://gitea.rknet.org/ansible/custom_modules", + MOLECULE_CUSTOM_FILTERS_REPO: "https://gitea.rknet.org/ansible/custom_filters", PY_COLORS: 1 }, commands: [ "/bin/bash /docker-entrypoint.sh", - "molecule create --scenario-name gce-centos-7", - "molecule converge --scenario-name gce-centos-7", - "molecule verify --scenario-name gce-centos-7", - "molecule destroy --scenario-name gce-centos-7", + "molecule create --scenario-name ec2-centos-7", + "molecule converge --scenario-name ec2-centos-7", + "molecule verify --scenario-name ec2-centos-7", + "molecule destroy --scenario-name ec2-centos-7", ], }, ], @@ -81,6 +80,9 @@ local PipelineNotifications = { os: "linux", arch: "amd64", }, + clone: { + disable: true, + }, steps: [ { name: "matrix", diff --git a/.drone.yml b/.drone.yml index b3584a6..9c75489 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,7 +11,7 @@ steps: pull: always image: python:3.7 commands: - - pip install ansible ansible-later -qq + - 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: @@ -23,7 +23,7 @@ steps: pull: always image: python:3.7 commands: - - "pip install git+https://github.com/ansible/ansible.git@devel ansible-later -qq" + - "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: @@ -52,25 +52,21 @@ workspace: steps: - name: molecule pull: always - image: xoxys/molecule:gce-linux-amd64 + image: xoxys/molecule:ec2-linux-amd64 commands: - /bin/bash /docker-entrypoint.sh - - molecule create --scenario-name gce-centos-7 - - molecule converge --scenario-name gce-centos-7 - - molecule verify --scenario-name gce-centos-7 - - molecule destroy --scenario-name gce-centos-7 + - molecule create --scenario-name ec2-centos-7 + - molecule converge --scenario-name ec2-centos-7 + - molecule verify --scenario-name ec2-centos-7 + - molecule destroy --scenario-name ec2-centos-7 environment: - GCE_CREDENTIALS_FILE: /root/ansible-testing.json - GCE_CREDENTIALS_JSON: - from_secret: gce_credentials_json - GCE_PROJECT_ID: - from_secret: gce_project_id - GCE_SERVICE_ACCOUNT_EMAIL: - from_secret: gce_service_account_email - GCE_SSH_KEY: - from_secret: gce_ssh_key - GCE_SSH_USER: - from_secret: gce_ssh_user + ANSIBLE_ROLES_PATH: /drone/src + AWS_ACCESS_KEY_ID: + from_secret: aws_access_key_id + AWS_REGION: eu-central-1 + AWS_SECRET_ACCESS_KEY: + from_secret: aws_secret_access_key + MOLECULE_CUSTOM_FILTERS_REPO: https://gitea.rknet.org/ansible/custom_filters MOLECULE_CUSTOM_MODULES_REPO: https://gitea.rknet.org/ansible/custom_modules PY_COLORS: 1 @@ -90,6 +86,9 @@ platform: os: linux arch: amd64 +clone: + disable: true + steps: - name: matrix image: plugins/matrix