Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@azure:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@azure-rest:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@colors:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@dabh:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@js-joda:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@microsoft:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@opentelemetry:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@so-ric:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@types:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
@typespec:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/
13 changes: 13 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="upstream-public"
value="https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="upstream-public">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
20 changes: 19 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ $FUNC_RUNTIME_VERSION = 'latest'
Write-Host "Installing Core Tools globlally using npm, version: $FUNC_RUNTIME_VERSION ..."

$FUNC_CLI_DIRECTORY = Join-Path $currDir 'Azure.Functions.Cli'
$repoNpmConfig = Join-Path $PSScriptRoot '.npmrc'
if ([string]::IsNullOrWhiteSpace($Env:NPM_CONFIG_USERCONFIG)) {
$Env:NPM_CONFIG_USERCONFIG = $repoNpmConfig
}
if (-not (Test-Path -LiteralPath $Env:NPM_CONFIG_USERCONFIG -PathType Leaf)) {
throw "NPM_CONFIG_USERCONFIG does not point to a file: $Env:NPM_CONFIG_USERCONFIG"
}

# 1. Clean previous install
Remove-Item -Recurse -Force $FUNC_CLI_DIRECTORY -ErrorAction Ignore
Expand All @@ -78,7 +85,18 @@ $globalNode = (npm root -g | Out-String).Trim() # e.g. /usr/local/li
$moduleRoot = Join-Path $globalNode 'azure-functions-core-tools'

# 3. npm install → temp folder
npm install -g azure-functions-core-tools@$FUNC_RUNTIME_VERSION --unsafe-perm true --foreground-scripts --loglevel verbose
$npmInstallArguments = @(
'install'
'--global'
"azure-functions-core-tools@$FUNC_RUNTIME_VERSION"
'--unsafe-perm'
'true'
'--foreground-scripts'
'--loglevel'
'verbose'
)
& npm @npmInstallArguments
StopOnFailedExecution

# 4. Copy CLI payload into the layout required tests
Copy-Item "$moduleRoot\bin\*" $FUNC_CLI_DIRECTORY -Recurse -Force
Expand Down
10 changes: 9 additions & 1 deletion eng/ci/templates/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ jobs:
os: windows

steps:
- task: npmAuthenticate@0
displayName: 'Authenticate npm to CFS'
inputs:
workingFile: .npmrc

- pwsh: |
Write-Host "Java_HOME: $JAVA_HOME"
Get-Command mvn
displayName: 'Check Maven is installed'

- pwsh: '& .\build.ps1'
displayName: 'Build project with java library'
displayName: 'Build project with java library'
env:
NPM_CONFIG_USERCONFIG: $(Build.SourcesDirectory)/.npmrc
27 changes: 23 additions & 4 deletions eng/ci/templates/official/jobs/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ jobs:
ApplicationInsightAgentVersion: 3.5.2

steps:
- task: NuGetToolInstaller@1
- task: npmAuthenticate@0
displayName: 'Authenticate npm to CFS'
inputs:
checkLatest: true
displayName: 'Install NuGet Tool'
workingFile: .npmrc

- task: NuGetAuthenticate@1
displayName: 'Authenticate NuGet to CFS'

- pwsh: |
Write-Host "Java_HOME: $env:JAVA_HOME"
Expand All @@ -30,9 +33,11 @@ jobs:
displayName: 'Install .NET 6'
inputs:
version: 6.0.x

- pwsh: '& .\build.ps1'
displayName: 'Build project with java library'
env:
NPM_CONFIG_USERCONFIG: $(Build.SourcesDirectory)/.npmrc

- pwsh: |
$currDir = Get-Location
Expand All @@ -45,19 +50,33 @@ jobs:
displayName: 'Package Java for E2E'
condition: eq(${{ parameters.runEndToEndTests }}, true)

- task: DotNetCoreCLI@2
retryCountOnTaskFailure: 3
inputs:
command: 'restore'
projects: |
azure-functions-java-worker/emulatedtests/Azure.Functions.Java.Tests.E2E/Azure.Functions.Java.Tests.E2E/Azure.Functions.Java.Tests.E2E.csproj
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
displayName: 'Restore E2E tests from CFS'
condition: eq(${{ parameters.runEndToEndTests }}, true)

- bash: |
npm install -g azurite
mkdir azurite
azurite --silent --location azurite --debug azurite\debug.log &
displayName: 'Install and Run Azurite'
condition: eq(${{ parameters.runEndToEndTests }}, true)
env:
NPM_CONFIG_USERCONFIG: $(Build.SourcesDirectory)/.npmrc

- task: DotNetCoreCLI@2
retryCountOnTaskFailure: 3
inputs:
command: 'test'
projects: |
azure-functions-java-worker/emulatedtests/Azure.Functions.Java.Tests.E2E/Azure.Functions.Java.Tests.E2E/Azure.Functions.Java.Tests.E2E.csproj
arguments: '--no-restore'
env:
AzureWebJobsStorage: "UseDevelopmentStorage=true"
JAVA_HOME: $(JAVA_HOME_8_X64)
Expand Down