functions: 0.3.4 release [skip ci]

This commit is contained in:
Travis Reeder
2017-05-27 09:41:11 -07:00
parent 49838565c4
commit 9ba22989f8
6 changed files with 40 additions and 21 deletions

1
.gitignore vendored
View File

@@ -17,6 +17,7 @@ vendor/
bolt.db bolt.db
.glide/ .glide/
/fnctl /fnctl
/fn
private.sh private.sh
.env .env

View File

@@ -207,10 +207,10 @@ func (s *Server) serve(ctx context.Context, c *gin.Context, appName string, foun
// ensure valid values // ensure valid values
if cfg.Timeout <= 0 { if cfg.Timeout <= 0 {
cfg.Timeout = DefaultTimeout cfg.Timeout = runner.DefaultTimeout
} }
if cfg.IdleTimeout <= 0 { if cfg.IdleTimeout <= 0 {
cfg.IdleTimeout = DefaultIdleTimeout cfg.IdleTimeout = runner.DefaultIdleTimeout
} }
s.Runner.Enqueue() s.Runner.Enqueue()

View File

@@ -1,4 +1,4 @@
package version package version
// Version of Functions // Version of Functions
var Version = "0.3.2" var Version = "0.3.4"

View File

@@ -3,7 +3,7 @@ set -e
# Install script to install fn # Install script to install fn
release="0.3.2" release="0.3.4"
command_exists() { command_exists() {
command -v "$@" > /dev/null 2>&1 command -v "$@" > /dev/null 2>&1

View File

@@ -2,21 +2,40 @@
set -ex set -ex
cd lambda # cd lambda
./release.sh # ./release.sh
cd .. # cd ..
make dep # make dep
make release # make release
version=$1 version=$1
url='https://api.github.com/repos/treeder/functions/releases' # For GitHub
# url='https://api.github.com/repos/treeder/functions/releases'
# output=$(curl -s -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY -d "{\"tag_name\": \"$version\", \"name\": \"$version\"}" $url)
# upload_url=$(echo "$output" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["upload_url"]' | sed -E "s/\{.*//")
# html_url=$(echo "$output" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["html_url"]')
# curl --data-binary "@fn_linux" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn_linux >/dev/null
# curl --data-binary "@fn_mac" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn_mac >/dev/null
# curl --data-binary "@fn.exe" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn.exe >/dev/null
output=$(curl -s -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY -d "{\"tag_name\": \"$version\", \"name\": \"$version\"}" $url) # For GitLab
upload_url=$(echo "$output" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["upload_url"]' | sed -E "s/\{.*//") # 1) Upload files: https://docs.gitlab.com/ee/api/projects.html#upload-a-file
html_url=$(echo "$output" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["html_url"]') upload_url='https://gitlab.oracledx.com/api/v3/projects/9/uploads'
curl --request POST --form "file=@fn_linux" --header "PRIVATE-TOKEN: $GITLAB_TOKEN" $upload_url
# curl --data-binary "@fn_mac" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn_mac >/dev/null
# curl --data-binary "@fn.exe" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn.exe >/dev/null
curl --data-binary "@fn_linux" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn_linux >/dev/null # url='https://gitlab.oracledx.com/api/v3/projects/9/uploads'
curl --data-binary "@fn_mac" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn_mac >/dev/null # output=$(curl -s -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY -d "{\"tag_name\": \"$version\", \"name\": \"$version\"}" $url)
curl --data-binary "@fn.exe" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn.exe >/dev/null
# upload_url=$(echo "$output" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["upload_url"]' | sed -E "s/\{.*//")
# html_url=$(echo "$output" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["html_url"]')
# curl --data-binary "@fn_linux" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn_linux >/dev/null
# curl --data-binary "@fn_mac" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn_mac >/dev/null
# curl --data-binary "@fn.exe" -H "Content-Type: application/octet-stream" -u $GH_DEPLOY_USER:$GH_DEPLOY_KEY $upload_url\?name\=fn.exe >/dev/null

View File

@@ -3,8 +3,8 @@ set -ex
user="treeder" user="treeder"
service="functions" service="functions"
version_file="api/version/version.go"
tag="latest" tag="latest"
version_file="api/version/version.go"
if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then
echo "did not find semantic version in $version_file" echo "did not find semantic version in $version_file"
@@ -27,10 +27,9 @@ git push
git push origin $version git push origin $version
# Finally tag and push docker images # Finally tag and push docker images
docker tag $user/$service:$tag $user/$service:$version # docker tag $user/$service:$tag $user/$service:$version
# docker push $user/$service:$version
docker push $user/$service:$version # docker push $user/$service:$tag
docker push $user/$service:$tag
cd fn cd fn
./release.sh $version ./release.sh $version