diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index a401205..0000000 --- a/.drone.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -# ---------------------------------------------- -# -- Build an image and push it to the registry -# ---------------------------------------------- -kind: pipeline -type: docker -name: Build the builder - -trigger: - event: - - push - branch: - - main - -steps: - - name: Build openvpn xor amd64 - image: git.badhouseplants.net/badhouseplants/badhouseplants-builder:ff4a98f2acb557ad443f279627036bebf06bc4f1 - privileged: true - environment: - GITEA_TOKEN: - from_secret: GITEA_TOKEN - CONTAINERFILE: ./containerfiles/Containerfile-XOR - commands: - - source ./env/openvpn_xor.env - - git clone https://github.com/Tunnelblick/Tunnelblick.git /tmp/tunnelblick - - export OPENVPN_VERSION=$(ls /tmp/tunnelblick/third_party/sources/openvpn | sed 's/openvpn-//g' | sort -k1,1nr -k2,2n -k3,3n | head -n 1) - - export CUSTOM_TAG="v$OPENVPN_VERSION-XOR-$TUNNELBLICK_VERSION" - - export BUILD_ARGS="--build-arg OPENVPN_VERSION=$OPENVPN_VERSION --build-arg TUNNELBLICK_VERSION=$TUNNELBLICK_VERSION" - - build-container - - - name: Build openvpn amd64 - image: git.badhouseplants.net/badhouseplants/badhouseplants-builder:ff4a98f2acb557ad443f279627036bebf06bc4f1 - privileged: true - environment: - GITEA_TOKEN: - from_secret: GITEA_TOKEN - CONTAINERFILE: ./containerfiles/Containerfile - commands: - - source ./env/openvpn.env - - export CUSTOM_TAG="v$OPENVPN_VERSION" - - export BUILD_ARGS="--build-arg OPENVPN_VERSION=$OPENVPN_VERSION" - - build-container diff --git a/.woodpecker.yaml b/.woodpecker.yaml index f48a23b..798776a 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -4,40 +4,20 @@ when: - push branch: - main + +matrix: + TARGET: + - openvpn_xor + - openvpn + steps: - build-xor: - name: Build openvpn xor amd64 + build-${TARGET}: + name: Build ${TARGET} image: git.badhouseplants.net/badhouseplants/badhouseplants-builder:9665015b44590b7ce2139f7acbad23af6628fff3 secrets: - gitea_token privileged: true depends_on: [] - environment: - CONTAINERFILE: ./containerfiles/Containerfile-XOR - backend_options: - kubernetes: - resources: - requests: - memory: 500Mi - cpu: 200m - limits: - memory: 500Mi - cpu: 200m - securityContext: - privileged: true - commands: - - source ./env/openvpn_xor.env - - git clone https://github.com/Tunnelblick/Tunnelblick.git /tmp/tunnelblick - - export OPENVPN_VERSION=$(ls /tmp/tunnelblick/third_party/sources/openvpn | sed 's/openvpn-//g' | sort -k1,1nr -k2,2n -k3,3n | head -n 1) - - export CUSTOM_TAG="v$OPENVPN_VERSION-XOR-$TUNNELBLICK_VERSION" - - export BUILD_ARGS="--build-arg OPENVPN_VERSION=$OPENVPN_VERSION --build-arg TUNNELBLICK_VERSION=$TUNNELBLICK_VERSION" - - build-container - - build: - name: Build openvpn amd64 - image: git.badhouseplants.net/badhouseplants/badhouseplants-builder:9665015b44590b7ce2139f7acbad23af6628fff3 - privileged: true - depends_on: [] backend_options: kubernetes: resources: @@ -49,12 +29,6 @@ steps: cpu: 200m securityContext: privileged: true - secrets: - - gitea_token - environment: - CONTAINERFILE: ./containerfiles/Containerfile commands: - - source ./env/openvpn.env - - export CUSTOM_TAG="v$OPENVPN_VERSION" - - export BUILD_ARGS="--build-arg OPENVPN_VERSION=$OPENVPN_VERSION" - - build-container + - source ./env/${TARGET}.env + - ./scripts/$SCRIPT diff --git a/env/openvpn.env b/env/openvpn.env index 693c85a..974c467 100644 --- a/env/openvpn.env +++ b/env/openvpn.env @@ -1 +1,3 @@ export OPENVPN_VERSION=2.6.10 +export CONTAINERFILE=./containerfiles/Containerfile +export SCRIPT=build_upstream.sh \ No newline at end of file diff --git a/env/openvpn_xor.env b/env/openvpn_xor.env index eef217e..e5634d2 100644 --- a/env/openvpn_xor.env +++ b/env/openvpn_xor.env @@ -1 +1,3 @@ export TUNNELBLICK_VERSION=4.0.1 +export CONTAINERFILE=./containerfiles/Containerfile-XOR +export SCRIPT=build_xor.sh \ No newline at end of file diff --git a/scripts/build_test.sh b/scripts/build_test.sh new file mode 100755 index 0000000..22a9efc --- /dev/null +++ b/scripts/build_test.sh @@ -0,0 +1 @@ +echo 1 \ No newline at end of file diff --git a/scripts/build_upstream.sh b/scripts/build_upstream.sh new file mode 100755 index 0000000..7f2de71 --- /dev/null +++ b/scripts/build_upstream.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +export CUSTOM_TAG="v$OPENVPN_VERSION" +export BUILD_ARGS="--build-arg OPENVPN_VERSION=$OPENVPN_VERSION" +build-container \ No newline at end of file diff --git a/scripts/build_xor.sh b/scripts/build_xor.sh new file mode 100755 index 0000000..22aeaa6 --- /dev/null +++ b/scripts/build_xor.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +git clone https://github.com/Tunnelblick/Tunnelblick.git /tmp/tunnelblick +export OPENVPN_VERSION=$(ls /tmp/tunnelblick/third_party/sources/openvpn | sed 's/openvpn-//g' | sort -k1,1nr -k2,2n -k3,3n | head -n 1) +export CUSTOM_TAG="v$OPENVPN_VERSION-XOR-$TUNNELBLICK_VERSION" +export BUILD_ARGS="--build-arg OPENVPN_VERSION=$OPENVPN_VERSION --build-arg TUNNELBLICK_VERSION=$TUNNELBLICK_VERSION" +build-container \ No newline at end of file