-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add nightly builds #1648
Merged
Merged
Add nightly builds #1648
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cad62e4
nix: add postgrest-docker-login wrapper func
steve-chavez 6298bfc
circleci: make release job a machine
steve-chavez c4acf81
nix: fix postgrest-release-dockerhubdescription
steve-chavez bb84c18
appveyor: add nightly release
steve-chavez dfb78c2
travisci: add nightly release
steve-chavez f631f10
nix: change release scripts to use a version arg
steve-chavez e5b524c
circleci: add nightly release
steve-chavez 6025433
cirrusci: add nightly release
steve-chavez 9e824da
ci: add git sha with hours/minutes to nightly
steve-chavez b5a3ca2
ci: add nightly version to cabal file
steve-chavez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,34 +12,36 @@ let | |
# Version from the postgrest.cabal file (gotten with callCabal2nix). | ||
version = postgrest.version; | ||
|
||
# Set of files that will be published in the GitHub release. | ||
releaseFiles = | ||
runCommand "postgrest-release-files" | ||
{ inherit postgrest version; } | ||
'' | ||
set -euo pipefail | ||
|
||
mkdir -p $out | ||
|
||
tar cvJf "$out"/postgrest-v"$version"-linux-x64-static.tar.xz \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed the |
||
-C "$postgrest"/bin postgrest | ||
''; | ||
|
||
# Script for publishing a new release on GitHub. | ||
github = | ||
writeShellScriptBin "postgrest-release-github" | ||
'' | ||
set -euo pipefail | ||
|
||
changes="$(sed -n "1,/${version}/d;/## \[/q;p" ${../../CHANGELOG.md})" | ||
version=$1 | ||
|
||
changes="$(sed -n "1,/$version/d;/## \[/q;p" ${../../CHANGELOG.md})" | ||
|
||
tar cvJf postgrest-$version-linux-x64-static.tar.xz \ | ||
-C ${postgrest}/bin postgrest | ||
|
||
${ghr}/bin/ghr \ | ||
-t "$GITHUB_TOKEN" \ | ||
-u "$GITHUB_USERNAME" \ | ||
-r "$GITHUB_REPONAME" \ | ||
-b "$changes" \ | ||
--replace v${version} \ | ||
${releaseFiles} | ||
--replace $version \ | ||
postgrest-$version-linux-x64-static.tar.xz | ||
''; | ||
|
||
# Wrapper for login with docker. $DOCKER_USER/$DOCKER_PASS vars come from CircleCI. | ||
# The DOCKER_USER is not the same as DOCKER_REPO because we use the https://hub.docker.com/u/postgrestbot account for uploading to dockerhub. | ||
dockerLogin = | ||
writeShellScriptBin "postgrest-docker-login" | ||
'' | ||
set -euo pipefail | ||
|
||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
''; | ||
|
||
# Script for publishing a new release on Docker Hub. | ||
|
@@ -48,13 +50,15 @@ let | |
'' | ||
set -euo pipefail | ||
|
||
version=$1 | ||
|
||
docker load -i ${docker.image} | ||
|
||
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:latest | ||
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:v${version} | ||
docker tag postgrest:latest "$DOCKER_REPO"/postgrest:$version | ||
|
||
docker push "$DOCKER_REPO"/postgrest:latest | ||
docker push "$DOCKER_REPO"/postgrest:v${version} | ||
docker push "$DOCKER_REPO"/postgrest:$version | ||
''; | ||
|
||
# Script for updating the repository description on Docker Hub. | ||
|
@@ -72,9 +76,9 @@ let | |
|
||
# Login to Docker Hub and get a token. | ||
token="$( | ||
${curl}/bin/curl -sH "Content-Type: application/json" \ | ||
--data-urlencode "username=$DOCKER_USERNAME" \ | ||
--data-urlencode "password=$DOCKER_PASSWORD" \ | ||
${curl}/bin/curl -s \ | ||
--data-urlencode "username=$DOCKER_USER" \ | ||
--data-urlencode "password=$DOCKER_PASS" \ | ||
"https://hub.docker.com/v2/users/login/" \ | ||
| ${jq}/bin/jq -r .token | ||
)" | ||
|
@@ -97,5 +101,5 @@ let | |
in | ||
buildEnv { | ||
name = "postgrest-release"; | ||
paths = [ github dockerHub dockerHubDescription ]; | ||
paths = [ github dockerLogin dockerHub dockerHubDescription ]; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monacoremo In case you're wondering. I deleted this nix function because I couldn't figure out how to pass a bash argument to it in
writeShellScriptBin "postgrest-release-github"
. My nix-fu isn't that good 😄.