mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-06-26 03:17:47 +02:00
If enabled, jfa-go pings buildrone (hosted at builds.hrfee.pw) every 30 min for new updates. If there is one, it gets information (and if applicable, a binary) from the appropriate source (buildrone, github, or dockerhub) and displays it on the admin page. You can switch update channels between stable and unstable. For binary releases, updates are downloaded automatically and installed when the user presses update. Since this obviously introduces some "phone-home" functionality into jfa-go, I just want to say IPs are not and will not be logged by buildrone, although I may later introduce functionality to give a rough idea of the number of users (again, no IPs stored). The whole thing can also be turned off in settings.
154 lines
4.1 KiB
YAML
154 lines
4.1 KiB
YAML
---
|
|
name: jfa-go
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: fetch
|
|
image: docker:git
|
|
commands:
|
|
- git fetch --tags
|
|
- name: release
|
|
image: golang:latest
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
commands:
|
|
- apt update -y
|
|
- apt install build-essential python3-pip curl software-properties-common sed upx -y
|
|
- (curl -sL https://deb.nodesource.com/setup_14.x | bash -)
|
|
- apt install nodejs
|
|
- curl -sL https://git.io/goreleaser > goreleaser
|
|
- chmod +x goreleaser
|
|
- ./scripts/version.sh ./goreleaser
|
|
- wget https://builds.hrfee.pw/upload.py
|
|
- pip3 install requests
|
|
- bash -c 'python3 upload.py https://builds.hrfee.pw hrfee jfa-go --tag internal=true'
|
|
trigger:
|
|
event:
|
|
- tag
|
|
---
|
|
name: docker-buildx
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: build-deploy
|
|
image: appleboy/drone-ssh
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/drone_rsa
|
|
settings:
|
|
host:
|
|
from_secret: ssh2_host
|
|
username:
|
|
from_secret: ssh2_username
|
|
port:
|
|
from_secret: ssh2_port
|
|
volumes:
|
|
- /root/.ssh/docker-build:/root/drone_rsa
|
|
key_path: /root/drone_rsa
|
|
command_timeout: 50m
|
|
script:
|
|
- /mnt/buildx/jfa-go/build.sh stable
|
|
- wget https://builds.hrfee.pw/upload.py
|
|
- pip3 install requests
|
|
- bash -c 'python3 upload.py https://builds.hrfee.pw hrfee jfa-go --tag docker-stable=true'
|
|
trigger:
|
|
event:
|
|
- tag
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /root/.ssh/docker-build
|
|
---
|
|
name: jfa-go-git
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: build
|
|
image: golang:latest
|
|
commands:
|
|
- apt update -y
|
|
- apt install build-essential python3-pip curl software-properties-common sed upx -y
|
|
- (curl -sL https://deb.nodesource.com/setup_14.x | bash -)
|
|
- apt install nodejs
|
|
- curl -sL https://git.io/goreleaser > goreleaser
|
|
- chmod +x goreleaser
|
|
- ./scripts/version.sh ./goreleaser --snapshot --skip-publish --rm-dist
|
|
- wget https://builds.hrfee.pw/upload.py
|
|
- pip3 install requests
|
|
- bash -c 'python3 upload.py https://builds.hrfee.pw hrfee jfa-go --upload ./dist/*.tar.gz --tag internal-git=true'
|
|
environment:
|
|
BUILDRONE_KEY:
|
|
from_secret: BUILDRONE_KEY
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
- go1.16
|
|
event:
|
|
exclude:
|
|
- pull_request
|
|
|
|
---
|
|
name: docker-buildx-unstable
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: build-deploy
|
|
image: appleboy/drone-ssh
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/drone_rsa
|
|
settings:
|
|
host:
|
|
from_secret: ssh2_host
|
|
username:
|
|
from_secret: ssh2_username
|
|
port:
|
|
from_secret: ssh2_port
|
|
volumes:
|
|
- /root/.ssh/docker-build:/root/drone_rsa
|
|
key_path: /root/drone_rsa
|
|
command_timeout: 50m
|
|
script:
|
|
- /mnt/buildx/jfa-go/build.sh
|
|
- wget https://builds.hrfee.pw/upload.py
|
|
- pip3 install requests
|
|
- bash -c 'python3 upload.py https://builds.hrfee.pw hrfee jfa-go --tag docker-unstable=true'
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
exclude:
|
|
- pull_request
|
|
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /root/.ssh/docker-build
|
|
---
|
|
name: jfa-go-pr
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: build
|
|
image: golang:latest
|
|
commands:
|
|
- apt update -y
|
|
- apt install build-essential python3-pip curl software-properties-common sed upx -y
|
|
- (curl -sL https://deb.nodesource.com/setup_14.x | bash -)
|
|
- apt install nodejs
|
|
- curl -sL https://git.io/goreleaser > goreleaser
|
|
- chmod +x goreleaser
|
|
- ./scripts/version.sh ./goreleaser --snapshot --skip-publish --rm-dist
|
|
|
|
trigger:
|
|
event:
|
|
include:
|
|
- pull_request
|