circleci: add nightly release
For github and dockerhub
This commit is contained in:
committed by
Steve Chavez
parent
51b43f5605
commit
5d140f6fa0
+15
-5
@@ -224,19 +224,27 @@ workflows:
|
|||||||
# Make sure that this job also runs when releases are tagged.
|
# Make sure that this job also runs when releases are tagged.
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
only:
|
||||||
|
- /v[0-9]+(\.[0-9]+)*/
|
||||||
|
- nightly
|
||||||
- stack-test:
|
- stack-test:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
only:
|
||||||
|
- /v[0-9]+(\.[0-9]+)*/
|
||||||
|
- nightly
|
||||||
- stack-test-memory:
|
- stack-test-memory:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
only:
|
||||||
|
- /v[0-9]+(\.[0-9]+)*/
|
||||||
|
- nightly
|
||||||
- nix-build-test:
|
- nix-build-test:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
only:
|
||||||
|
- /v[0-9]+(\.[0-9]+)*/
|
||||||
|
- nightly
|
||||||
- release:
|
- release:
|
||||||
requires:
|
requires:
|
||||||
- style-check
|
- style-check
|
||||||
@@ -245,6 +253,8 @@ workflows:
|
|||||||
- nix-build-test
|
- nix-build-test
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
only:
|
||||||
|
- /v[0-9]+(\.[0-9]+)*/
|
||||||
|
- nightly
|
||||||
branches:
|
branches:
|
||||||
ignore: /.*/
|
ignore: /.*/
|
||||||
|
|||||||
+40
-14
@@ -20,18 +20,34 @@ let
|
|||||||
|
|
||||||
version=$1
|
version=$1
|
||||||
|
|
||||||
changes="$(sed -n "1,/$version/d;/## \[/q;p" ${../../CHANGELOG.md})"
|
if test $version = "nightly"
|
||||||
|
then
|
||||||
|
date=$(date +'%F')
|
||||||
|
sha=$(echo $CIRCLE_SHA1 | head -c7)
|
||||||
|
suffix=$date-$sha
|
||||||
|
tar cvJf postgrest-nightly-$suffix-linux-x64-static.tar.xz \
|
||||||
|
-C ${postgrest}/bin postgrest
|
||||||
|
|
||||||
tar cvJf postgrest-$version-linux-x64-static.tar.xz \
|
${ghr}/bin/ghr \
|
||||||
-C ${postgrest}/bin postgrest
|
-t "$GITHUB_TOKEN" \
|
||||||
|
-u "$GITHUB_USERNAME" \
|
||||||
|
-r "$GITHUB_REPONAME" \
|
||||||
|
--replace nightly \
|
||||||
|
postgrest-nightly-$suffix-linux-x64-static.tar.xz
|
||||||
|
else
|
||||||
|
changes="$(sed -n "1,/$version/d;/## \[/q;p" ${../../CHANGELOG.md})"
|
||||||
|
|
||||||
${ghr}/bin/ghr \
|
tar cvJf postgrest-$version-linux-x64-static.tar.xz \
|
||||||
-t "$GITHUB_TOKEN" \
|
-C ${postgrest}/bin postgrest
|
||||||
-u "$GITHUB_USERNAME" \
|
|
||||||
-r "$GITHUB_REPONAME" \
|
${ghr}/bin/ghr \
|
||||||
-b "$changes" \
|
-t "$GITHUB_TOKEN" \
|
||||||
--replace $version \
|
-u "$GITHUB_USERNAME" \
|
||||||
postgrest-$version-linux-x64-static.tar.xz
|
-r "$GITHUB_REPONAME" \
|
||||||
|
-b "$changes" \
|
||||||
|
--replace $version \
|
||||||
|
postgrest-$version-linux-x64-static.tar.xz
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Wrapper for login with docker. $DOCKER_USER/$DOCKER_PASS vars come from CircleCI.
|
# Wrapper for login with docker. $DOCKER_USER/$DOCKER_PASS vars come from CircleCI.
|
||||||
@@ -54,11 +70,21 @@ let
|
|||||||
|
|
||||||
docker load -i ${docker.image}
|
docker load -i ${docker.image}
|
||||||
|
|
||||||
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:latest
|
if test $version = "nightly"
|
||||||
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:$version
|
then
|
||||||
|
date=$(date +'%F')
|
||||||
|
sha=$(echo $CIRCLE_SHA1 | head -c7)
|
||||||
|
suffix=$date-$sha
|
||||||
|
|
||||||
docker push "$DOCKER_REPO"/postgrest:latest
|
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:nightly-$suffix
|
||||||
docker push "$DOCKER_REPO"/postgrest:$version
|
docker push "$DOCKER_REPO"/postgrest:nightly-$suffix
|
||||||
|
else
|
||||||
|
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:latest
|
||||||
|
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:$version
|
||||||
|
|
||||||
|
docker push "$DOCKER_REPO"/postgrest:latest
|
||||||
|
docker push "$DOCKER_REPO"/postgrest:$version
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Script for updating the repository description on Docker Hub.
|
# Script for updating the repository description on Docker Hub.
|
||||||
|
|||||||
Reference in New Issue
Block a user