From owner-svn-src-user@freebsd.org Wed Jun 24 16:19:22 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD72916A31 for ; Wed, 24 Jun 2015 16:19:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27AB51DA4; Wed, 24 Jun 2015 16:19:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5OGJMmR035197; Wed, 24 Jun 2015 16:19:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5OGJMbU035196; Wed, 24 Jun 2015 16:19:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506241619.t5OGJMbU035196@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 24 Jun 2015 16:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r284770 - user/gjb/thermite X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2015 16:19:22 -0000 Author: gjb Date: Wed Jun 24 16:19:21 2015 New Revision: 284770 URL: https://svnweb.freebsd.org/changeset/base/284770 Log: Re-sync with the RE repository: - Rename build_ec2_ami() to upload_ec2_ami(), which is a more accurate name for what it does. - Add upload_azure_image() to automatically upload Microsoft Azure virtual machine images. - Log output from upload_azure_image() and upload_ec2_ami() to separate log files. Sponsored by: The FreeBSD Foundation Modified: user/gjb/thermite/thermite.sh Modified: user/gjb/thermite/thermite.sh ============================================================================== --- user/gjb/thermite/thermite.sh Wed Jun 24 16:18:58 2015 (r284769) +++ user/gjb/thermite/thermite.sh Wed Jun 24 16:19:21 2015 (r284770) @@ -303,7 +303,7 @@ build_release() { } # Upload AWS EC2 AMI images. -build_ec2_ami() { +upload_ec2_ami() { _build="${rev}-${arch}-${kernel}-${type}" _conf="${scriptdir}/${_build}.conf" source_config || return 0 @@ -331,11 +331,44 @@ build_ec2_ami() { AWSBUCKET=${AWSBUCKET} \ AWSKEYFILE=${AWSKEYFILE} \ EC2PUBLIC=${EC2PUBLIC} ec2ami \ - >> ${logdir}/${_build}.log 2>&1 + >> ${logdir}/${_build}.ec2.log 2>&1 unset _build _conf AWSREGION AWSBUCKET AWSKEYFILE EC2PUBLIC umount ${CHROOTDIR}/dev return 0 -} # build_ec2_ami() +} # upload_ec2_ami() + +# Upload Microsoft Azure virtual machine images. +upload_azure_image() { + _build="${rev}-${arch}-${kernel}-${type}" + _conf="${scriptdir}/${_build}.conf" + source_config || return 0 + case ${arch} in + amd64) + ;; + *) + return 0 + ;; + esac + if [ -z "${AZURE_UPLOAD_CONF}" ]; then + return 0 + fi + info "Uploading Azure virutal machine image for build: ${_build}" + if [ ! -e "${CHROOTDIR}/${AZURE_UPLOAD_CONF}" ]; then + cp -p ${AZURE_UPLOAD_CONF} ${CHROOTDIR}/${AZURE_UPLOAD_CONF} + if [ $? -ne 0 ]; then + info "Azure key file not found." + return 0 + fi + fi + mount -t devfs devfs ${CHROOTDIR}/dev + chroot ${CHROOTDIR} make -C /usr/src/release \ + AZURE_UPLOAD_CONF=${AZURE_UPLOAD_CONF} \ + azure-upload \ + >> ${logdir}/${_build}.azure.log 2>&1 + unset _build _conf AZURE_UPLOAD_CONF + umount ${CHROOTDIR}/dev + return 0 +} # upload_azure_image() # Install amd64/i386 "seed" chroots for all branches being built. install_chroots() { @@ -451,7 +484,8 @@ main() { runall build_chroots runall install_chroots runall build_release - runall build_ec2_ami + runall upload_ec2_ami + runall upload_azure_image } main "$@"