Commit 1c19f56f authored by David Diederich's avatar David Diederich
Browse files

Added Dockerfile and CI/CD Pipeline

parent 9cfd3b4c
# Required Project Variables:
# DOCKER_HUB_ACCOUNT The name of the account to publish under (could be a username or an organization)
# DOCKER_HUB_USER The username to use for authenticating with DockerHub
# DOCKER_HUB_PASSWORD The password (or access token) for authenticating with DockerHub
# --------------------------------------------------------------------------------
image: docker:19.03
stages:
- build
# --------------------------------------------------------------------------------
incremental:
stage: build
tags: ['docker-runner']
variables:
SHA_IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $SHA_IMAGE_TAG .
- docker push $SHA_IMAGE_TAG
release:
stage: build
tags: ['docker-runner']
only: ['tags']
variables:
RELEASE_IMAGE_TAG: $DOCKER_HUB_ACCOUNT/$CI_PROJECT_NAME:$CI_COMMIT_TAG
script:
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker build -t $RELEASE_IMAGE_TAG .
- docker push $RELEASE_IMAGE_TAG
FROM alpine
RUN apk add bash curl wget
RUN curl https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash
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