2022-09-23 13:39:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-03-06 14:35:11 +00:00
|
|
|
function generate-netrc-file() {
|
2024-03-07 11:19:28 +00:00
|
|
|
echo "machine $GIT_HOST password $AUTH_TOKEN" > ~/.netrc
|
2024-03-06 14:35:11 +00:00
|
|
|
}
|
|
|
|
|
2022-12-02 08:37:03 +00:00
|
|
|
function get-website-data() {
|
2024-03-07 11:19:28 +00:00
|
|
|
curl -H "Authorization: token $AUTH_TOKEN" -o $SOURCE_DIR/$1 $GIT_REPO_URL
|
2022-12-02 08:37:03 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 08:50:13 +00:00
|
|
|
function get-hash-data() {
|
2024-03-07 11:19:28 +00:00
|
|
|
curl -s -H "Authorization: token $AUTH_TOKEN" $GIT_COMMIT_URL | jq '.sha'
|
2022-12-02 09:04:09 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 08:50:13 +00:00
|
|
|
function write-hash-data() {
|
2024-03-07 11:19:28 +00:00
|
|
|
echo $1 > $HASHFILE_DIR/$2
|
2022-12-02 08:37:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function unzip-website-data() {
|
2024-03-07 11:19:28 +00:00
|
|
|
unzip $SOURCE_DIR/$1 -d $BUILD_DIR
|
2022-09-23 13:39:17 +00:00
|
|
|
}
|
|
|
|
|
2022-12-02 09:36:44 +00:00
|
|
|
function build-website() {
|
2024-03-07 11:19:28 +00:00
|
|
|
(cd $BUILD_DIR; dir=$(ls); cd $dir; ./generate.sh;)
|
2022-09-23 13:39:17 +00:00
|
|
|
}
|
2022-09-30 15:54:26 +00:00
|
|
|
|
|
|
|
function move-website-files-to-target() {
|
2024-03-07 11:19:28 +00:00
|
|
|
(cd $BUILD_DIR; dir=$(ls); cd $dir; rsync -ru --exclude-from "/etc/exclude.pattern" --delete target/html/* $WEBSITE_ROOT;)
|
2022-09-30 15:54:26 +00:00
|
|
|
}
|