aboutsummaryrefslogtreecommitdiff
path: root/admin/genKeyPair.sh
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2017-05-10 09:25:11 +1000
committerGitHub <noreply@github.com>2017-05-10 09:25:11 +1000
commit8492b9d4228b45276343fcc194c3cc4f94c74b7c (patch)
treebf8d69b6f46252515f2f56c556ecf3c97b87b567 /admin/genKeyPair.sh
parent605760dbd421e648a0dae1d07517887f69e1caa8 (diff)
parent6afb291eea3dfadb889a3ea622d73457c2d4e3ef (diff)
downloadscala-async-8492b9d4228b45276343fcc194c3cc4f94c74b7c.tar.gz
scala-async-8492b9d4228b45276343fcc194c3cc4f94c74b7c.tar.bz2
scala-async-8492b9d4228b45276343fcc194c3cc4f94c74b7c.zip
Merge pull request #170 from lrytz/module-pluginv0.9.6#2.13.0-M1#8
Use scala-module-plugin, update tag-based publishing
Diffstat (limited to 'admin/genKeyPair.sh')
-rwxr-xr-xadmin/genKeyPair.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/admin/genKeyPair.sh b/admin/genKeyPair.sh
new file mode 100755
index 0000000..17db3f3
--- /dev/null
+++ b/admin/genKeyPair.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+#
+# Generates a key pair for this repository to sign artifacts.
+# Encrypt the private key and its passphrase in trusted builds
+# on Travis CI.
+#
+set -e
+
+# Based on https://gist.github.com/kzap/5819745:
+function promptDelete() {
+ if [[ -f "$1" ]]; then
+ echo About to delete $1, Enter for okay / CTRL-C to cancel
+ read
+ rm "$1"
+ fi
+}
+for f in admin/secring.asc.enc admin/secring.asc admin/pubring.asc; do promptDelete "$f"; done
+
+echo Generating key pair. Please enter 1. repo name 2. scala-internals@googlegroups.com, 3. a new passphrase
+echo Be careful when using special characters in the passphrase, see http://docs.travis-ci.com/user/encryption-keys/#Note-on-escaping-certain-symbols
+cp admin/gpg.sbt project
+sbt 'set pgpReadOnly := false' \
+ 'set pgpPublicRing := file("admin/pubring.asc")' \
+ 'set pgpSecretRing := file("admin/secring.asc")' \
+ 'pgp-cmd gen-key'
+rm project/gpg.sbt
+
+echo ============================================================================================
+echo Encrypting admin/secring.asc. Update K and IV variables in admin/build.sh accordingly.
+echo ============================================================================================
+travis encrypt-file admin/secring.asc
+rm admin/secring.asc
+mv secring.asc.enc admin
+
+echo ============================================================================================
+echo Encrypting environment variables. Add each to a line in .travis.yml. Include a comment
+echo with the name of the corresponding variable
+echo ============================================================================================
+read -s -p 'PGP_PASSPHRASE: ' PGP_PASSPHRASE
+travis encrypt PGP_PASSPHRASE="$PGP_PASSPHRASE"
+