1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Move some CI logic to scripts/makefile

Also update some of its docs
This commit is contained in:
Rohan Kumar 2023-11-24 12:58:45 -08:00
parent 29d6d88d36
commit de65f4d506
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
3 changed files with 26 additions and 13 deletions

View file

@ -1,13 +1,13 @@
--- ---
# we rsync binaries.tar.gz from the same server we deploy to. # we rsync binaries.tar.gz from the same server we deploy to.
# it contains these static-pie binaries: # it contains these static-pie binaries:
# hugo, brotli, ect (like gzip/zopfli), sd, htmlq (like jq for html), and xmllint. # hugo, brotli, ect (like gzip/zopfli), and xmllint.
image: alpine/edge image: alpine/edge
packages: packages:
- curl # for webring update script, pre-installed on builds.sr.ht images - curl # Fetches webmentions and webring links. Pre-inistalled.
- rsync - rsync
- git # for Hugo's gitInfo, pre-installed on builds.sr.ht images - git # Powers Hugo's gitInfo. Pre-installed
- bmake - bmake # gmake is fine too
sources: sources:
- https://git.sr.ht/~seirdy/seirdy.one - https://git.sr.ht/~seirdy/seirdy.one
secrets: secrets:
@ -19,14 +19,7 @@ triggers:
to: seirdy@seirdy.one to: seirdy@seirdy.one
tasks: tasks:
- deps: | - deps: |
printf "VerifyHostKeyDNS=yes\nKexAlgorithms=sntrup761x25519-sha512@openssh.com\n" >> ~/.ssh/config sh seirdy.one/scripts/setup-ci.sh
# mirrored at https://seirdy.one/misc/binaries.tar.gz
rsync -Wv deploy@seirdy.one:/var/www/pb/binaries.tar.gz .
mkdir -p ~/bin
tar xzf binaries.tar.gz -oC ~/bin
- build_deploy: | - build_deploy: |
cd seirdy.one cd seirdy.one
export PATH=~/bin:$PATH bmake ci
# quick health + ip check
sh scripts/connectivity-check.sh
bmake deploy-prod deploy-onion

View file

@ -163,6 +163,12 @@ deploy-onion:
@$(MAKE) WWW_ROOT=/var/www/seirdy.onion HUGO_BASEURL='http://wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion/' OUTPUT_DIR=public_onion copy-to-xhtml @$(MAKE) WWW_ROOT=/var/www/seirdy.onion HUGO_BASEURL='http://wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion/' OUTPUT_DIR=public_onion copy-to-xhtml
@$(MAKE) WWW_ROOT=/var/www/seirdy.onion HUGO_BASEURL='http://wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion/' OUTPUT_DIR=public_onion deploy-html @$(MAKE) WWW_ROOT=/var/www/seirdy.onion HUGO_BASEURL='http://wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion/' OUTPUT_DIR=public_onion deploy-html
# in CI, check connectivity and then build + deploy the clearnet and onion sites.
.PHONY: ci
ci:
sh scripts/connectivity-check.sh
@$(MAKE) deploy-prod deploy-onion
# we only deploy html to the staging site # we only deploy html to the staging site
.PHONY: deploy-staging .PHONY: deploy-staging
deploy-staging: deploy-staging:

14
scripts/setup-ci.sh Normal file
View file

@ -0,0 +1,14 @@
#!/bin/sh
# For CI: configures SSH and installs binaries that I use to build my site.
# The binaries are statically-linked for Linux on x86_64
set -e -u
# configure ssh
echo "VerifyHostKeyDNS=yes
KexAlgorithms=sntrup761x25519-sha512@openssh.com" >> ~/.ssh/config
# mirrored at https://seirdy.one/pb/binaries.tar.gz
rsync -WPv deploy@seirdy.one:/var/www/pb/binaries.tar.gz .
mkdir -p /usr/local/bin
tar xzf binaries.tar.gz -oC /usr/local/bin
rm binaries.tar.gz