2022-01-15 15:28:58 +01:00
|
|
|
matrix:
|
|
|
|
PLATFORM:
|
|
|
|
- linux/amd64
|
2022-01-22 22:12:30 +01:00
|
|
|
- linux/arm64
|
2022-01-15 15:28:58 +01:00
|
|
|
|
2022-01-15 15:30:09 +01:00
|
|
|
platform: ${PLATFORM}
|
2022-01-13 15:29:43 +01:00
|
|
|
|
2022-01-13 13:40:33 +01:00
|
|
|
pipeline:
|
|
|
|
debug:
|
|
|
|
image: 'chewingbever/vlang:latest'
|
2022-01-22 22:12:30 +01:00
|
|
|
pull: true
|
2022-01-13 13:40:33 +01:00
|
|
|
commands:
|
2022-04-15 11:38:06 +02:00
|
|
|
- make
|
2022-01-22 22:18:19 +01:00
|
|
|
when:
|
|
|
|
event: push
|
2022-04-15 11:38:06 +02:00
|
|
|
branch:
|
|
|
|
exclude: [main, dev]
|
2022-01-13 13:40:33 +01:00
|
|
|
|
|
|
|
prod:
|
|
|
|
image: 'chewingbever/vlang:latest'
|
2022-01-22 22:12:30 +01:00
|
|
|
pull: true
|
2022-01-14 18:32:00 +01:00
|
|
|
environment:
|
2022-05-01 22:47:00 +02:00
|
|
|
- LDFLAGS=-lz -lbz2 -llzma -lexpat -lzstd -llz4 -lsqlite3 -static
|
2022-01-13 13:40:33 +01:00
|
|
|
commands:
|
2022-04-30 23:02:54 +02:00
|
|
|
# Apparently this -D is *very* important
|
|
|
|
- CFLAGS='-DGC_THREADS=1' make prod
|
2022-01-22 19:29:01 +01:00
|
|
|
# Make sure the binary is actually statically built
|
2022-01-14 20:43:11 +01:00
|
|
|
- readelf -d pvieter
|
2022-01-14 21:50:43 +01:00
|
|
|
- du -h pvieter
|
2022-01-14 20:43:11 +01:00
|
|
|
- '[ "$(readelf -d pvieter | grep NEEDED | wc -l)" = 0 ]'
|
2022-01-22 19:01:46 +01:00
|
|
|
# This removes so much, it's amazing
|
|
|
|
- strip -s pvieter
|
|
|
|
- du -h pvieter
|
2022-01-22 22:17:38 +01:00
|
|
|
when:
|
|
|
|
event: push
|
2022-01-22 19:01:46 +01:00
|
|
|
|
|
|
|
upload:
|
2022-01-23 10:58:49 +01:00
|
|
|
image: 'chewingbever/vlang:latest'
|
2022-01-22 19:01:46 +01:00
|
|
|
secrets: [ s3_username, s3_password ]
|
|
|
|
commands:
|
2022-01-22 19:22:19 +01:00
|
|
|
# https://gist.github.com/JustinTimperio/7c7115f87b775618637d67ac911e595f
|
|
|
|
- export URL=s3.rustybever.be
|
2022-01-22 19:30:46 +01:00
|
|
|
- export DATE="$(date -R --utc)"
|
2022-01-22 19:22:19 +01:00
|
|
|
- export CONTENT_TYPE='application/zstd'
|
2022-02-22 18:42:09 +01:00
|
|
|
|
|
|
|
- export OBJ_PATH="/vieter/commits/$CI_COMMIT_SHA/vieter-$(echo '${PLATFORM}' | sed 's:/:-:g')"
|
2022-01-22 19:26:52 +01:00
|
|
|
- export SIG_STRING="PUT\n\n$CONTENT_TYPE\n$DATE\n$OBJ_PATH"
|
|
|
|
- export SIGNATURE=`echo -en $SIG_STRING | openssl sha1 -hmac $S3_PASSWORD -binary | base64`
|
2022-02-22 18:42:09 +01:00
|
|
|
- >
|
|
|
|
curl
|
|
|
|
--silent
|
|
|
|
-XPUT
|
|
|
|
-T pvieter
|
|
|
|
-H "Host: $URL"
|
|
|
|
-H "Date: $DATE"
|
|
|
|
-H "Content-Type: $CONTENT_TYPE"
|
|
|
|
-H "Authorization: AWS $S3_USERNAME:$SIGNATURE"
|
|
|
|
https://$URL$OBJ_PATH
|
2022-01-22 22:17:38 +01:00
|
|
|
when:
|
|
|
|
event: push
|