-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbootstrap.php
49 lines (32 loc) · 931 Bytes
/
bootstrap.php
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
49
<?php
require 'vendor/autoload.php';
include('secret.php');
error_reporting(E_ALL);
define('ROOT', __DIR__);
/**
* Create Gitlab client
*/
$gitlabHttpClient = new \Buzz\Client\Curl();
$gitlabHttpClient->setOption(CURLOPT_SSL_VERIFYHOST, false);
$gitlabHttpClient->setVerifyPeer(false);
$gitlabClient = new \Gitlab\Client(GITLAB_URL, $gitlabHttpClient);
$gitlabClient->authenticate(GITLAB_ADMIN_TOKEN, \Gitlab\Client::AUTH_URL_TOKEN);
/**
* Create Github client
*/
$githubClient = new \Github\Client();
$githubClient->authenticate(GITHUB_TOKEN, null, \Github\Client::AUTH_URL_TOKEN);
/**
* Initialize DI container
*/
\ebuildy\github2gitlab\DIC::getInstance()->init($githubClient, $gitlabClient, $org);
/**
* Reset all project and user (optional)
*/
$reset = new \ebuildy\github2gitlab\Reset();
$reset->run();
/**
* Run migration
*/
$migrator = new \ebuildy\github2gitlab\Migrator();
$migrator->run(false);