summaryrefslogtreecommitdiff
path: root/src/backend/branchmaster.py
blob: 6a114c58d3ce2746f97490d2261b9c0590004a7b (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/python3

import animation
import os
import subprocess
import sisyphus.filesystem

@animation.wait('injecting gentoo linux portage tree - branch master')
def setGitlabMasterStage1():
    if not os.path.isdir(os.path.join(sisyphus.filesystem.gentooEbuildDir, '.git')):
        os.chdir(sisyphus.filesystem.gentooEbuildDir)
        subprocess.call(['git', 'init', '-q'])
        subprocess.call(['git', 'remote', 'add', 'origin', 'https://gitlab.com/redcore/portage.git'])
        subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet'])
        subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet'])

@animation.wait('injecting redcore linux ebuild tree - branch master')
def setGitlabMasterStage2():
    if not os.path.isdir(os.path.join(sisyphus.filesystem.redcoreEbuildDir, '.git')):
        os.chdir(sisyphus.filesystem.redcoreEbuildDir)
        subprocess.call(['git', 'init', '-q'])
        subprocess.call(['git', 'remote', 'add', 'origin', 'https://gitlab.com/redcore/redcore-desktop.git'])
        subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet'])
        subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet'])

@animation.wait('injecting redcore linux portage configuration - branch master')
def setGitlabMasterStage3():
    if not os.path.isdir(os.path.join(sisyphus.filesystem.portageConfigDir, '.git')):
        os.chdir(sisyphus.filesystem.portageConfigDir)
        subprocess.call(['git', 'init', '-q'])
        subprocess.call(['git', 'remote', 'add', 'origin', 'https://gitlab.com/redcore/redcore-build.git'])
        subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet'])
        subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet'])

def gitlabStart():
    setGitlabMasterStage1()
    setGitlabMasterStage2()
    setGitlabMasterStage3()

@animation.wait('injecting gentoo linux portage tree - branch master')
def setPagureMasterStage1():
    if not os.path.isdir(os.path.join(sisyphus.filesystem.gentooEbuildDir, '.git')):
        os.chdir(sisyphus.filesystem.gentooEbuildDir)
        subprocess.call(['git', 'init', '-q'])
        subprocess.call(['git', 'remote', 'add', 'origin', 'https://pagure.io/redcore/portage.git'])
        subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet'])
        subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet'])

@animation.wait('injecting redcore linux ebuild tree - branch master')
def setPagureMasterStage2():
    if not os.path.isdir(os.path.join(sisyphus.filesystem.redcoreEbuildDir, '.git')):
        os.chdir(sisyphus.filesystem.redcoreEbuildDir)
        subprocess.call(['git', 'init', '-q'])
        subprocess.call(['git', 'remote', 'add', 'origin', 'https://pagure.io/redcore/redcore-desktop.git'])
        subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet'])
        subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet'])

@animation.wait('injecting redcore linux portage configuration - branch master')
def setPagureMasterStage3():
    if not os.path.isdir(os.path.join(sisyphus.filesystem.portageConfigDir, '.git')):
        os.chdir(sisyphus.filesystem.portageConfigDir)
        subprocess.call(['git', 'init', '-q'])
        subprocess.call(['git', 'remote', 'add', 'origin', 'https://pagure.io/redcore/redcore-build.git'])
        subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet'])
        subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet'])

def pagureStart():
    setPagureMasterStage1()
    setPagureMasterStage2()
    setPagureMasterStage3()