Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a0f9344d25 | ||
|
3bef50d569 | ||
|
05e533e0fd | ||
|
b4fd617e7e | ||
|
1967ccebda | ||
|
7c74cbf76e | ||
|
4bbc2fb76b | ||
|
025abc9d8e |
@ -1,25 +1,42 @@
|
||||
image: leenooks/ci-docker:latest
|
||||
image: docker:latest
|
||||
|
||||
stages:
|
||||
- test
|
||||
- build
|
||||
|
||||
services:
|
||||
- leenooks/ci-docker:dind
|
||||
|
||||
variables:
|
||||
REGISTRY: registry.leenooks.net
|
||||
IMAGE: leenooks/base
|
||||
VERSION: "7"
|
||||
CACHETAG: build
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
before_script:
|
||||
- docker info
|
||||
- docker version
|
||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${REGISTRY}
|
||||
- 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:
|
||||
- docker build -t ${IMAGE} .
|
||||
- docker tag ${IMAGE} ${REGISTRY}/${IMAGE}
|
||||
- docker push ${REGISTRY}/${IMAGE}
|
||||
- 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
|
||||
- x86_64
|
||||
only:
|
||||
- c7
|
||||
|
@ -1,9 +1,7 @@
|
||||
# NAME leenooks/base
|
||||
# VERSION latest
|
||||
# BUILD docker build -t="leenooks/base" .
|
||||
# VERSION 7
|
||||
|
||||
FROM centos:latest
|
||||
MAINTAINER deon@leenooks.net
|
||||
FROM centos:7
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
|
||||
RUN yum -y install http://yum.leenooks.net/repo-7.rpm && yum -y update && yum clean all && rm -rf /var/tmp/*
|
||||
RUN yum -y install http://yum.leenooks.net/repo-7.rpm epel-release && yum clean all && rm -rf /var/tmp/*
|
||||
|
Reference in New Issue
Block a user