From 8bea3099068372166df84fc8ae078b9c2588ee1a Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 19 Oct 2018 21:05:45 +1100 Subject: [PATCH] Initial Revision --- .gitlab-ci.yml | 41 +++++++++++++++++++++++++++++++++++++++++ Dockerfile | 13 +++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..38887b8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,41 @@ +image: docker:latest + +stages: +- test +- build + +variables: + VERSION: latest + CACHETAG: build + DOCKER_HOST: tcp://${CI_REGISTRY}-leenooks-ci-docker:2375 + +services: +- ${CI_REGISTRY}/leenooks/ci-docker:dind + +before_script: +- docker info +- docker version +- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin + +test: + stage: test + script: + - cat /etc/hosts + - env|sort + - docker build -t ${CI_REGISTRY_IMAGE}:${VERSION} . + - docker images + only: + - debug + +build: + stage: build + script: + - if [ -f init ]; then chmod 500 init; fi + - docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true + - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . + - docker push ${CI_REGISTRY_IMAGE}:${VERSION} + - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} + tags: + - docker + only: + - master diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dede846 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +# NAME leenooks/ci-apt +# VERSION stretch-slim + +FROM debian:stretch-slim + +RUN apt-get update && apt-get install -y git \ + build-essential devscripts debhelper dh-make quilt \ + autoconf autotools-dev automake libtool \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +WORKDIR /build