Skip to content
This repository was archived by the owner on Jun 1, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion braid/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ def create(self, site_packages=False):
self.install("setuptools wheel")


def remove(self):
"""
Remove the virtualenv.
"""
with settings(user=self._user):
run("rm -rf {}".format(self._location))


def install(self, package):
"""
Install a package into the virtualenv. It updates if there is a newer
Expand All @@ -51,7 +59,7 @@ def install_twisted(self):
attrs==16.3.0
cffi==1.9.1
constantly==15.1.0
cryptography==1.7.1
cryptography==1.8.1
enum34==1.1.6
h2==2.5.1
hpack==2.3.0
Expand Down
16 changes: 13 additions & 3 deletions services/amptrac/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,19 @@ def update(self):
os.path.dirname(__file__) + '/*', self.configDir,
mirror_local_mode=True)

self.venv.install_twisted()
self.venv.install('git+https://github.com/twisted-infra/amptrac.git')
self.venv.install('git+https://github.com/twisted-infra/amptrac-server')
self.task_recreateVirtualEnvironment()


def task_recreateVirtualEnvironment(self):
"""
Recreate the virtual environment.
"""
self.venv.remove()
self.venv.create()
self.venv.install_twisted()
self.venv.install('git+https://github.com/twisted-infra/amptrac.git')
self.venv.install('git+https://github.com/twisted-infra/amptrac-server')


def task_update(self):
"""
Expand Down
62 changes: 35 additions & 27 deletions services/buildbot/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,36 +87,44 @@ def update(self, _installDeps=False):
os.path.dirname(__file__) + '/start', self.configDir,
mirror_local_mode=True)

buildbotSource = os.path.join(self.configDir, 'buildbot-source')
buildmasterSource = os.path.join(buildbotSource, 'master')
# For now we are using a buildbot eight HEAD due to a bug in
# 0.8.12
# https://github.com/buildbot/buildbot/pull/1924
# A forked branch is still used to control its version.
# If changes are required to this branch it should use a name
# other than `eight` to reduce confusion.
buildbotBranch = 'eight'
git.branch(
url='https://github.com/twisted-infra/buildbot',
destination=buildbotSource,
branch=buildbotBranch,
)

self.venv.install_twisted()
self.venv.install("virtualenv twisted==16.2 txacme==0.9.1 txgithub>=15.0.0")

if _installDeps:
# sqlalchemy-migrate only works with a specific version of
# sqlalchemy.
self.venv.install(
'sqlalchemy==0.7.10 sqlalchemy-migrate==0.7.2 '
'{}'.format(buildmasterSource))
else:
self.venv.install('--no-deps {}'.format(buildmasterSource))

self.task_recreateVirtualEnvironment(_installDeps)
self.updatefast()


def task_recreateVirtualEnvironment(self, installDeps=False):
"""
Recreate the virtual environment.
"""
self.venv.remove()
self.venv.create()
self.venv.install_twisted()
self.venv.install("virtualenv twisted==16.2 txacme==0.9.1 txgithub>=15.0.0")

buildbotSource = os.path.join(self.configDir, 'buildbot-source')
buildmasterSource = os.path.join(buildbotSource, 'master')
# For now we are using a buildbot eight HEAD due to a bug in
# 0.8.12
# https://github.com/buildbot/buildbot/pull/1924
# A forked branch is still used to control its version.
# If changes are required to this branch it should use a name
# other than `eight` to reduce confusion.
buildbotBranch = 'eight'
git.branch(
url='https://github.com/twisted-infra/buildbot',
destination=buildbotSource,
branch=buildbotBranch,
)

if installDeps:
# sqlalchemy-migrate only works with a specific version of
# sqlalchemy.
self.venv.install(
'sqlalchemy==0.7.10 sqlalchemy-migrate==0.7.2 '
'{}'.format(buildmasterSource))
else:
self.venv.install('--no-deps {}'.format(buildmasterSource))


