Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/fabfile/common.py
blob: 04b4409ca9ba1180a08ef63998807e755364836f (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
from fabric.api import local


instances = {"production":
             {"master_dir": "master",
              "slave_dir": "slave",
              "sandbox_dir": "sandbox",
              "branch": "master",
              "config":
              {"repo": "git://git.sugarlabs.org/sugar-build/sugar-build.git",
               "branch": "master",
               "distribute": True,
               "nightly_builds": True,
               "slaves_port": 9989,
               "snapshot": True,
               "web_port": 8080}},
             "testing":
             {"master_dir": "master-testing",
              "slave_dir": "slave-testing",
              "sandbox_dir": "sandbox-testing",
              "branch": "testing",
              "config":
              {"repo": "git://git.sugarlabs.org/sugar-build/sugar-build.git",
               "branch": "testing",
               "check_system": False,
               "slaves_port": 9990,
               "sub_repos_changes": False,
               "web_port": 8081}}}

slaves = {"buildbot@debian-wheezy-32bit.local": "debian-wheezy-32bit",
          "buildbot@debian-wheezy-64bit.local": "debian-wheezy-64bit",
          "buildbot@fedora-17-32bit.local": "fedora-17-32bit",
          "buildbot@fedora-17-64bit.local": "fedora-17-64bit",
          "buildbot@fedora-18-32bit.local": "fedora-18-32bit",
          "buildbot@fedora-18-64bit.local": "fedora-18-64bit",
          "buildbot@ubuntu-12-10-32bit.local": "ubuntu-12-10-32bit",
          "buildbot@ubuntu-12-10-64bit.local": "ubuntu-12-10-64bit"}

slave_gateway = "dnarvaez@bender.sugarlabs.org"

_instance_name = None


def get_virtualenv_activate(instance_name):
    return "source ~/%s/bin/activate" % instances[instance_name]["sandbox_dir"]


def get_instance_name():
    global _instance_name

    if _instance_name is None:
        branch = local("git rev-parse --abbrev-ref HEAD", capture=True)
        if branch == "master":
            _instance_name = "production"
        else:
            _instance_name = "testing"

    return _instance_name