Due to performance issues, shared runners are currently unavailable. They should come back later today.

Verified Commit 84bbe912 authored by Sheogorath's avatar Sheogorath 🛫

Add CI pipeline

parent 42a1efc2
image: quay.io/sheogorath/ubuntu-ci:18.04
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build-master:
stage: build
variables:
DOCKER_HOST: "tcp://docker:2375"
TOR_VERSION: "0.3.5.8"
script:
- docker build --pull --build-arg TOR_VERSION="$TOR_VERSION" -t "tor:testing" .
- ./tools/tagging.sh "$CI_REGISTRY_IMAGE" "${TOR_VERSION:-latest}" ""
- docker images --format "{{.Repository}}:{{.Tag}}" "$CI_REGISTRY_IMAGE" | xargs -L 1 docker push
only:
- master
tags:
- docker
build:
stage: build
variables:
DOCKER_HOST: "tcp://docker:2375"
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
#!/bin/sh
if [ "$1" = "--help" ]; then
echo "
Usage of $0:
$0 <PREFIX> <VERSION> <SUFFIX>
Example:
$0 tor 2.0.24 alpine
"
fi
PREFIX=${1:-tor}
VERSION=${2}
[ "${3}" != "" ] && [ "${3}" != "debian" ] && SUFFIX="-${3}"
if [ "$VERSION" != "" ]; then
docker tag tor:testing "$PREFIX:$(echo "${VERSION}" | sed -e 's/^v//' | cut -d. -f1)${SUFFIX}"
docker tag tor:testing "$PREFIX:$(echo "${VERSION}" | sed -e 's/^v//' | cut -d. -f1-2)${SUFFIX}"
docker tag tor:testing "$PREFIX:$(echo "${VERSION}" | sed -e 's/^v//' | cut -d. -f1-3)${SUFFIX}"
[ "$SUFFIX" = "" ] && docker tag tor:testing "$PREFIX:latest"
else
echo "No version provided. Skipping tagging..."
fi
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