Skip to content

Commit

Permalink
Merge aac923a into 7af9219
Browse files Browse the repository at this point in the history
  • Loading branch information
ta264 authored Jun 29, 2021
2 parents 7af9219 + aac923a commit 872b483
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 59 deletions.
114 changes: 94 additions & 20 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
parameters:
- name: runtimeBranch
displayName: Branch for runtime repository
displayName: Tag for runtime repository
type: string
default: v5.0.3
default: v6.0.0-preview.5
- name: aspBranch
displayName: Branch for aspnetcore repository
displayName: Tag for aspnetcore repository
type: string
default: v5.0.3
default: v6.0.0-preview.5
- name: sdkBranch
displayName: Branch for installer repository
displayName: Tag for sdk repository
type: string
default: v5.0.103
default: v6.0.100-preview.5
- name: installerBranch
displayName: Tag for installer repository
type: string
default: v6.0.100-preview.5

variables:
runCounter: $[counter('runNumber', 1)]
Expand All @@ -27,6 +31,11 @@ resources:
endpoint: Servarr
name: dotnet/aspnetcore
ref: release/5.0
- repository: sdk
type: github
endpoint: Servarr
name: dotnet/sdk
ref: release/5.0.1xx
- repository: installer
type: github
endpoint: Servarr
Expand All @@ -43,6 +52,7 @@ pr:

stages:
- stage: Runtime
dependsOn: []

pool:
vmImage: 'ubuntu-20.04'
Expand All @@ -62,17 +72,57 @@ stages:
- checkout: runtime
- bash: |
set -e
git -C runtime checkout ${{ parameters.runtimeBranch }}
git -C runtime tag | grep ${{ parameters.runtimeBranch }} | xargs git -C runtime checkout
git -C runtime revert -n 6055dfa7ecb7628fdb2570d8897e83520f69f280
sed -i '/\/dnceng\/internal\//d' runtime/NuGet.config
displayName: Checkout and patch
- bash: |
DOTNET_DOCKER_TAG="mcr.microsoft.com/dotnet-buildtools/prereqs:$(curl -s https://raw.githubusercontent.com/dotnet/versions/master/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-main.json | jq -r '.repos[0].images[] | select(.platforms[0].dockerfile | contains("freebsd/11")) | .platforms[0].simpleTags[0]')"
source dotnet-bsd/common.sh
get_runtime_docker
echo $DOTNET_DOCKER_TAG
docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/build.sh -ci -c Release -cross -os freebsd /p:BuildNumberMajor=21102 /p:BuildNumberMinor=12 /p:OfficialBuildId=20210202.12 /p:IsEligibleForNgenOptimization=false
calculate_build_id $(git -C runtime tag --points-at HEAD)
echo $OFFICIALBUILDID
docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os freebsd /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID || true
displayName: Build Runtime
- publish: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping'
artifact: RuntimePackages
displayName: Publish Runtime
- publish: '$(Build.SourcesDirectory)/runtime/artifacts/log'
condition: succeededOrFailed()
artifact: RuntimeLogs
displayName: Publish Build Logs

- stage: Sdk
dependsOn: []

pool:
vmImage: 'ubuntu-20.04'

jobs:
- job: Sdk
timeoutInMinutes: 0
steps:
- checkout: self
- checkout: sdk
- bash: |
set -e
git -C sdk tag | grep ${{ parameters.sdkBranch }} | xargs git -C sdk checkout
git -C sdk revert -n 9a1e8af8667f9315b5c9a61aae3f5c07d467f37c -m 1 -Xours
displayName: Checkout and patch
- bash: |
source dotnet-bsd/common.sh
calculate_build_id $(git -C sdk tag --points-at HEAD)
echo $OFFICIALBUILDID
sdk/build.sh -c Release -pack -ci /p:OfficialBuildId=$OFFICIALBUILDID
displayName: Build SDK
- publish: '$(Build.SourcesDirectory)/sdk/artifacts/packages/Release/NonShipping/'
artifact: SdkPackages
displayName: Publish SDK
- publish: '$(Build.SourcesDirectory)/sdk/artifacts/log'
condition: succeededOrFailed()
artifact: SdkLogs
displayName: Publish Build Logs


- stage: AspNetCore
dependsOn: Runtime
Expand All @@ -87,12 +137,13 @@ stages:
submodules: true
- bash: |
set -e
git -C aspnetcore checkout ${{ parameters.aspBranch }}
git -C aspnetcore tag | grep ${{ parameters.aspBranch }} | xargs git -C aspnetcore checkout
sed -i '/linux-x64;/a \ \ \ \ \ \ freebsd-x64;' aspnetcore/Directory.Build.props
sed -i '/<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.linux-x64" \/>/a \ \ \ \ <LatestPackageReference Include="Microsoft.NETCore.App.Runtime.freebsd-x64" \/>' aspnetcore/eng/Dependencies.props
sed -i 's/<Reference Include="Microsoft.NETCore.App.Crossgen2/<Reference Condition="'\''$(CrossgenOutput)'\'' == '\''true'\''" Include="Microsoft.NETCore.App.Crossgen2/' aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name local --configfile aspnetcore/NuGet.config
sed -i '/\/dnceng\/internal\//d' aspnetcore/NuGet.config
displayName: Apply patches
displayName: Checkout and patch
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
Expand All @@ -102,21 +153,30 @@ stages:
dotnet-runtime-*-freebsd-x64.tar.gz
Microsoft.*.freebsd-x64.*.nupkg
- bash: |
set -e
source dotnet-bsd/common.sh
calculate_build_id $(git -C aspnetcore tag --points-at HEAD)
echo $OFFICIALBUILDID
ls -lR runtime
mkdir -p aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime
cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime
aspnetcore/build.sh -c Release -ci --os-name freebsd -pack -nobl /p:CrossgenOutput=false /p:OfficialBuildId=$(date +%Y%m%d)-99
aspnetcore/eng/build.sh -c Release -ci --os-name freebsd -pack /p:CrossgenOutput=false /p:OfficialBuildId=$OFFICIALBUILDID
displayName: Build AspNetCore
- publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/packages/Release/Shipping'
artifact: AspNetCorePackages
displayName: Publish AspNetCore Packages
- publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/installers/Release'
artifact: AspNetCoreInstallers
displayName: Publish AspNetCore Installers
- publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/log'
condition: succeededOrFailed()
artifact: AspNetCoreLogs
displayName: Publish Build Logs


