diff --git a/.drone.jsonnet b/.drone.jsonnet index 37769eb..53b22ae 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -15,6 +15,9 @@ local PipelineBuild(arch='amd64') = { repo: 'xoxys/molecule', username: { from_secret: 'docker_username' }, password: { from_secret: 'docker_password' }, + build_args: { + MOLECULE_VERSION: "${DRONE_TAG%-*}", + }, }, when: { ref: [ @@ -32,6 +35,9 @@ local PipelineBuild(arch='amd64') = { repo: 'xoxys/molecule', username: { from_secret: 'docker_username' }, password: { from_secret: 'docker_password' }, + build_args: { + MOLECULE_VERSION: "${DRONE_TAG%-*}", + }, }, when: { ref: [ diff --git a/Dockerfile b/Dockerfile index b70e371..e2a589c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,7 @@ 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_MAJOR="${MOLECULE_VERSION%%.*}" && \ pip install -qq --no-cache-dir -r /root/requirements.txt && \ if [ -z "${MOLECULE_MAJOR//[0-9]}" ] && [ -n "$MOLECULE_MAJOR" ]; then \