示例#1
0
	def _getSimpleCiDataDir( self, instanceName = None ):
		# we need to replace the MApplication instance
		oldInstance = MApplication.instance
		MApplication.instance = None

		# instantiate SimpleCiBase instance
		simpleCiInstance = Slave()
		simpleCiInstance.setName( self.TestInstanceName )
		dir = simpleCiInstance.getDataDir()

		# reset MApplication instance
		MApplication.instance = oldInstance
		return dir
示例#2
0
# 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, see <http://www.gnu.org/licenses/>.

from buildcontrol.simple_ci.Master import Master
from buildcontrol.simple_ci.Slave import Slave
import sys
from core.helpers.GlobalMApp import mApp

def make_slave():
	# we have to copy some code here to instantiate the correct Simple CI instance (Master/Slave)
	for o in sys.argv[1:]:
		if o in ( "-s", "--slave" ):
			return True

	return False

if __name__ == "__main__":
	if make_slave():
		ci = Slave()
	else:
		ci = Master()

	# apply instance name if supplied
	if mApp().getParameters().getInstanceName():
		ci.setName( mApp().getParameters().getInstanceName() )

	ci.build()