build ec2 variant
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2019-05-11 23:50:00 +02:00
parent 76a74cc43b
commit 8ea5ac41a8
7 changed files with 99 additions and 2 deletions

View File

@ -95,7 +95,9 @@ local PipelineNotifications(depends_on=[]) = {
[ [
PipelineBuild(os='linux', arch='amd64', version='gce'), PipelineBuild(os='linux', arch='amd64', version='gce'),
PipelineBuild(os='linux', arch='amd64', version='ec2'),
PipelineNotifications(depends_on=[ PipelineNotifications(depends_on=[
"gce-linux-amd64" "gce-linux-amd64",
"ec2-linux-amd64"
]) ])
] ]

View File

@ -36,6 +36,44 @@ steps:
branch: branch:
- master - master
---
kind: pipeline
name: ec2-linux-amd64
platform:
os: linux
arch: amd64
steps:
- name: dryrun
pull: always
image: plugins/docker:linux-amd64
settings:
dockerfile: docker/Dockerfile.ec2.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: xoxys/molecule
tags: ec2-linux-amd64
username:
from_secret: docker_username
- name: publish
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true
auto_tag_suffix: ec2-linux-amd64
dockerfile: docker/Dockerfile.ec2.linux.amd64
password:
from_secret: docker_password
repo: xoxys/molecule
username:
from_secret: docker_username
when:
branch:
- master
--- ---
kind: pipeline kind: pipeline
name: notifications name: notifications
@ -89,5 +127,6 @@ trigger:
depends_on: depends_on:
- gce-linux-amd64 - gce-linux-amd64
- ec2-linux-amd64
... ...

View File

@ -0,0 +1,41 @@
FROM python:3.7-alpine
LABEL maintainer="Robert Kaussow <mail@geeklabor.de>" \
org.label-schema.name="molecule" \
org.label-schema.vcs-url="https://gitea.rknet.org/docker/molecule" \
org.label-schema.vendor="Robert Kaussow" \
org.label-schema.schema-version="1.0"
ENV PACKAGES="\
gcc \
make \
bash \
libffi-dev \
musl-dev \
openssl-dev \
python-dev \
git \
openssh-client \
"
ENV PIP_PACKAGES="\
molecule[ec2] \
virtualenv \
apache-libcloud \
pycrypto \
"
COPY ./ec2-entrypoint.sh /docker-entrypoint.sh
RUN \
apk update \
&& apk add --update --no-cache ${PACKAGES} \
&& rm -rf /var/cache/apk/* \
&& pip install --upgrade pip \
&& pip install --no-cache-dir ${PIP_PACKAGES} \
&& rm -rf /root/.cache \
&& mkdir /root/.ssh \
&& chmod 700 /root/.ssh
USER root
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@ -25,7 +25,7 @@ ENV PIP_PACKAGES="\
pycrypto \ pycrypto \
" "
COPY ./docker-entrypoint.sh / COPY ./gce-entrypoint.sh /docker-entrypoint.sh
RUN \ RUN \
apk update \ apk update \

View File

@ -5,3 +5,8 @@ manifests:
platform: platform:
architecture: amd64 architecture: amd64
os: linux os: linux
-
image: xoxys/molecule:ec2-linux-amd64
platform:
architecture: amd64
os: linux

10
ec2-entrypoint.sh Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -o pipefail
set -o errtrace
set -o nounset
set -o errexit
if [ "$EC2_SSH_KEY" ]; then
echo "$EC2_SSH_KEY" > $HOME/.ssh/ec2_key
chmod 600 $HOME/.ssh/ec2_key
fi