Skip to content

Commit

Permalink
Start implementing the chain.
Browse files Browse the repository at this point in the history
  • Loading branch information
alenz33 committed Mar 20, 2015
1 parent ac69a6b commit ede71a0
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 21 deletions.
45 changes: 24 additions & 21 deletions conduct.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

from conduct import loggers, config
from conduct.buildsteps import SystemCallStep, BuildStep
from conduct.chain import Chain

def parseArgv(argv):
parser = argparse.ArgumentParser(description='conduct - CONvenient Construction Tool',
Expand Down Expand Up @@ -87,27 +88,29 @@ def main(argv=None):
# configure logging
initLogging(args.chain)


try:
BuildStep('s1', {}).build()
BuildStep('s2', {}).build()
BuildStep('s3', {}).build()
bs = SystemCallStep('scs', {
'command' : 'ls',
'captureoutput' : True,
'workingdir' : '/var/',
})
bs.build()
print(bs.commandoutput)
#bs = CopyBS('copysth', {})
#bs.loglevel = 'debug'
#bs.description = 'Some description'
#bs.build()
except Exception as e:
conduct.log.exception(e)
conduct.log.error('')
conduct.log.error('Build failed')
return 1
chain = Chain(args.chain)


#try:
# BuildStep('s1', {}).build()
# BuildStep('s2', {}).build()
# BuildStep('s3', {}).build()
# bs = SystemCallStep('scs', {
# 'command' : 'ls',
# 'captureoutput' : True,
# 'workingdir' : '/var/',
# })
# bs.build()
# print(bs.commandoutput)
# #bs = CopyBS('copysth', {})
# #bs.loglevel = 'debug'
# #bs.description = 'Some description'
# #bs.build()
#except Exception as e:
# conduct.log.exception(e)
# conduct.log.error('')
# conduct.log.error('Build failed')
# return 1



Expand Down
38 changes: 38 additions & 0 deletions conduct/chain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# *****************************************************************************
# conduct - CONvenient Construction Tool
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Module authors:
# Alexander Lenz <alexander.lenz@posteo.de>
#
# *****************************************************************************

import conduct

from os import path

class Chain(object):
def __init__(self, name):
self.name = name

self. _loadConfig()


def _loadConfig(self):
chainDir = conduct.cfg['conduct']['chaindir']
chainFile = path.join(chainDir, '%s.py' % self.name)


0 comments on commit ede71a0

Please sign in to comment.