This repository has been archived on 2024-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
adlin/.drone.yml

213 lines
6.1 KiB
YAML

---
kind: pipeline
type: docker
name: build-arm64
platform:
os: linux
arch: arm64
steps:
- name: compile binaries
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- go vet -v -buildvcs=false ./checker
- go vet -v -buildvcs=false ./token-validator
- cd ./pkg/token-validator && go test && cd -
- cd ./pkg/minichecker/cmd && go vet -v -buildvcs=false . && cd -
- cd ./pkg/arp-spoofer/cmd && go vet -v -buildvcs=false . && go build -buildvcs=false -v -ldflags="-s -w" . && cd -
- cd ./pkg/login-validator/cmd && go vet -v -buildvcs=false . && go build -buildvcs=false -v -ldflags="-s -w" . && cd -
- cd ./pkg/login-app/cmd && go build -v -buildvcs=false -ldflags="-s -w" . && cd -
- cd ./pkg/shadow-up/cmd && go vet -v -buildvcs=false . && go build -v -buildvcs=false -ldflags="-s -w" . && cd -
- cd ./pkg/wg-manager/cmd && go vet -v -buildvcs=false . && go build -v -buildvcs=false -ldflags="-s -w" . && cd -
- mkdir dist
- go build -v -buildvcs=false -ldflags="-s -w" -o dist/checker ./checker
- go build -v -buildvcs=false -ldflags="-s -w" -o dist/token-validator ./token-validator
- cd ./pkg/minichecker/cmd && go build -buildvcs=false -v -ldflags="-s -w" -o ../../../dist/minichecker . && cd -
- cd ./pkg/login-app/cmd && go build -buildvcs=false -v -ldflags="-s -w" -o ../../../dist/login-app . && cd -
trigger:
event:
- push
---
kind: pipeline
type: docker
name: build-arm
platform:
os: linux
arch: arm
steps:
- name: compile binaries
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- go vet -v -buildvcs=false ./checker
- go vet -v -buildvcs=false ./token-validator
- cd ./pkg/token-validator && go test && cd -
- cd ./pkg/minichecker/cmd && go vet -v -buildvcs=false . && cd -
- cd ./pkg/arp-spoofer/cmd && go vet -v -buildvcs=false . && go build -buildvcs=false -v -ldflags="-s -w" . && cd -
- cd ./pkg/login-validator/cmd && go vet -v -buildvcs=false . && go build -buildvcs=false -v -ldflags="-s -w" . && cd -
- cd ./pkg/login-app/cmd && go build -buildvcs=false -v -ldflags="-s -w" . && cd -
- cd ./pkg/shadow-up/cmd && go vet -v -buildvcs=false . && go build -v -buildvcs=false -ldflags="-s -w" . && cd -
- cd ./pkg/wg-manager/cmd && go vet -v -buildvcs=false . && go build -v -buildvcs=false -ldflags="-s -w" . && cd -
- mkdir dist
- go build -v -buildvcs=false -ldflags="-s -w" -o dist/checker ./checker
- go build -v -buildvcs=false -ldflags="-s -w" -o dist/token-validator ./token-validator
- cd ./pkg/minichecker/cmd && go build -buildvcs=false -v -ldflags="-s -w" -o ../../../dist/minichecker . && cd -
- cd ./pkg/login-app/cmd && go build -buildvcs=false -v -ldflags="-s -w" -o ../../../dist/login-app . && cd -
environment:
CGO_ENABLED: 0
GOARM: 7
- name: deploy binaries
image: appleboy/drone-scp:linux-arm
settings:
tar_tmp_path: /tmp/
host: adlin.nemunai.re
target: /var/lib/lxc/maatma/rootfs/home/newbuilds
source: dist/*
strip_components: 1
username:
from_secret: ssh_username
key:
from_secret: deploy_key
port:
from_secret: ssh_port
when:
branch:
- master
event:
- push
- name: deploy error pages
image: appleboy/drone-scp:linux-arm
settings:
tar_tmp_path: /tmp/
host: adlin.nemunai.re
target: /var/www/nemunai.re/adlin/.error-pages/
source: token-validator/htdocs/5*.html
strip_components: 2
username:
from_secret: ssh_username
key:
from_secret: deploy_key
port:
from_secret: ssh_port
when:
branch:
- master
event:
- push
trigger:
event:
- push
---
kind: pipeline
type: docker
name: build-tutorial-2-subject
platform:
os: linux
arch: amd64
steps:
- name: compose subject
image: pandoc/latex:3.1.1
commands:
- sed -i s/v3.12/v3.14/ /etc/apk/repositories
- apk add --no-cache make ttf-linux-libertine ttf-inconsolata
- tlmgr update --self
- tlmgr install enumitem environ etoolbox pdfcol preprint sectsty selnolig tcolorbox tikzfill titling
- mkdir dist
- make -C tutorial/ansible
- mv tutorial/ansible/tutorial-2.pdf dist/tutorial-2-${DRONE_TAG##srs20??-tutorial2-}.pdf
- name: deploy subject
image: appleboy/drone-scp
settings:
tar_tmp_path: /tmp/
host: adlin.nemunai.re
target: /var/www/nemunai.re/adlin/subjects/
source: dist/*
strip_components: 1
username:
from_secret: ssh_username
key:
from_secret: deploy_key
port:
from_secret: ssh_port
- name: link to latest subject
image: appleboy/drone-ssh
settings:
host: adlin.nemunai.re
username:
from_secret: ssh_username
key:
from_secret: deploy_key
port:
from_secret: ssh_port
script:
- ln -sf /var/www/nemunai.re/adlin/subjects/tutorial-2-${DRONE_TAG##srs20??-tutorial2-}.pdf /var/www/nemunai.re/adlin/tutorial-2.pdf
trigger:
ref:
- refs/tags/srs20??-tutorial2-*
---
kind: pipeline
type: docker
name: build-tutorial-3-subject
platform:
os: linux
arch: amd64
steps:
- name: compose subject
image: pandoc/latex:3.1.1
commands:
- sed -i s/v3.12/v3.14/ /etc/apk/repositories
- apk add --no-cache make ttf-linux-libertine ttf-inconsolata
- tlmgr update --self
- tlmgr install enumitem environ etoolbox pdfcol preprint sectsty selnolig tcolorbox tikzfill titling
- mkdir dist
- make -C tutorial/nat
- mv tutorial/nat/tutorial.pdf dist/tutorial-3-${DRONE_TAG##srs20??-tutorial3-}.pdf
- name: deploy subject
image: appleboy/drone-scp
settings:
tar_tmp_path: /tmp/
host: adlin.nemunai.re
target: /var/www/nemunai.re/adlin/subjects/
source: dist/*
strip_components: 1
username:
from_secret: ssh_username
key:
from_secret: deploy_key
port:
from_secret: ssh_port
- name: link to latest subject
image: appleboy/drone-ssh
settings:
host: adlin.nemunai.re
username:
from_secret: ssh_username
key:
from_secret: deploy_key
port:
from_secret: ssh_port
script:
- ln -sf /var/www/nemunai.re/adlin/subjects/tutorial-3-${DRONE_TAG##srs20??-tutorial3-}.pdf /var/www/nemunai.re/adlin/tutorial-3.pdf
trigger:
ref:
- refs/tags/srs20??-tutorial3-*