diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..514a8b3f --- /dev/null +++ b/.drone.yml @@ -0,0 +1,36 @@ +kind: pipeline +name: default + +steps: +- name: build tagged docker image + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + dockerfile: Dockerfile + repo: evolix/ansible-roles + auto_tag: true + environment: + ROLES_VERSION: $DRONE_COMMIT_SHA + when: + event: + - tag + +- name: build latest docker image + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + dockerfile: Dockerfile + repo: evolix/ansible-roles + tags: latest + environment: + ROLES_VERSION: $DRONE_COMMIT_SHA + when: + branch: + - unstable + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..b65c62ab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM debian:stretch-slim + +ENV ROLES_VERSION=${ROLES_VERSION:-unstable} + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + git \ + ansible \ + && rm -rf /var/lib/apt/lists/* + +RUN ansible-galaxy install --force \ + --roles-path /etc/ansible \ + "git+https://gitea.evolix.org/evolix/ansible-roles.git,${ROLES_VERSION},roles" + +ENV ANSIBLE_FORCE_COLOR=1 +ENV ANSIBLE_HOST_KEY_CHECKING=false +ENV ANSIBLE_RETRY_FILES_ENABLED=false +ENV PYTHONUNBUFFERED=1 + +ENTRYPOINT ["ansible-playbook"]