Terms of Service | Privacy Policy | Cookie Policy

Commit 679fa4d7 authored by Uwe Plonus's avatar Uwe Plonus

Initial commit

parents
Pipeline #1323 passed with stages
in 15 minutes and 51 seconds
image: docker:stable
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
stages:
- build
- test
- deploy
variables:
TEST_IMAGE: ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}:test
DEPLOY_IMAGE: ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}
build:
stage: build
script:
- docker build -f Dockerfile -t ${TEST_IMAGE} --build-arg CI_REGISTRY=${CI_REGISTRY} --no-cache=true .
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${TEST_IMAGE}
- docker push ${TEST_IMAGE}
test_os:
stage: test
script:
- docker run --rm ${TEST_IMAGE} bash -c "apt-get update && apt-get -y upgrade"
test_golang:
stage: test
script:
- docker run --rm ${TEST_IMAGE} bash -c "go version"
deploy:
stage: deploy
script:
- docker pull ${TEST_IMAGE}
- docker tag ${TEST_IMAGE} ${DEPLOY_IMAGE}:latest
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker push ${DEPLOY_IMAGE}:latest
- docker tag ${TEST_IMAGE} ${DEPLOY_IMAGE}:$(date +%Y%m%d)
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker push ${DEPLOY_IMAGE}:$(date +%Y%m%d)
only:
- master
ARG CI_REGISTRY
FROM debian:buster-backports
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install golang
This diff is collapsed.
# Introduction
This project creates a docker image with golang installed.
The image can be used to run go builds.
This repository is mirrored to https://gitlab.com/sw4j-net/golang
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment