Inital commit for gitlab-runner
This commit is contained in:
commit
a726d9f9bd
2 changed files with 52 additions and 0 deletions
38
.gitlab-ci.yml
Normal file
38
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
image: quay.io/sheogorath/ubuntu-ci:18.04
|
||||
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
build-master:
|
||||
stage: build
|
||||
variables:
|
||||
DOCKER_HOST: "tcp://docker:2375"
|
||||
LANG: C.UTF-8
|
||||
before_script:
|
||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||
script:
|
||||
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
|
||||
- docker push "$CI_REGISTRY_IMAGE"
|
||||
only:
|
||||
- master
|
||||
tags:
|
||||
- docker
|
||||
|
||||
build:
|
||||
stage: build
|
||||
variables:
|
||||
DOCKER_HOST: "tcp://docker:2375"
|
||||
LANG: C.UTF-8
|
||||
before_script:
|
||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||
script:
|
||||
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
|
||||
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
||||
except:
|
||||
- master
|
||||
tags:
|
||||
- docker
|
14
Dockerfile
Normal file
14
Dockerfile
Normal file
|
@ -0,0 +1,14 @@
|
|||
FROM gitlab/gitlab-runner:latest
|
||||
|
||||
RUN true \
|
||||
&& apt-get update \
|
||||
&& apt-get upgrade \
|
||||
&& apt-get install sudo \
|
||||
&& true
|
||||
|
||||
RUN true \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y software-properties-common \
|
||||
&& apt-add-repository --yes --update ppa:ansible/ansible \
|
||||
&& apt-get install -y ansible
|
||||
&& true
|
Reference in a new issue