...
 
Commits (2)
......@@ -14,4 +14,7 @@ share/
include/
lib/
share/
var/
\ No newline at end of file
var/
.gitlab-ci.yml
.bumpversion.cfg
.flake8
......@@ -4,6 +4,7 @@ variables:
stages:
- lint
- test
- build
- upload
- build_image
......@@ -50,6 +51,24 @@ upload:
- master@noc/tower
- tags@noc/tower
check_docker_buildable_debian:
stage: test
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build -t ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID} -f contrib/docker/Dockerfile .
#- timeout --preserve-status -s 9 30 docker run ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}
tags:
- shell
check_docker_buildable_alpine:
stage: test
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build -t ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID} -f contrib/docker/Dockerfile.alpine .
#- timeout --preserve-status -s 9 30 docker run ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}
tags:
- shell
build_image_debian:
stage: build
before_script:
......@@ -57,7 +76,7 @@ build_image_debian:
- export CONTAINER_NAME=${CI_REGISTRY_IMAGE}:${CI_BUILD_REF_NAME}
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build -t $CONTAINER_NAME .
- docker build -t $CONTAINER_NAME -f contrib/docker/Dockerfile .
- docker push $CONTAINER_NAME
- if [ -n "${CI_BUILD_TAG}" ]; then docker tag $CONTAINER_NAME ${CI_REGISTRY_IMAGE}:${CI_BUILD_TAG}; docker push $CI_REGISTRY_IMAGE:${CI_BUILD_TAG}; fi
- if [ -n "${CI_BUILD_TAG}" ]; then docker tag $CONTAINER_NAME ${CI_REGISTRY_IMAGE}:latest; docker push ${CI_REGISTRY_IMAGE}:latest; fi
......@@ -74,7 +93,7 @@ build_image_alpine:
- export CONTAINER_NAME=${CI_REGISTRY_IMAGE}:${CI_BUILD_REF_NAME}_alpine
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build -t $CONTAINER_NAME -f Dockerfile.alpine .
- docker build -t $CONTAINER_NAME -f contrib/docker/Dockerfile.alpine .
- docker push $CONTAINER_NAME
- if [ -n "${CI_BUILD_TAG}" ]; then docker tag $CONTAINER_NAME ${CI_REGISTRY_IMAGE}:${CI_BUILD_TAG}_alpine; docker push $CI_REGISTRY_IMAGE:${CI_BUILD_TAG}_alpine; fi
- if [ -n "${CI_BUILD_TAG}" ]; then docker tag $CONTAINER_NAME ${CI_REGISTRY_IMAGE}:alpine; docker push ${CI_REGISTRY_IMAGE}:alpine; fi
......@@ -82,4 +101,4 @@ build_image_alpine:
- shell
only:
- master@noc/tower
- tags@noc/tower
\ No newline at end of file
- tags@noc/tower
......@@ -9,7 +9,7 @@ WORKDIR /opt/tower
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential
RUN virtualenv /opt/tower \
&& ./bin/pip install ansible==2.7 \
&& ./bin/pip install ansible==2.7.11 \
&& ./bin/pip install /mnt/tower/dist/*.zip
FROM debian:latest as app
......@@ -42,7 +42,7 @@ RUN apt-get update \
WORKDIR /opt/tower
COPY entrypoint.sh /
COPY contrib/docker/entrypoint.sh /
STOPSIGNAL SIGINT
......
FROM alpine:3.6 as builder
FROM alpine:3.9 as builder
RUN mkdir /mnt/tower
WORKDIR /mnt/tower/
RUN apk add --update py2-cffi py-virtualenv gcc python-dev musl-dev libffi-dev openssl-dev ca-certificates make
RUN apk add --no-cache --update \
py2-cffi \
py-virtualenv \
gcc \
python-dev \
musl-dev \
libffi-dev \
openssl-dev \
ca-certificates \
make
COPY . /mnt/tower/
RUN python setup.py sdist --format=zip
WORKDIR /opt/tower
RUN virtualenv /opt/tower \
&& ./bin/pip install ansible==2.6.3 \
&& ./bin/pip install ansible==2.7.11 \
&& ./bin/pip install /mnt/tower/dist/*.zip
FROM python:2.7-alpine3.6
FROM python:2.7-alpine3.9
ENV ANSIBLE_HOST_KEY_CHECKING=False \
ANSIBLE_SSH_PIPELINING=1 \
......@@ -24,11 +33,19 @@ ENV ANSIBLE_HOST_KEY_CHECKING=False \
COPY --from=builder /opt/tower /opt/tower
# install systemv packages
RUN apk add --update ca-certificates openssh-client vim sqlite curl git libffi openssl
RUN apk add --no-cache --update \
ca-certificates \
openssh-client \
vim \
sqlite \
curl \
git \
libffi \
openssl
WORKDIR /opt/tower
COPY entrypoint-alpine.sh /entrypoint.sh
COPY contrib/docker/entrypoint-alpine.sh /entrypoint.sh
STOPSIGNAL SIGINT
......
# docker related files
Used to build and run docker images for tower