Skip to content

Commit

Permalink
Add fabfile as install.py
Browse files Browse the repository at this point in the history
  • Loading branch information
taiojia committed Jul 28, 2015
1 parent eff4ad1 commit fb914e1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 15 deletions.
8 changes: 0 additions & 8 deletions fabfile.py

This file was deleted.

45 changes: 45 additions & 0 deletions install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# The MIT License (MIT)
#
# Copyright (c) 2015 Taio Jia (jiasir) <jiasir@icloud.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

__author__ = 'jiasir(Taio)'

import os
import shutil

try:
from fabric.api import local
except ImportError:
os.system('python setup.py install')


def copy_tools():
if not os.path.exists('/etc/playback'):
os.mkdir('/etc/playback')
shutil.copy('inventory/inventory_ha', '/etc/playback/playback.conf')


def deploy_playback():
local('python setup.py install')
copy_tools()

if __name__ == '__main__':
deploy_playback()
8 changes: 1 addition & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
# SOFTWARE.

import sys
import os
import shutil


try:
from setuptools import setup, find_packages
Expand All @@ -46,8 +45,3 @@
'bin/playback',
],
data_files=[],)

if not os.path.exists('/etc/playback'):
os.mkdir('/etc/playback')

shutil.copy('inventory/inventory', '/etc/playback/playback.conf')

0 comments on commit fb914e1

Please sign in to comment.