Welcome to mirror list, hosted at ThFree Co, Russian Federation.

branch.php « brancher - github.com/nextcloud/github_helper.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 96b3bcb30528efe69f20ed99af22d98752a86cef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
if(count($argv) !== 2) {
	die("branch.php \$branchname\n");
}
$branch = $argv[1];

// keep them in sync with the ones from tagger/tag.php
$repositories = [
	'nextcloud/server',
	'nextcloud/3rdparty',
	'nextcloud/activity',
	'nextcloud/circles',
	'nextcloud/documentation',
	'nextcloud/example-files',
	'nextcloud/files_pdfviewer',
	'nextcloud/files_rightclick',
	'nextcloud/files_videoplayer',
	'nextcloud/firstrunwizard',
	'nextcloud/logreader',
	'nextcloud/nextcloud_announcements',
	'nextcloud/notifications',
	'nextcloud/password_policy',
	'nextcloud/photos',
	'nextcloud/privacy',
	'nextcloud/recommendations',
	'nextcloud/serverinfo',
	'nextcloud/survey_client',
	'nextcloud/text',
	'nextcloud/updater',
	'nextcloud/viewer',
	'nextcloud-gmbh/support',
];

foreach($repositories as $repo) {
	$name = explode('/', $repo)[1];
	$SSH_OPTIONS = '';
	if ($name === 'support' && gethostname() === 'client-builder') {
		$SSH_OPTIONS = "GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa.support-app -o IdentitiesOnly=yes'";
	}
	// Clone the repository
	shell_exec('cd ' . __DIR__ . ' && ' . $SSH_OPTIONS . ' git clone git@github.com:' . $repo);
	// Checkout the new branch
	shell_exec('cd ' . __DIR__ . '/'. $name . ' && git checkout -b ' . $branch);
	// Push the branch
	shell_exec('cd ' . __DIR__ . '/' . $name . ' && ' . $SSH_OPTIONS . ' git push origin ' . $branch);
	// Delete repository
	shell_exec('cd ' . __DIR__ . ' && rm -rf ' . $name);
}