From dea378c30342b1889ab9e5add7ae6a2bde30ecdd Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 22 Feb 2020 16:46:02 +0100 Subject: [PATCH] cleanup --- .drone.jsonnet | 10 +++++----- .drone.yml | 12 ++++++------ Dockerfile | 9 +++++---- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index f2fd3a0..addab7a 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -12,11 +12,11 @@ local PipelineBuild(arch='amd64') = { settings: { dry_run: true, dockerfile: 'Dockerfile', - repo: 'xoxys/molecule', + repo: 'xoxys/${DRONE_REPO_NAME}', username: { from_secret: 'docker_username' }, password: { from_secret: 'docker_password' }, build_args: [ - 'MOLECULE_VERSION=${DRONE_TAG%-*}', + 'BUILD_VERSION=${DRONE_TAG%-*}', ], }, when: { @@ -32,11 +32,11 @@ local PipelineBuild(arch='amd64') = { auto_tag: true, auto_tag_suffix: arch, dockerfile: 'Dockerfile', - repo: 'xoxys/molecule', + repo: 'xoxys/${DRONE_REPO_NAME}', username: { from_secret: 'docker_username' }, password: { from_secret: 'docker_password' }, build_args: [ - 'MOLECULE_VERSION=${DRONE_TAG%-*}', + 'BUILD_VERSION=${DRONE_TAG%-*}', ], }, when: { @@ -99,7 +99,7 @@ local PipelineNotifications(depends_on=[]) = { DOCKERHUB_USERNAME: { from_secret: 'docker_username' }, DOCKERHUB_PASSWORD: { from_secret: 'docker_password' }, DOCKERHUB_REPO_PREFIX: 'xoxys', - DOCKERHUB_REPO_NAME: 'molecule', + DOCKERHUB_REPO_NAME: '${DRONE_REPO_NAME}', README_PATH: 'README.md', SHORT_DESCRIPTION: 'Molecule - Automated Ansible roles testing', }, diff --git a/.drone.yml b/.drone.yml index 07c9950..e69fe89 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,12 +11,12 @@ steps: image: plugins/docker settings: build_args: - - MOLECULE_VERSION=${DRONE_TAG%-*} + - BUILD_VERSION=${DRONE_TAG%-*} dockerfile: Dockerfile dry_run: true password: from_secret: docker_password - repo: xoxys/molecule + repo: xoxys/${DRONE_REPO_NAME} username: from_secret: docker_username when: @@ -29,11 +29,11 @@ steps: auto_tag: true auto_tag_suffix: amd64 build_args: - - MOLECULE_VERSION=${DRONE_TAG%-*} + - BUILD_VERSION=${DRONE_TAG%-*} dockerfile: Dockerfile password: from_secret: docker_password - repo: xoxys/molecule + repo: xoxys/${DRONE_REPO_NAME} username: from_secret: docker_username when: @@ -86,7 +86,7 @@ steps: environment: DOCKERHUB_PASSWORD: from_secret: docker_password - DOCKERHUB_REPO_NAME: molecule + DOCKERHUB_REPO_NAME: ${DRONE_REPO_NAME} DOCKERHUB_REPO_PREFIX: xoxys DOCKERHUB_USERNAME: from_secret: docker_username @@ -126,6 +126,6 @@ depends_on: --- kind: signature -hmac: 3a7e5e7004cee14e0fe11fce0fc1e7033b5bb525e4066ad4cc10586d2fc54630 +hmac: 461d7541c6d7b1b46499d8d391ae5f9145845aa41e71787e0a79fea27803e4d1 ... diff --git a/Dockerfile b/Dockerfile index 980851c..ddd4e51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,12 +7,13 @@ LABEL maintainer="Robert Kaussow " \ org.label-schema.schema-version="1.0" ARG ANSIBLE_VERSION=2.9.0 -ARG MOLECULE_VERSION=latest +ARG BUILD_VERSION=latest ENV PY_COLORS=1 \ ANSIBLE_FORCE_COLOR=true \ USER=root \ - PATH=/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin + PATH=/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin \ + MOLECULE_VERSION="${BUILD_VERSION:-latest}" COPY overlay/ / @@ -25,11 +26,11 @@ RUN apk add --update --no-cache --virtual .build-deps gcc make libffi-dev musl-d pip install -qq --upgrade --no-cache-dir pip setuptools requests~=2.22.0 && \ pip install -qq --no-cache-dir ansible~="$ANSIBLE_VERSION" && \ echo "Installing requirements ..." && \ - MOLECULE_VERSION="${MOLECULE_VERSION#v}" && \ + MOLECULE_VERSION="${MOLECULE_VERSION##v}" && \ MOLECULE_MAJOR="${MOLECULE_VERSION%%.*}" && \ pip install -qq --no-cache-dir -r /root/requirements.txt && \ if [ -z "${MOLECULE_MAJOR//[0-9]}" ] && [ -n "$MOLECULE_MAJOR" ]; then \ - echo "Installing molecule 'v$MOLECULE_VERSION' ..." && \ + echo "Installing molecule version '$MOLECULE_VERSION' ..." && \ pip install -qq --no-cache-dir molecule~="$MOLECULE_VERSION"; \ else \ echo "Installing latest molecule ..." && \