c4k-website/infrastructure/build/image/resources/functions.sh

31 lines
736 B
Bash
Raw Normal View History

#!/bin/bash
# TODO provide GITHOST
function generate-netrc-file() {
echo "machine $GITHOST password $AUTHTOKEN" > ~/.netrc
}
function get-website-data() {
2022-12-02 09:04:09 +00:00
curl -H "Authorization: token $AUTHTOKEN" -o $SOURCEDIR/$1 $GITREPOURL
}
function get-hash-data() {
curl -s -H "Authorization: token $AUTHTOKEN" $GITCOMMITURL | jq '.sha'
2022-12-02 09:04:09 +00:00
}
function write-hash-data() {
echo $1 > $HASHFILEDIR/$2
}
function unzip-website-data() {
2022-12-02 09:04:09 +00:00
unzip $SOURCEDIR/$1 -d $BUILDDIR
}
function build-website() {
2024-02-22 09:34:24 +00:00
(cd $BUILDDIR; dir=$(ls); cd $dir; ./generate.sh;)
}
2022-09-30 15:54:26 +00:00
function move-website-files-to-target() {
2024-02-22 09:34:24 +00:00
(cd $BUILDDIR; dir=$(ls); cd $dir; rsync -ru --exclude-from "/etc/exclude.pattern" --delete target/html/* $WEBSITEROOT;)
2022-09-30 15:54:26 +00:00
}