diff options
Diffstat (limited to '000.yarn')
-rw-r--r-- | 000.yarn | 61 |
1 files changed, 56 insertions, 5 deletions
@@ -204,9 +204,11 @@ groups, and respositories. AND admin creates repository qvarn AND admin sets qvarn config writers to qvarndevs THEN ian can clone qvarn - WHEN ian create qvarn branch bugfix + WHEN ian creates qvarn branch bugfix AND ian changes qvarn branch bugfix - THEN ian can push qvarn branch bugfix + THEN ian can push qvarn + WHEN ian merges qvarn branch bugfix to master + THEN ian can push qvarn FINALLY admin removes things that were created SCENARIO everyone can clone a public repository @@ -240,7 +242,22 @@ groups, and respositories. repo = helper.get_next_match() # FIXME: Create first, this is temporary helper.append_to_list('repositories', repo) - output = helper.gitano(None, 'create {}'.format(repo)) + helper.gitano(None, 'create {}'.format(repo)) + + user = 'admin' + url = helper.repo_ssh_url(repo) + dirname = helper.local_checkout_dirname(user, repo) + helper.git_as(None, ['clone', url, dirname]) + env = dict(os.environ) + env['GIT_SSH_COMMAND'] = helper.env_ssh_command(None) + cliapp.runcmd(['git', 'config', 'user.email', user], cwd=dirname, env=env) + cliapp.runcmd(['git', 'config', 'user.name', user], cwd=dirname, env=env) + with open(os.path.join(dirname, 'foo.txt'), 'a') as f: + f.write('') + cliapp.runcmd(['git', 'add', 'foo.txt'], cwd=dirname, env=env) + cliapp.runcmd(['git', 'commit', '-mfoo'], cwd=dirname, env=env) + cliapp.runcmd(['git', 'push', 'origin', 'HEAD'], cwd=dirname, env=env) + IMPLEMENTS WHEN admin sets (\S+) config (\S+) to (\S+) repo = helper.get_next_match() @@ -252,16 +269,50 @@ groups, and respositories. user = helper.get_next_match() repo = helper.get_next_match() url = helper.repo_ssh_url(repo) - dirname = '{}_{}'.format(user, repo) + dirname = helper.local_checkout_dirname(user, repo) helper.git_as(user, ['clone', url, dirname]) + cliapp.runcmd(['git', 'config', 'user.email', user], cwd=dirname) + cliapp.runcmd(['git', 'config', 'user.name', user], cwd=dirname) IMPLEMENTS THEN we can clone (\S+) via the git protocol repo = helper.get_next_match() server = os.environ['GITANO_SERVER'] url = 'git://{}/{}'.format(server, repo) - dirname = 'anonymouse_{}'.format(repo) + dirname = helper.local_checkout_dirname('anonymous', repo) cliapp.runcmd(['git', 'clone', url, dirname]) + IMPLEMENTS WHEN (\S+) creates (\S+) branch (\S+) + user = helper.get_next_match() + repo = helper.get_next_match() + branch = helper.get_next_match() + dirname = helper.local_checkout_dirname(user, repo) + cliapp.runcmd(['git', 'checkout', '-b', branch], cwd=dirname) + + IMPLEMENTS WHEN (\S+) changes (\S+) branch (\S+) + user = helper.get_next_match() + repo = helper.get_next_match() + branch = helper.get_next_match() + dirname = helper.local_checkout_dirname(user, repo) + with open(os.path.join(dirname, 'foo.txt'), 'a') as f: + f.write('foo\n') + cliapp.runcmd(['git', 'add', 'foo.txt'], cwd=dirname) + cliapp.runcmd(['git', 'commit', '-mfoo'], cwd=dirname) + + IMPLEMENTS THEN (\S+) can push (\S+) + user = helper.get_next_match() + repo = helper.get_next_match() + dirname = helper.local_checkout_dirname(user, repo) + cliapp.runcmd(['git', 'push', '--all', 'origin'], cwd=dirname) + + IMPLEMENTS WHEN (\S+) merges (\S+) branch (\S+) to (\S+) + user = helper.get_next_match() + repo = helper.get_next_match() + branch_from = helper.get_next_match() + branch_to = helper.get_next_match() + dirname = helper.local_checkout_dirname(user, repo) + cliapp.runcmd(['git', 'checkout', branch_to], cwd=dirname) + cliapp.runcmd(['git', 'merge', branch_from], cwd=dirname) + IMPLEMENTS FINALLY admin removes things that were created def iter(var, prefix): items = helper.get_variable(var, []) |