Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #609 from sym3tri/release-script-fixes
Browse files Browse the repository at this point in the history
Release script fixes
  • Loading branch information
Quentin-M authored May 10, 2017
2 parents 321237e + 076c5a2 commit 0399b46
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
24 changes: 24 additions & 0 deletions builder-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -e
#
# A utility script for executing arbitrary local scripts via docker.
# This can be used for executing build/release scripts locally in our build container in the absence of Jenkins.
#
# USAGE:
#
# With env vars:
# MYVAR=foo OTHERVAR=bar DOCKER_ENV=MYVAR,OTHERVAR ./builder-run ./my-script --my-script-arg1 --my-script-arg2
#
# Without env vars:
# ./builder-run ./my-script --my-script-arg1 --my-script-arg2

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# forward whitelisted env variables to docker
ENV_STR=""
for VAR in ${DOCKER_ENV//,/ }; do
ENV_STR="$ENV_STR -e $VAR=${!VAR}"
done

PROJECT=$SCRIPT_DIR
set -x
docker run --user="${BUILDER_RUN_USER}" $ENV_STR --rm -v $PROJECT:/go/src/github.com/coreos/tectonic-installer -w /go/src/coreos/tectonic-installer $DOCKER_RUN_ARGS $BUILDER_IMAGE $@
9 changes: 7 additions & 2 deletions installer/scripts/release/make_github_release.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#!/bin/bash -e

# USAGE:
# export GITHUB_CREDENTIALS=username:personal-access-token
# export TECTONIC_RELEASE_TARBALL_URL=url-of-tarball
# export VERSION=w.x.y-tectonic.z

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$DIR/common.env.sh"

GITHUB_API_URL="https://api.github.com/repos/coreos-inc/tectonic/releases"
GITHUB_API_URL="https://api.github.com/repos/coreos/tectonic-installer/releases"

echo "Creating new release on GitHub"
curl \
--fail \
-u "$GITHUB_CREDENTIALS" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$VERSION\",\"body\":\"Release tarball is available at $TECTONIC_RELEASE_TARBALL_URL.\"}" \
-d "{\"tag_name\":\"$VERSION\",\"prerelease\":true,\"body\":\"Release tarball is available at $TECTONIC_RELEASE_TARBALL_URL.\"}" \
$GITHUB_API_URL

0 comments on commit 0399b46

Please sign in to comment.