summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schramm <tobleminer@gmail.com>2018-08-26 00:49:22 +0200
committerTobias Schramm <tobleminer@gmail.com>2018-08-26 00:49:22 +0200
commitac37eb5f7cdb51ed8eb7cbf73fd9cdf6955c42f2 (patch)
tree8618e527a4a62610a5347a6926ac076a9f1b3786
parent648bfee23370e17dc572eb51a38dd82105bb9c3f (diff)
Add deploy job
-rw-r--r--.gitlab-ci.yml16
-rw-r--r--.gitlab-ci/docker/Dockerfile3
-rwxr-xr-x.gitlab-ci/ffki-scripts/check-fastd-keys.sh40
m---------.gitlab-ci/ffki_scripts0
-rw-r--r--.gitmodules3
5 files changed, 10 insertions, 52 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ecd17c9..ed4bd76 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,12 +3,12 @@ variables:
GIT_SSL_CAPATH: /etc/ssl/certs/
CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/build
GATEWAYS: "vpn0 vpn6"
-
-image:
+ GATEWAY_DEPLOY_USER: mesh_vpn_ci_ffki
+ GATEWAY_HOST_vpn0: vpn0.freifunk.in-kiel.de
+ GATEWAY_HOST_vpn6: vpn6.freifunk.in-kiel.de
stages:
- container
-# - prepare
- validate
- deploy
@@ -25,20 +25,14 @@ docker:
- docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
- docker push $CONTAINER_IMAGE:latest
-#scripts:
-# stage: prepare
-# image: $CI_REGISTRY_IMAGE/build
-# script:
-# - git clone https://gitlab.toppoint.de/ffki/ffki-scripts.git ./gitlab-ci/ffki-scripts
-
validate:
stage: validate
image: $CI_REGISTRY_IMAGE/build
script:
- - ./.gitlab-ci/ffki-scripts/check-fastd-keys.sh
+ - ./.gitlab-ci/ffki_scripts/check-fastd-keys.sh
deploy:
stage: deploy
image: $CI_REGISTRY_IMAGE/build
script:
- - ./.gitlab-ci/deploy-fastd-keys.sh
+ - ./.gitlab-ci/ffki_scripts/deploy-fastd-keys.sh
diff --git a/.gitlab-ci/docker/Dockerfile b/.gitlab-ci/docker/Dockerfile
index af1d82a..e5fb5e1 100644
--- a/.gitlab-ci/docker/Dockerfile
+++ b/.gitlab-ci/docker/Dockerfile
@@ -2,4 +2,5 @@ FROM debian:stretch
RUN apt-get update && apt-get install -y \
git \
- openssh-client
+ openssh-client \
+ ansible
diff --git a/.gitlab-ci/ffki-scripts/check-fastd-keys.sh b/.gitlab-ci/ffki-scripts/check-fastd-keys.sh
deleted file mode 100755
index 97a7163..0000000
--- a/.gitlab-ci/ffki-scripts/check-fastd-keys.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-
-set -e -o pipefail
-
-KEYDIR=${1:-.}
-
-error() {
- ( >&2 echo $@ )
-}
-
-LINE_VALIDATORS=()
-LINE_VALIDATORS+=('key[[:space:]]+"[0-9a-f]{64}";')
-LINE_VALIDATORS+=('remote[[:space:]]+((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):[0-9]+;')
-LINE_VALIDATORS+=('remote[[:space:]]+(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(:|([[:space:]]+port[[:space:]]+))[0-9]+;')
-LINE_VALIDATORS+=('remote[[:space:]]+((ipv4|ipv6)[[:space:]]+)?"[0-9a-zA-Z.-]+"(:|([[:space:]]+port[[:space:]]+))[0-9]+;')
-
-# Validate fastd key files
-keycount=0
-for file in "$KEYDIR"/*; do
- sed -E 's/^\s+//g;s/[[:space:]]+$//g;/^[[:space:]]*$/d' "$file" |\
- while read line; do
- valid=''
- # Simple comments are always ok
- echo "$line" | grep -q '^#.*' && continue
- for validator in "${LINE_VALIDATORS[@]}"; do
- echo "$line" | egrep -q "^${validator}([[:space:]]*#.*)?$" && {
- valid=yes
- break;
- }
- done
- if [ "$valid" != yes ]; then
- error "Key file '$file' is invalid"
- error "Offending line: '$line'"
- exit 1
- fi
- done
- keycount=$((keycount + 1))
-done
-
-echo "OK. $keycount keyfiles"
diff --git a/.gitlab-ci/ffki_scripts b/.gitlab-ci/ffki_scripts
new file mode 160000
+Subproject 950a079f037bdb63e1229e5540d82009f88d336
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..315fdb6
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule ".gitlab-ci/ffki_scripts"]
+ path = .gitlab-ci/ffki_scripts
+ url = https://github.com/TobleMiner/ffki-scripts.git