ci: add git sha with hours/minutes to nightly

This commit is contained in:
steve-chavez
2020-11-10 22:47:58 -05:00
committed by Steve Chavez
parent 814da058ec
commit b6d8d89b32
4 changed files with 9 additions and 19 deletions
+2 -4
View File
@@ -10,7 +10,7 @@ build_task:
folder: /var/cache/pkg
install_script:
- pkg install -y postgresql95-client ghc hs-cabal-install jq
- pkg install -y postgresql95-client ghc hs-cabal-install jq git
# cache the hackage index file and downloads which are
# cabal v2-update downloads an incremental update, so we don't need to keep this up2date
@@ -43,9 +43,7 @@ build_task:
if test $CIRRUS_TAG = "nightly"
then
date=$(date +'%F')
sha=$(echo $CIRRUS_CHANGE_IN_REPO | head -c7)
suffix=$date-$sha
suffix=$(git show -s --format="%cd-%h" --date="format:%Y-%m-%d-%H-%M")
bin_name=postgrest-nightly-$suffix-freebsd.tar.xz
else
bin_name=postgrest-$CIRRUS_TAG-freebsd.tar.xz
+1 -3
View File
@@ -59,9 +59,7 @@ jobs:
repo="$(echo "$TRAVIS_REPO_SLUG" | cut -f2 -d/)"
if test $TRAVIS_TAG = "nightly"
then
date=$(date +'%F')
sha=$(echo $TRAVIS_COMMIT | head -c7)
suffix=$date-$sha
suffix=$(git show -s --format="%cd-%h" --date="format:%Y-%m-%d-%H-%M")
strip postgrest
tar cJf postgrest-nightly-$suffix-osx.tar.xz postgrest
ghr -t $GITHUB_TOKEN -u $owner -r $repo --replace nightly postgrest-nightly-$suffix-osx.tar.xz
+4 -6
View File
@@ -32,14 +32,12 @@ artifacts:
- path: postgrest.exe
deploy_script:
## set the env vars outside of the IF because that doesn't work: https://stackoverflow.com/questions/9102422/windows-batch-set-inside-if-not-working
- set DATE=%APPVEYOR_REPO_COMMIT_TIMESTAMP:~0,10%
- set SHA=%APPVEYOR_REPO_COMMIT:~0,7%
- set SUFFIX=%DATE%-%SHA%
## Use powershell(ps) for this because CMD commands having "%" don't work(even by escaping with "%%"). See https://github.com/appveyor/ci/issues/246.
- ps: $env:suffix=(git show -s --format="%cd-%h" --date="format:%Y-%m-%d-%H-%M")
- IF DEFINED APPVEYOR_REPO_TAG_NAME (
IF "%APPVEYOR_REPO_TAG_NAME%"=="nightly" (
7z a -tzip postgrest-nightly-%SUFFIX%-windows-x64.zip postgrest.exe &&
bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ghr -t $GITHUB_TOKEN -u $APPVEYOR_ACCOUNT_NAME -r $APPVEYOR_PROJECT_NAME --replace nightly postgrest-nightly-$SUFFIX-windows-x64.zip"
7z a -tzip postgrest-nightly-%suffix%-windows-x64.zip postgrest.exe &&
bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ghr -t $GITHUB_TOKEN -u $APPVEYOR_ACCOUNT_NAME -r $APPVEYOR_PROJECT_NAME --replace nightly postgrest-nightly-$suffix-windows-x64.zip"
) ELSE (
7z a -tzip postgrest-%APPVEYOR_REPO_TAG_NAME%-windows-x64.zip postgrest.exe &&
bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ghr -t $GITHUB_TOKEN -u $APPVEYOR_ACCOUNT_NAME -r $APPVEYOR_PROJECT_NAME -b \"`sed -n \"1,/$APPVEYOR_REPO_TAG_NAME/d;/## \[/q;p\" CHANGELOG.md`\" --replace $APPVEYOR_REPO_TAG_NAME postgrest-$APPVEYOR_REPO_TAG_NAME-windows-x64.zip"
+2 -6
View File
@@ -22,9 +22,7 @@ let
if test $version = "nightly"
then
date=$(date +'%F')
sha=$(echo $CIRCLE_SHA1 | head -c7)
suffix=$date-$sha
suffix=$(git show -s --format="%cd-%h" --date="format:%Y-%m-%d-%H-%M")
tar cvJf postgrest-nightly-$suffix-linux-x64-static.tar.xz \
-C ${postgrest}/bin postgrest
@@ -72,9 +70,7 @@ let
if test $version = "nightly"
then
date=$(date +'%F')
sha=$(echo $CIRCLE_SHA1 | head -c7)
suffix=$date-$sha
suffix=$(git show -s --format="%cd-%h" --date="format:%Y-%m-%d-%H-%M")
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:nightly-$suffix
docker push "$DOCKER_REPO"/postgrest:nightly-$suffix