This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
#3 Want targets to build smartos images and releases
Also platform-smartos target no longer needed as targets.json target.
- Loading branch information
Showing
with
146 additions
and 1 deletion.
- +36 −0 Makefile
- +1 −1 targets.json.in
- +5 −0 tools/jenkins-build
- +19 −0 tools/smartos-index
- +85 −0 tools/smartos-release
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
| # | ||
| # This Source Code Form is subject to the terms of the Mozilla Public | ||
| # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| # file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| # | ||
|
|
||
| # | ||
| # Copyright (c) 2014, Joyent, Inc. | ||
| # | ||
|
|
||
| echo "<html>" | ||
| echo "<head><title>SmartOS ${1}</title></head>" | ||
| echo "<body>" | ||
| for x in `ls * | grep -v index.html`; do | ||
| echo "<a href=\"$x\">$x</a><br>" | ||
| done | ||
| echo "<a href=\"md5sums.txt\">md5sums.txt</a>" | ||
| echo "</body></html>" |
| @@ -0,0 +1,85 @@ | ||
| #!/bin/bash | ||
| # | ||
| # This Source Code Form is subject to the terms of the Mozilla Public | ||
| # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| # file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| # | ||
|
|
||
| # | ||
| # Copyright (c) 2014, Joyent, Inc. | ||
| # | ||
|
|
||
| # Update the SmartOS release directory | ||
| if [ "$TRACE" != "" ]; then | ||
| export PS4='${BASH_SOURCE}:${LINENO}: ' | ||
| set -o xtrace | ||
| fi | ||
| set -o errexit | ||
|
|
||
| TOP=$(cd $(dirname $0)/../; pwd) | ||
| BITS_DIR=bits/ | ||
| PATH=$PATH:${TOP}/node_modules/manta/bin | ||
|
|
||
| # --- Manta config | ||
| if [[ -z "$MANTA_KEY_ID" ]]; then | ||
| export MANTA_KEY_ID=`ssh-keygen -l -f ~/.ssh/id_rsa.pub | awk '{print $2}' | tr -d '\n'` | ||
| fi | ||
| if [[ -z "$MANTA_URL" ]]; then | ||
| export MANTA_URL=https://us-east.manta.joyent.com | ||
| fi | ||
| if [[ -z "$MANTA_USER" ]]; then | ||
| export MANTA_USER="Joyent_Dev"; | ||
| fi | ||
|
|
||
|
|
||
| function fatal { | ||
| echo "$(basename $0): error: $1" | ||
| exit 1 | ||
| } | ||
|
|
||
| function errexit { | ||
| [[ $1 -ne 0 ]] || exit 0 | ||
| fatal "error exit status $1 at line $2" | ||
| } | ||
|
|
||
| function print_help() { | ||
| echo "Usage:" | ||
| echo " ./tools/smartos-release BRANCH TIMESTAMP" | ||
| echo "" | ||
| echo "Create snaplinks under /\${MANTA_USER}/public/SmartOS/\${TIMESTAMP}" | ||
| echo "pointing to objects under /\${MANTA_USER}/public/builds/smartos/\${BRANCH}-\${TIMESTAMP}/smartos/" | ||
| } | ||
|
|
||
| trap 'errexit $? $LINENO' EXIT | ||
|
|
||
| BRANCH=$1 | ||
| shift | ||
| TIMESTAMP=$1 | ||
|
|
||
| SOURCE=/${MANTA_USER}/public/builds/smartos/${BRANCH}-${TIMESTAMP}/smartos/ | ||
| SMARTOS=/${MANTA_USER}/public/SmartOS | ||
| DESTINATION=${SMARTOS}/${TIMESTAMP} | ||
|
|
||
| start_time=$(date +%s) | ||
| echo "Creating release snaplinks under ${DESTINATION}" | ||
|
|
||
| mmkdir -v -p ${DESTINATION} | ||
| mfind ${SOURCE} -t o | while read OBJECT; do | ||
| mln ${OBJECT} ${DESTINATION}/$(basename ${OBJECT}) | ||
| done | ||
|
|
||
| echo "Updating top level ${SMARTOS} snaplinks" | ||
| mln ${SOURCE}/platform-${TIMESTAMP}.tgz ${SMARTOS}/platform-latest.tgz | ||
| mln ${SOURCE}/smartos-${TIMESTAMP}.iso ${SMARTOS}/smartos-latest.iso | ||
| mln ${SOURCE}/smartos-${TIMESTAMP}-USB.img.bz2 ${SMARTOS}/smartos-latest-USB.img.bz2 | ||
| mln ${SOURCE}/smartos-${TIMESTAMP}.vmwarevm.tar.bz2 ${SMARTOS}/smartos-latest.vmwarevm.tar.bz2 | ||
|
|
||
| echo "Updating ${SMARTOS}/latest object" | ||
| echo ${DESTINATION} | mput -v -H 'content-type: text/plain' ${SMARTOS}/latest | ||
|
|
||
| echo "<html><head><meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=${SOURCE}/index.html\"></head></html>" | mput -H 'content-type: text/html' ${SMARTOS}/latest.html | ||
|
|
||
| end_time=$(date +%s) | ||
| elapsed=$((${end_time} - ${start_time})) | ||
| echo "Creating release snaplinks took ${elapsed} seconds (Manta path=${DESTINATION})" | ||
| exit 0 |