- stage: Installer
dependsOn: AspNetCore
dependsOn:
- AspNetCore
- Sdk
pool:
vmImage: 'ubuntu-20.04'
jobs:
Expand All @@ -127,16 +187,16 @@ stages:
- checkout: installer
- bash: |
set -e
git -C installer checkout ${{ parameters.sdkBranch }}
git -C installer tag | grep ${{ parameters.installerBranch }} | xargs git -C installer checkout
git -C installer apply ../dotnet-bsd/patches/installer/0001-freebsd-support.patch
sed -i 's/NetCore5AppHostRids Include="@(NetCore31RuntimePackRids)/NetCore5AppHostRids Include="@(NetCore31RuntimePackRids);freebsd-x64/' installer/src/redist/targets/GenerateBundledVersions.targets
sed -i 's/AspNetCore50RuntimePackRids Include="@(AspNetCore31RuntimePackRids)/AspNetCore50RuntimePackRids Include="@(AspNetCore31RuntimePackRids);freebsd-x64/' installer/src/redist/targets/GenerateBundledVersions.targets
sed -i 's/@(NetCore31RuntimePackRids);/@(NetCore31RuntimePackRids);freebsd-x64;/' installer/src/redist/targets/GenerateBundledVersions.targets
sed -i 's/@(AspNetCore31RuntimePackRids);/@(AspNetCore31RuntimePackRids);freebsd-x64;/' installer/src/redist/targets/GenerateBundledVersions.targets
dotnet nuget remove source msbuild --configfile installer/NuGet.config || true
dotnet nuget remove source nuget-build --configfile installer/NuGet.config || true
dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name runtime --configfile installer/NuGet.config
dotnet nuget add source ../aspnetcore/artifacts/packages/Release/Shipping --name aspnetcore --configfile installer/NuGet.config
sed -i '/\/dnceng\/internal\//d' installer/NuGet.config
displayName: Apply patches
displayName: Checkout and patch
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
Expand All @@ -158,15 +218,29 @@ stages:
artifactName: AspNetCoreInstallers
targetPath: '$(Build.SourcesDirectory)/aspnetcore/artifacts/installers/Release'
patterns: 'aspnetcore-runtime-*'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: SdkPackages
targetPath: '$(Build.SourcesDirectory)/sdk/artifacts/packages/Release/NonShipping/'
patterns: |
dotnet-toolset-internal-*.zip
- bash: |
set -e
source dotnet-bsd/common.sh
calculate_build_id $(git -C installer tag --points-at HEAD)
echo $OFFICIALBUILDID
ls -lR runtime
ls -lR aspnetcore
mkdir -p installer/artifacts/obj/redist/Release/downloads/
cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz installer/artifacts/obj/redist/Release/downloads/
cp aspnetcore/artifacts/installers/Release/aspnetcore-runtime-* installer/artifacts/obj/redist/Release/downloads/
installer/build.sh -c Release -ci -pack -nobl --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:OfficialBuildId=$(date +%Y%m%d)-99 /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True
cp sdk/artifacts/packages/Release/NonShipping/dotnet-toolset-internal-*.zip installer/artifacts/obj/redist/Release/downloads/
installer/build.sh -c Release -ci -pack --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True /p:OfficialBuildId=$OFFICIALBUILDID
displayName: Build Installer
- publish: '$(Build.SourcesDirectory)/installer/artifacts/packages/Release/Shipping'
artifact: Installer
displayName: Publish Installer
- publish: '$(Build.SourcesDirectory)/installer/artifacts/log'
condition: succeededOrFailed()
artifact: InstallerLogs
displayName: Publish Build Logs
39 changes: 0 additions & 39 deletions build.sh

This file was deleted.

30 changes: 30 additions & 0 deletions common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -e

function calculate_build_id()
{
local TAG=$1
local REGEX='-preview\.[0-9]\.([0-9]{5})\.([0-9]{1,2})'

if [[ $TAG =~ $REGEX ]]
then
local MAJOR=${BASH_REMATCH[1]}
local MINOR=${BASH_REMATCH[2]}

YEAR=$((MAJOR / 1000 + 2000))
MONTH=$(((MAJOR % 1000) / 50))
DAY=$((MAJOR % 50))

DATE=$((YEAR * 10000 + MONTH * 100 + DAY))

OFFICIALBUILDID="${DATE}.${MINOR}"
else
OFFICIALBUILDID=$(date +%Y%m%d).99
fi
}

function get_runtime_docker()
{
DOTNET_DOCKER_TAG="mcr.microsoft.com/dotnet-buildtools/prereqs:$(curl -s https://raw.githubusercontent.com/dotnet/versions/master/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-main.json | jq -r '.repos[0].images[] | select(.platforms[0].dockerfile | contains("freebsd/11")) | .platforms[0].simpleTags[0]')"
}

0 comments on commit 872b483

Please sign in to comment.