#!/bin/bash ############################################################################### # Copyright (c) 2011 Linaro # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################### # # This scripts deploys jenkins config # set -e TSTAMP=`date '+%Y%m%dT%H%M'` # be sure to execute in deployment dir cd function header() { echo "======================================" echo $1 echo "======================================" } if [[ `bzr lp-login` =~ "No Launchpad user" ]]; then echo "You must configure your Launchpad ID using bzr lp-login" exit 1 fi echo "Launchpad ID: " `bzr lp-login` header "Deploying jenkins-config" sudo service jenkins stop if [ -d jenkins-config ]; then sudo mv jenkins-config jenkins-config.$TSTAMP fi bzr branch lp:~linaro-infrastructure/linaro-android/jenkins-config sudo chown -R jenkins jenkins-config/ if [ -d /var/lib/jenkins ]; then sudo mv /var/lib/jenkins /var/lib/jenkins.orig fi sudo ln -s $PWD/jenkins-config /var/lib/jenkins sudo service jenkins start