summaryrefslogtreecommitdiff
path: root/make.py
diff options
context:
space:
mode:
authorjugglinmike <mike@mikepennisi.com>2017-04-10 15:31:19 -0400
committerLeo Balter <leonardo.balter@gmail.com>2017-04-10 15:31:19 -0400
commitbcb7651529bc641bf7bfe1c62efcd7b5bcb5b2ab (patch)
treeaada62db5d9999739a83d80bef8fa18f8937106e /make.py
parentda764cafa28ea15b194ac545dc1b67c707c62296 (diff)
downloadqtdeclarative-testsuites-bcb7651529bc641bf7bfe1c62efcd7b5bcb5b2ab.tar.gz
Automate deployment (#546)
Introduce configuration to allow build servers provided by the Travis CI service to execute the test generation tool and commit the resultant files to the canonical upstream repository. Enabling this workflow required additional administrative work: 1. Create an account with TravisCI 2. Install the `travis` command-line utility 3. Create a "deploy key" and an encrypted version using the command `./make.py github_deploy_key_enc` 4. Register the deploy key with the project's GitHub account 5. Check the encrypted deploy key to the repository 6. Configure the TravisCI service to automatically build this project
Diffstat (limited to 'make.py')
-rwxr-xr-xmake.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/make.py b/make.py
index 2d440b972..6594c5c5d 100755
--- a/make.py
+++ b/make.py
@@ -6,6 +6,8 @@ import os, shutil, subprocess, sys
OUT_DIR = os.environ.get('OUT_DIR') or 'test'
SRC_DIR = os.environ.get('SRC_DIR') or 'src'
+UPSTREAM = os.environ.get('UPSTREAM') or 'git@github.com:tc39/test262.git'
+MAINTAINER = os.environ.get('MAINTAINER') or 'test262@ecma-international.org'
def shell(*args):
sp = subprocess.Popen(list(args), stdout=subprocess.PIPE)
@@ -46,6 +48,32 @@ def build():
def clean():
shell(sys.executable, 'tools/generation/generator.py', 'clean', OUT_DIR)
+@target('clean', 'build')
+def deploy():
+ shell('git', 'add', '--all', OUT_DIR)
+ shell('git', 'commit', '--message', '"Re-build from source"')
+ shell('git', 'push', UPSTREAM, 'master')
+ shell('git', 'checkout', '-')
+
+# Generate a deploy key for use in a continuous integration system, allowing
+# for automated deployment in response to merge events.
+@target()
+def github_deploy_key():
+ shell('ssh-keygen',
+ '-t', 'rsa',
+ '-b', '4096',
+ '-C', MAINTAINER,
+ '-f', 'github-deploy-key')
+
+# Encrypt the deploy key so that it may be included in the repository (to be
+# decrypted by the continuous integration server during automated deployment)
+# This requires the "travis" Ruby gem
+# Source: https://docs.travis-ci.com/user/encrypting-files/
+@target('github_deploy_key')
+def github_deploy_key_enc():
+ shell('travis', 'login')
+ shell('travis', 'encrypt-file', 'github-deploy-key')
+
if len(sys.argv) == 1:
targets['build']()