summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--Makefile2
-rwxr-xr-xscripts/check-go-modules.sh15
-rwxr-xr-xscripts/check-obfs4-ver.sh14
-rw-r--r--scripts/obfs4-version1
5 files changed, 17 insertions, 17 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e525eb0..9d54c04 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,7 +19,7 @@ validate:
image: golang:alpine
stage: test
script: |
- apk add build-base git
+ apk add build-base git jq curl
go version
go env
diff --git a/Makefile b/Makefile
index 456548c..70320e9 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,7 @@ test:
go test ./...
check-yawning-obfs4:
- ./scripts/check-go-modules.sh
+ ./scripts/check-obfs4-ver.sh
obfsvpn-server-container:
docker build -t ${OBFSVPN_IMAGE_NAME}:${TAG} -f images/obfsvpn/Dockerfile \
diff --git a/scripts/check-go-modules.sh b/scripts/check-go-modules.sh
deleted file mode 100755
index fa4b21c..0000000
--- a/scripts/check-go-modules.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-go get -u gitlab.com/yawning/obfs4.git &> /dev/null
-git --no-pager diff -U0 go.mod | grep -Fq "gitlab.com/yawning/obfs4.git"
-
-case "$?" in
- "0")
- echo "New version of upstream yawning/obfs4 available!!"
- exit 2
- ;;
- *)
- exit 0
- ;;
-esac
-
diff --git a/scripts/check-obfs4-ver.sh b/scripts/check-obfs4-ver.sh
new file mode 100755
index 0000000..cecb7e0
--- /dev/null
+++ b/scripts/check-obfs4-ver.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# check yawning's HEAD
+available=$(curl -s https://gitlab.com/api/v4/projects/10387781/repository/tags/ | jq ".[0]".name | cut -d "-" -f 2 | cut -d "\"" -f 1)
+current=$(cat scripts/obfs4-version)
+
+echo "current:" $current
+echo "available:" $available
+
+if [ "$available" = "$current" ]; then
+ exit 0
+else
+ echo "New version of upstream yawning/obfs4 available, should update deps."
+ exit 2
+fi;
diff --git a/scripts/obfs4-version b/scripts/obfs4-version
new file mode 100644
index 0000000..43b2961
--- /dev/null
+++ b/scripts/obfs4-version
@@ -0,0 +1 @@
+0.0.13