def updatefast(self):
"""
Update only some of the config.
Expand Down
22 changes: 16 additions & 6 deletions services/codespeed/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,26 @@ def update(self):
os.path.dirname(__file__) + '/*', self.configDir,
mirror_local_mode=True)

git.branch('https://github.com/tobami/codespeed.git', '~/codespeed')
with cd("~/codespeed"):
run("git checkout 9893b87de02bdc1ea6256207de5cc010b095b3a5")
run("git reset --hard")
self.venv.install_twisted()
self.venv.install('-r ~/codespeed/requirements.txt')
self.task_recreateVirtualEnvironment()

if env.get('installTestData'):
execute(self.task_installTestData)


def task_recreateVirtualEnvironment(self):
"""
Recreate the virtual environment.
"""
self.venv.remove()
self.venv.create()
git.branch('https://github.com/tobami/codespeed.git', '~/codespeed')
with cd("~/codespeed"):
run("git checkout 9893b87de02bdc1ea6256207de5cc010b095b3a5")
run("git reset --hard")
self.venv.install_twisted()
self.venv.install('-r ~/codespeed/requirements.txt')


def djangoAdmin(self, args):
"""
Run django-admin with proper settings.
Expand Down
12 changes: 11 additions & 1 deletion services/kenaan/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def update(self):
]
run('mkdir -p ' + self.configDir)

self.venv.install("git+https://github.com/twisted-infra/amptrac.git")
self.task_recreateVirtualEnvironment()

for f in filesToCopy:
put(os.path.join(os.path.dirname(__file__), f), self.configDir,
Expand All @@ -87,6 +87,16 @@ def update(self):
execute(self.task_installTestData)


def task_recreateVirtualEnvironment(self):
"""
Recreate the virtual environment.
"""
self.venv.remove()
self.venv.create()
self.venv.install_twisted()
self.venv.install("git+https://github.com/twisted-infra/amptrac.git")


def task_update(self):
"""
Update config and restart.
Expand Down
12 changes: 11 additions & 1 deletion services/t-names/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ def update(self):
Update config.
"""
with settings(user=self.serviceUser):
self.venv.install_twisted()
self.task_recreateVirtualEnvironment()
run('mkdir -p ' + self.configDir)
put(
os.path.dirname(__file__) + '/*', self.configDir,
mirror_local_mode=True)


def task_recreateVirtualEnvironment(self):
"""
Recreate the virtual environment.
"""
self.venv.remove()
self.venv.create()
self.venv.install_twisted()


def task_update(self):
"""
Update config and restart.
Expand Down
13 changes: 11 additions & 2 deletions services/t-web/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,24 @@ def task_updateSoftware(self):
Update just the Twisted versions.
"""
self.task_stop()
self.venv.install_twisted()
self.task_recreateVirtualEnvironment()
self.task_start()


def task_recreateVirtualEnvironment(self):
"""
Recreate the virtual environment.
"""
self.venv.remove()
self.venv.create()
self.venv.install_twisted()


def update(self):
"""
Update config.
"""
self.venv.install_twisted()
self.task_recreateVirtualEnvironment()

with settings(user=self.serviceUser):
run('mkdir -p ' + self.configDir)
Expand Down
14 changes: 10 additions & 4 deletions services/trac/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ def update(self):
Remove the current trac installation and reinstalls it.
"""
with settings(user=self.serviceUser):
self.venv.create()

run('mkdir -p ' + self.configDir)
put(os.path.dirname(__file__) + '/*', self.configDir,
mirror_local_mode=True)
self.task_recreateVirtualEnvironment()


self.venv.install_twisted()
self.venv.install(" ".join("""
def task_recreateVirtualEnvironment(self):
"""
Recreate the virtual environment.
"""
self.venv.remove()
self.venv.create()
self.venv.install_twisted()
self.venv.install(" ".join("""
psycopg2==2.6.2
pygments==1.6
spambayes==1.1b2
Expand Down