Commit d860b294 authored by Sheogorath's avatar Sheogorath 🎓

Merge branch 'refactor/ci' into 'master'

Refactor gitlab CI integration

See merge request !6
parents dbc5a327 71cfc603
Pipeline #1677 passed with stages
in 4 minutes and 31 seconds
image: quay.io/sheogorath/ubuntu-ci:18.04
services:
- docker:dind
image: quay.io/sheogorath/build-ah-engine
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
stages:
- analyse
- build
- test
- tag
- deploy
build-master:
build:
stage: build
script:
- podman build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
testing:
stage: test
before_script:
- dnf install -y jq
- export CONTAINER_FILE="$(mktemp)"
- rm "$CONTAINER_FILE"
script:
- podman run -d -p 8053:8053 --cidfile="$CONTAINER_FILE" "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
- curl http://localhost:8053/dns-query\?name\=ci-test.dns.shivering-isles.com\&type\=A 2>/dev/null | jq '.Answer[].data' | grep -q '"127.0.0.123"'
- 'podman stop "$(cat "$CONTAINER_FILE")" && podman rm "$(cat "$CONTAINER_FILE")" && rm "$CONTAINER_FILE"'
- podman run -d -p 8053:8053 --cidfile="$CONTAINER_FILE" -e UPSTREAM_NAME="ci-upstream.dns.shivering-isles.com" "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
- curl http://localhost:8053/dns-query\?name\=ci-test.dns.shivering-isles.com\&type\=A 2>/dev/null | jq '.Answer[].data' | grep -q '"127.0.0.123"'
- 'podman stop "$(cat "$CONTAINER_FILE")" && podman rm "$(cat "$CONTAINER_FILE")" && rm "$CONTAINER_FILE"'
tagging-master:
stage: tag
variables:
DOCKER_HOST: "tcp://docker:2375"
DOH_VERSION: "2.2.1"
script:
- docker build --pull --build-arg VERSION="v${DOH_VERSION}" -t "doh:testing" .
- ./tools/tagging.sh "$CI_REGISTRY_IMAGE" "${DOH_VERSION:-latest}" ""
- docker images --format "{{.Repository}}:{{.Tag}}" "$CI_REGISTRY_IMAGE" | xargs -L 1 docker push
- podman pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
- si-tagging -l "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" "$CI_REGISTRY_IMAGE" "${DOH_VERSION}"
- podman images --format "{{.Repository}}:{{.Tag}}" "$CI_REGISTRY_IMAGE" | grep "$CI_REGISTRY_IMAGE" | xargs -L 1 podman 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
......@@ -33,7 +33,7 @@ path = "/dns-query"
# Upstream DNS resolver
# If multiple servers are specified, a random one will be chosen each time.
upstream = [
$(echo "${UPSTREAM:-1.1.1.1:53|1.0.0.1:53|8.8.8.8:53|8.8.4.4:53}" | sed -e 's/^/"udp:/' -e 's/$/"/' -e 's/|/",\n"/g')
$(echo "${UPSTREAM:-1.1.1.1:53|1.0.0.1:53|8.8.8.8:53|8.8.4.4:53}" | sed -e 's/^/"udp:/' -e 's/$/"/' -e 's/|/",\n"udp:/g')
]
# Upstream timeout
......
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