fix: remove fabfile - we're no longer auto-deploying

This commit is contained in:
Michael Große 2018-04-24 14:29:52 +02:00
commit c4d382781c
No known key found for this signature in database
GPG key ID: 7E31028FBFEACC79
2 changed files with 0 additions and 79 deletions

View file

@ -1,18 +0,0 @@
sprintdoc-farm:
environment: sprintdoc-farm
tags:
- locally
only:
- live
script:
- fab deploy
cosmocode-farm:
environment: cosmocode-farm
tags:
- locally
only:
- live
script:
- fab deploy

61
fabfile.py vendored
View file

@ -1,61 +0,0 @@
import os
import sys
import json
from fabric.api import run, env, cd
config = {
'TARGET_PORT': 6589,
'TARGET_USER': 'www-data',
}
try:
TARGET_CONF = json.loads(os.getenv('TARGET_CONF'))
except (SyntaxError, ValueError) as e:
print 'Could not parse configuration: %s' % e
sys.exit(1)
BUILD_JOB_NAME = os.getenv('CI_BUILD_NAME')
if BUILD_JOB_NAME not in TARGET_CONF:
print 'Could not find job configuration for %s' % BUILD_JOB_NAME
sys.exit(1)
else:
config.update(TARGET_CONF[BUILD_JOB_NAME])
BRANCH = os.getenv('CI_BUILD_REF_NAME')
if not BRANCH:
print 'Could not get branch name from configuration: Please specify CI_BUILD_REF_NAME env var'
sys.exit(1)
for option in ['TARGET_HOST', 'TARGET_PATH']:
if not config.get(option):
print 'Could not get %s from configuration!' % option
sys.exit(1)
env.hosts = [config.get('TARGET_HOST')]
env.port = config.get('TARGET_PORT')
env.user = config.get('TARGET_USER')
def pre():
if config.get('PRE_CMDS'):
[run(cmd) for cmd in config.get('PRE_CMDS')]
def git_pull():
run('git fetch --all')
run('git checkout --force %s' % BRANCH)
run('git reset --hard origin/%s' % BRANCH)
def post():
if config.get('POST_CMDS'):
[run(cmd) for cmd in config.get('POST_CMDS')]
def deploy():
with cd(config.get('TARGET_PATH')):
pre()
git_pull()
post()