export config

master
Izimic 2020-12-20 18:44:42 +01:00
parent 8ea48ba4ee
commit 2bd074191a
1 changed files with 14 additions and 12 deletions

View File

@ -1,25 +1,27 @@
#!/usr/bin/env zsh
function extract_option {
local file_name="$1"
local option="$2"
PROJECT=dodb.cr
GIT=$(cat payload.json | jq '.repository.clone_url')
ENV=debian
SPECS=("crystal spec spec/test.cr --tap")
sed -n "/^${option}: */{s/^${option}:[ \t]*//;p}" < $file_name
}
echo $GIT
PROJECT=$(jq -r '.repository.name' < payload.json)
GIT=$(jq -r '.repository.clone_url' < payload.json)
git clone $GIT
cd $PROJECT
CMD=$(extract_option "hooks_config" "commande")
ENV=$(extract_option "hooks_config" "env")
REV=$(git rev-parse HEAD)
shards install
shards build
REV=$(git rev-parse HEAD)
for i in ${SPECS[*]}
do
echo $i
/bin/sh -c $i | ../tap-aggregator add $PROJECT $ENV $REV
done
/bin/sh -c $CMD | ../tap-aggregator add $PROJECT $ENV $REV
exit 1