Browse Source

Add DroneCI config for build Docker image

tags/9.10.0^2
Victor Laborie 1 year ago
parent
commit
8314053506
2 changed files with 56 additions and 0 deletions
  1. +36
    -0
      .drone.yml
  2. +20
    -0
      Dockerfile

+ 36
- 0
.drone.yml View File

@@ -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


+ 20
- 0
Dockerfile View File

@@ -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"]

Loading…
Cancel
Save