From owner-svn-src-all@FreeBSD.ORG Sun Jun 21 04:39:35 2015 Return-Path: Delivered-To: svn-src-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91E428F3; Sun, 21 Jun 2015 04:39:35 +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 665392E1; Sun, 21 Jun 2015 04:39:35 +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 t5L4dZN7091057; Sun, 21 Jun 2015 04:39:35 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5L4dY3O091055; Sun, 21 Jun 2015 04:39:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506210439.t5L4dY3O091055@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 21 Jun 2015 04:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r284661 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2015 04:39:35 -0000 Author: gjb Date: Sun Jun 21 04:39:34 2015 New Revision: 284661 URL: https://svnweb.freebsd.org/changeset/base/284661 Log: MFC r284567: Add Makefile.azure, used to upload VHD images to the Microsoft Azure environment, similar to the EC2 AMIs. Sponsored by: The FreeBSD Foundation Added: stable/10/release/Makefile.azure - copied unchanged from r284567, head/release/Makefile.azure Modified: stable/10/release/Makefile.vm Directory Properties: stable/10/ (props changed) Copied: stable/10/release/Makefile.azure (from r284567, head/release/Makefile.azure) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/Makefile.azure Sun Jun 21 04:39:34 2015 (r284661, copy of r284567, head/release/Makefile.azure) @@ -0,0 +1,53 @@ +# +# $FreeBSD$ +# +# +# Makefile for uploading Microsoft Azure disk images. +# + +AZURE_IMG?= ${.OBJDIR}/azure.vhdf +AZURE_UPLOAD_TGTS= azure-check-depends \ + azure-do-upload +CLEANFILES+= ${AZURE_UPLOAD_TGTS} + +.if defined(AZURE_UPLOAD_CONF) && !empty(AZURE_UPLOAD_CONF) +. for VAR in _STORAGE _ACCOUNT _KEY +AZURE${VAR}!= grep -E ^AZURE${VAR} ${AZURE_UPLOAD_CONF} | awk -F' ' '{print $$2}' +. endfor +.endif + +.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" +SNAPSHOT_DATE!= date +-%Y-%m-%d +.endif + +AZURE_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.vhd + +azure-upload: ${AZURE_UPLOAD_TGTS} + +azure-check-depends: +.for VAR in _STORAGE _ACCOUNT _KEY +. if !defined(AZURE${VAR}) || empty(AZURE${VAR}) + @echo "Variable AZURE${VAR} cannot be empty." + @false +. endif +.endfor +.if !exists(/usr/local/bin/azure) +. if !exists(/usr/local/bin/npm) +. if !exists(${PORTSDIR}/www/npm/Makefile) +. if !exists(/usr/local/sbin/pkg-static) + env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf +. endif + env ASSUME_ALWAYS_YES=yes pkg install -y www/npm +. else + make -C ${PORTSDIR}/www/npm BATCH=1 all install clean +. endif +. endif + npm install -g azure-cli +.endif + +azure-do-upload: + /usr/local/bin/azure storage blob upload \ + ${AZURE_IMG} ${AZURE_STORAGE} ${AZURE_TARGET} \ + -t page -a ${AZURE_ACCOUNT} -k "${AZURE_KEY}" + touch ${.OBJDIR}/${.TARGET} + Modified: stable/10/release/Makefile.vm ============================================================================== --- stable/10/release/Makefile.vm Sun Jun 21 04:34:57 2015 (r284660) +++ stable/10/release/Makefile.vm Sun Jun 21 04:39:34 2015 (r284661) @@ -154,3 +154,4 @@ cloudware-install: .endif .include "${.CURDIR}/Makefile.ec2" +.include "${.CURDIR}/Makefile.azure"