add version metadata to package
also publish latest version metadata to blob storage
This commit is contained in:
parent
a1fbe60e13
commit
d5e9ac88ca
6 changed files with 37 additions and 11 deletions
|
@ -144,10 +144,6 @@ xcopy /s /q "%DNX_ROOT%" "%STAGE2_DIR%\dnx\"
|
|||
REM Copy the dotnet-restore script
|
||||
copy "%~dp0dotnet-restore.cmd" "%STAGE2_DIR%\dotnet-restore.cmd"
|
||||
|
||||
REM Stamp the output with the commit metadata
|
||||
git rev-parse HEAD > %STAGE2_DIR%/commit
|
||||
|
||||
|
||||
REM Smoke-test the output
|
||||
set PATH=%STAGE2_DIR%;%START_PATH%
|
||||
|
||||
|
|
|
@ -121,10 +121,6 @@ cp -R $DNX_ROOT $STAGE2_DIR/dnx
|
|||
cp $DIR/dotnet-restore.sh $STAGE2_DIR/dotnet-restore
|
||||
chmod a+x $STAGE2_DIR/dotnet-restore
|
||||
|
||||
# Stamp the output with the commit metadata
|
||||
COMMIT_ID=$(git rev-parse HEAD)
|
||||
echo $COMMIT_ID > $STAGE2_DIR/commit
|
||||
|
||||
# Smoke-test the output
|
||||
banner "Testing stage2 ..."
|
||||
export PATH=$STAGE2_DIR:$START_PATH
|
||||
|
|
|
@ -14,6 +14,14 @@ if(![string]::IsNullOrEmpty($env:DOTNET_BUILD_VERSION)) {
|
|||
$PackageVersion = "0.0.1-alpha-t$Timestamp"
|
||||
}
|
||||
|
||||
# Stamp the output with the commit metadata and version number
|
||||
$Commit = git rev-parse HEAD
|
||||
|
||||
@"
|
||||
$Commit
|
||||
$PackageVersion
|
||||
"@.Trim() > "$Stage2Dir/.version"
|
||||
|
||||
$PackageName = Join-Path $PackageDir "dotnet-win-x64.$PackageVersion.zip"
|
||||
|
||||
if (Test-Path $PackageName)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
|
@ -8,6 +7,13 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
|||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
REPOROOT="$( cd -P "$DIR/.." && pwd )"
|
||||
|
||||
source "$DIR/_common.sh"
|
||||
|
||||
OUTPUT_ROOT=$REPOROOT/artifacts/$RID
|
||||
STAGE2_DIR=$OUTPUT_ROOT/stage2
|
||||
|
||||
echo "Starting packaging"
|
||||
|
||||
if [ -z "$DOTNET_BUILD_VERSION" ]; then
|
||||
|
@ -16,6 +22,9 @@ if [ -z "$DOTNET_BUILD_VERSION" ]; then
|
|||
echo "Version: $DOTNET_BUILD_VERSION"
|
||||
fi
|
||||
|
||||
COMMIT=$(git rev-parse HEAD)
|
||||
echo "$COMMIT\n$DOTNET_BUILD_VERSION" > $STAGE2_DIR/.version
|
||||
|
||||
# Create Dnvm Package
|
||||
$DIR/package-dnvm.sh
|
||||
|
||||
|
|
|
@ -87,6 +87,15 @@ function UploadBinaries($zipFile)
|
|||
return -1
|
||||
}
|
||||
|
||||
# update the version file
|
||||
$versionFile = Convert-Path (Join-Path $PSScriptRoot\..\artifacts\win7-x64\stage2\.version)
|
||||
$Version_URI = "https://$env:STORAGE_ACCOUNT.blob.core.windows.net/$env:STORAGE_CONTAINER/$env:CHANNEL/dnvm/latest.win.version$env:SASTOKEN"
|
||||
|
||||
if(-Not (UploadFile $Version_URI $versionFile))
|
||||
{
|
||||
return -1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
|||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
REPOROOT="$( cd -P "$SCRIPT_DIR/.." && pwd )"
|
||||
|
||||
source "$SCRIPT_DIR/_common.sh"
|
||||
|
||||
|
@ -139,8 +140,15 @@ upload_binaries_to_blob_storage(){
|
|||
# update the index file
|
||||
local indexContent="Binaries/$DOTNET_BUILD_VERSION/$filename"
|
||||
local indexfile="latest.$OSNAME.index"
|
||||
local update_URL="https://$STORAGE_ACCOUNT.blob.core.windows.net/$STORAGE_CONTAINER/$CHANNEL/dnvm/$indexfile$SASTOKEN"
|
||||
update_file_in_blob_storage $update_URL $indexfile $indexContent
|
||||
local index_URL="https://$STORAGE_ACCOUNT.blob.core.windows.net/$STORAGE_CONTAINER/$CHANNEL/dnvm/$indexfile$SASTOKEN"
|
||||
update_file_in_blob_storage $index_URL $indexfile $indexContent
|
||||
|
||||
# update the version file
|
||||
local versionContent = $(cat $REPOROOT/artifacts/$RID/stage2/.version)
|
||||
local versionfile="latest.$OSNAME.version"
|
||||
local version_URL="https://$STORAGE_ACCOUNT.blob.core.windows.net/$STORAGE_CONTAINER/$CHANNEL/dnvm/$versionfile$SASTOKEN"
|
||||
update_file_in_blob_storage $version_URL $versionfile $versionContent
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue