mirror of
https://github.com/actions/runner.git
synced 2025-12-12 15:13:30 +00:00
Compare commits
7 Commits
fhammerl/2
...
users/tihu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0dd60e815 | ||
|
|
37d1aa10aa | ||
|
|
34cdb04de6 | ||
|
|
41fcb3f152 | ||
|
|
6593716f32 | ||
|
|
3bc49d0567 | ||
|
|
f8db7860dc |
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,18 +1,12 @@
|
|||||||
---
|
---
|
||||||
name: 🛑 Report a bug in the runner application
|
name: Bug report
|
||||||
about: If you have issues with GitHub Actions, please follow the "support for GitHub Actions" link, below.
|
about: Create a report to help us improve
|
||||||
title: ''
|
title: ''
|
||||||
labels: bug
|
labels: bug
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
|
||||||
👋 You're opening a bug report against the GitHub Actions **runner application**.
|
|
||||||
|
|
||||||
🛑 Please stop if you're not certain that the bug you're seeing is in the runner application - if you have general problems with actions, workflows, or runners, please see the [GitHub Community Support Forum](https://github.community/c/code-to-cloud/52) which is actively monitored. Using the forum ensures that we route your problem to the correct team. 😃
|
|
||||||
-->
|
|
||||||
|
|
||||||
**Describe the bug**
|
**Describe the bug**
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
|||||||
11
.github/ISSUE_TEMPLATE/config.yml
vendored
11
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,11 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: ✅ Support for GitHub Actions
|
|
||||||
url: https://github.community/c/code-to-cloud/52
|
|
||||||
about: If you have questions about GitHub Actions or need support writing workflows, please ask in the GitHub Community Support forum.
|
|
||||||
- name: ✅ Feedback and suggestions for GitHub Actions
|
|
||||||
url: https://github.com/github/feedback/discussions/categories/actions-and-packages-feedback
|
|
||||||
about: If you have feedback or suggestions about GitHub Actions, please open a discussion (or add to an existing one) in the GitHub Actions Feedback. GitHub Actions Product Managers and Engineers monitor the feedback forum.
|
|
||||||
- name: ‼️ GitHub Security Bug Bounty
|
|
||||||
url: https://bounty.github.com/
|
|
||||||
about: Please report security vulnerabilities here.
|
|
||||||
13
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
13
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
@@ -1,24 +1,19 @@
|
|||||||
---
|
---
|
||||||
name: 🛑 Request a feature in the runner application
|
name: Feature Request
|
||||||
about: If you have feature requests for GitHub Actions, please use the "feedback and suggestions for GitHub Actions" link below.
|
about: Create a request to help us improve
|
||||||
title: ''
|
title: ''
|
||||||
labels: enhancement
|
labels: enhancement
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
Thank you 🙇♀ for wanting to create a feature in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue **relates to code in this repository**.
|
||||||
👋 You're opening a request for an enhancement in the GitHub Actions **runner application**.
|
|
||||||
|
|
||||||
🛑 Please stop if you're not certain that the feature you want is in the runner application - if you have a suggestion for improving GitHub Actions, please see the [GitHub Actions Feedback](https://github.com/github/feedback/discussions/categories/actions-and-packages-feedback) discussion forum which is actively monitored. Using the forum ensures that we route your problem to the correct team. 😃
|
|
||||||
|
|
||||||
Some additional useful links:
|
|
||||||
* If you have found a security issue [please submit it here](https://hackerone.com/github)
|
* If you have found a security issue [please submit it here](https://hackerone.com/github)
|
||||||
* If you have questions or issues with the service, writing workflows or actions, then please [visit the GitHub Community Forum's Actions Board](https://github.community/t5/GitHub-Actions/bd-p/actions)
|
* If you have questions or issues with the service, writing workflows or actions, then please [visit the GitHub Community Forum's Actions Board](https://github.community/t5/GitHub-Actions/bd-p/actions)
|
||||||
* If you are having an issue or have a question about GitHub Actions then please [contact customer support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-github-actions#contacting-support)
|
* If you are having an issue or question about GitHub Actions then please [contact customer support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-github-actions#contacting-support)
|
||||||
|
|
||||||
If you have a feature request that is relevant to this repository, the runner, then please include the information below:
|
If you have a feature request that is relevant to this repository, the runner, then please include the information below:
|
||||||
-->
|
|
||||||
|
|
||||||
**Describe the enhancement**
|
**Describe the enhancement**
|
||||||
A clear and concise description of what the features or enhancement you need.
|
A clear and concise description of what the features or enhancement you need.
|
||||||
|
|||||||
43
.github/workflows/build.yml
vendored
43
.github/workflows/build.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
runtime: [ linux-x64, linux-arm64, linux-arm, win-x64, osx-x64 ]
|
runtime: [ linux-x64, linux-musl-x64, linux-arm64, linux-arm, win-x64, osx-x64 ]
|
||||||
include:
|
include:
|
||||||
- runtime: linux-x64
|
- runtime: linux-x64
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
@@ -32,17 +32,21 @@ jobs:
|
|||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
devScript: ./dev.sh
|
devScript: ./dev.sh
|
||||||
|
|
||||||
|
- runtime: linux-musl-x64
|
||||||
|
os: ubuntu-latest
|
||||||
|
devScript: ./dev.sh
|
||||||
|
|
||||||
- runtime: osx-x64
|
- runtime: osx-x64
|
||||||
os: macOS-latest
|
os: macOS-latest
|
||||||
devScript: ./dev.sh
|
devScript: ./dev.sh
|
||||||
|
|
||||||
- runtime: win-x64
|
- runtime: win-x64
|
||||||
os: windows-2019
|
os: windows-latest
|
||||||
devScript: ./dev
|
devScript: ./dev
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
# Build runner layout
|
# Build runner layout
|
||||||
- name: Build & Layout Release
|
- name: Build & Layout Release
|
||||||
@@ -55,30 +59,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
${{ matrix.devScript }} test
|
${{ matrix.devScript }} test
|
||||||
working-directory: src
|
working-directory: src
|
||||||
if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm'
|
if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm' && matrix.runtime != 'linux-musl-x64'
|
||||||
|
|
||||||
# Check runtime/externals hash
|
|
||||||
- name: Compute/Compare runtime and externals Hash
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "Current dotnet runtime hash result: $DOTNET_RUNTIME_HASH"
|
|
||||||
echo "Current Externals hash result: $EXTERNALS_HASH"
|
|
||||||
|
|
||||||
NeedUpdate=0
|
|
||||||
if [ "$EXTERNALS_HASH" != "$(cat ./src/Misc/contentHash/externals/${{ matrix.runtime }})" ] ;then
|
|
||||||
echo Hash mismatch, Update ./src/Misc/contentHash/externals/${{ matrix.runtime }} to $EXTERNALS_HASH
|
|
||||||
NeedUpdate=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$DOTNET_RUNTIME_HASH" != "$(cat ./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }})" ] ;then
|
|
||||||
echo Hash mismatch, Update ./src/Misc/contentHash/dotnetRuntime/${{ matrix.runtime }} to $DOTNET_RUNTIME_HASH
|
|
||||||
NeedUpdate=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit $NeedUpdate
|
|
||||||
env:
|
|
||||||
DOTNET_RUNTIME_HASH: ${{hashFiles('**/_layout_trims/runtime/**/*')}}
|
|
||||||
EXTERNALS_HASH: ${{hashFiles('**/_layout_trims/externals/**/*')}}
|
|
||||||
|
|
||||||
# Create runner package tar.gz/zip
|
# Create runner package tar.gz/zip
|
||||||
- name: Package Release
|
- name: Package Release
|
||||||
@@ -90,11 +71,7 @@ jobs:
|
|||||||
# Upload runner package tar.gz/zip as artifact
|
# Upload runner package tar.gz/zip as artifact
|
||||||
- name: Publish Artifact
|
- name: Publish Artifact
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: runner-package-${{ matrix.runtime }}
|
name: runner-package-${{ matrix.runtime }}
|
||||||
path: |
|
path: _package
|
||||||
_package
|
|
||||||
_package_trims/trim_externals
|
|
||||||
_package_trims/trim_runtime
|
|
||||||
_package_trims/trim_runtime_externals
|
|
||||||
|
|||||||
5
.github/workflows/codeql.yml
vendored
5
.github/workflows/codeql.yml
vendored
@@ -1,12 +1,7 @@
|
|||||||
name: "Code Scanning - Action"
|
name: "Code Scanning - Action"
|
||||||
|
|
||||||
permissions:
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
pull_request:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 0'
|
- cron: '0 0 * * 0'
|
||||||
|
|||||||
343
.github/workflows/release.yml
vendored
343
.github/workflows/release.yml
vendored
@@ -51,21 +51,6 @@ jobs:
|
|||||||
linux-arm-sha: ${{ steps.sha.outputs.linux-arm-sha256 }}
|
linux-arm-sha: ${{ steps.sha.outputs.linux-arm-sha256 }}
|
||||||
win-x64-sha: ${{ steps.sha.outputs.win-x64-sha256 }}
|
win-x64-sha: ${{ steps.sha.outputs.win-x64-sha256 }}
|
||||||
osx-x64-sha: ${{ steps.sha.outputs.osx-x64-sha256 }}
|
osx-x64-sha: ${{ steps.sha.outputs.osx-x64-sha256 }}
|
||||||
linux-x64-sha-noexternals: ${{ steps.sha_noexternals.outputs.linux-x64-sha256 }}
|
|
||||||
linux-arm64-sha-noexternals: ${{ steps.sha_noexternals.outputs.linux-arm64-sha256 }}
|
|
||||||
linux-arm-sha-noexternals: ${{ steps.sha_noexternals.outputs.linux-arm-sha256 }}
|
|
||||||
win-x64-sha-noexternals: ${{ steps.sha_noexternals.outputs.win-x64-sha256 }}
|
|
||||||
osx-x64-sha-noexternals: ${{ steps.sha_noexternals.outputs.osx-x64-sha256 }}
|
|
||||||
linux-x64-sha-noruntime: ${{ steps.sha_noruntime.outputs.linux-x64-sha256 }}
|
|
||||||
linux-arm64-sha-noruntime: ${{ steps.sha_noruntime.outputs.linux-arm64-sha256 }}
|
|
||||||
linux-arm-sha-noruntime: ${{ steps.sha_noruntime.outputs.linux-arm-sha256 }}
|
|
||||||
win-x64-sha-noruntime: ${{ steps.sha_noruntime.outputs.win-x64-sha256 }}
|
|
||||||
osx-x64-sha-noruntime: ${{ steps.sha_noruntime.outputs.osx-x64-sha256 }}
|
|
||||||
linux-x64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.linux-x64-sha256 }}
|
|
||||||
linux-arm64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.linux-arm64-sha256 }}
|
|
||||||
linux-arm-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.linux-arm-sha256 }}
|
|
||||||
win-x64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.win-x64-sha256 }}
|
|
||||||
osx-x64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.osx-x64-sha256 }}
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
runtime: [ linux-x64, linux-arm64, linux-arm, win-x64, osx-x64 ]
|
runtime: [ linux-x64, linux-arm64, linux-arm, win-x64, osx-x64 ]
|
||||||
@@ -87,12 +72,12 @@ jobs:
|
|||||||
devScript: ./dev.sh
|
devScript: ./dev.sh
|
||||||
|
|
||||||
- runtime: win-x64
|
- runtime: win-x64
|
||||||
os: windows-2019
|
os: windows-latest
|
||||||
devScript: ./dev
|
devScript: ./dev
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
# Build runner layout
|
# Build runner layout
|
||||||
- name: Build & Layout Release
|
- name: Build & Layout Release
|
||||||
@@ -114,6 +99,14 @@ jobs:
|
|||||||
${{ matrix.devScript }} package Release ${{ matrix.runtime }}
|
${{ matrix.devScript }} package Release ${{ matrix.runtime }}
|
||||||
working-directory: src
|
working-directory: src
|
||||||
|
|
||||||
|
# Upload runner package tar.gz/zip as artifact.
|
||||||
|
# Since each package name is unique, so we don't need to put ${{matrix}} info into artifact name
|
||||||
|
- name: Publish Artifact
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: runner-packages
|
||||||
|
path: _package
|
||||||
# compute shas and set as job outputs to use in release notes
|
# compute shas and set as job outputs to use in release notes
|
||||||
- run: brew install coreutils #needed for shasum util
|
- run: brew install coreutils #needed for shasum util
|
||||||
if: ${{ matrix.os == 'macOS-latest' }}
|
if: ${{ matrix.os == 'macOS-latest' }}
|
||||||
@@ -127,91 +120,6 @@ jobs:
|
|||||||
id: sha
|
id: sha
|
||||||
name: Compute SHA256
|
name: Compute SHA256
|
||||||
working-directory: _package
|
working-directory: _package
|
||||||
- run: |
|
|
||||||
file=$(ls)
|
|
||||||
sha=$(sha256sum $file | awk '{ print $1 }')
|
|
||||||
echo "Computed sha256: $sha for $file"
|
|
||||||
echo "::set-output name=${{matrix.runtime}}-sha256::$sha"
|
|
||||||
echo "::set-output name=sha256::$sha"
|
|
||||||
shell: bash
|
|
||||||
id: sha_noexternals
|
|
||||||
name: Compute SHA256
|
|
||||||
working-directory: _package_trims/trim_externals
|
|
||||||
- run: |
|
|
||||||
file=$(ls)
|
|
||||||
sha=$(sha256sum $file | awk '{ print $1 }')
|
|
||||||
echo "Computed sha256: $sha for $file"
|
|
||||||
echo "::set-output name=${{matrix.runtime}}-sha256::$sha"
|
|
||||||
echo "::set-output name=sha256::$sha"
|
|
||||||
shell: bash
|
|
||||||
id: sha_noruntime
|
|
||||||
name: Compute SHA256
|
|
||||||
working-directory: _package_trims/trim_runtime
|
|
||||||
- run: |
|
|
||||||
file=$(ls)
|
|
||||||
sha=$(sha256sum $file | awk '{ print $1 }')
|
|
||||||
echo "Computed sha256: $sha for $file"
|
|
||||||
echo "::set-output name=${{matrix.runtime}}-sha256::$sha"
|
|
||||||
echo "::set-output name=sha256::$sha"
|
|
||||||
shell: bash
|
|
||||||
id: sha_noruntime_noexternals
|
|
||||||
name: Compute SHA256
|
|
||||||
working-directory: _package_trims/trim_runtime_externals
|
|
||||||
|
|
||||||
- name: Create trimmedpackages.json for ${{ matrix.runtime }}
|
|
||||||
if: matrix.runtime == 'win-x64'
|
|
||||||
uses: actions/github-script@0.3.0
|
|
||||||
with:
|
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
script: |
|
|
||||||
const core = require('@actions/core')
|
|
||||||
const fs = require('fs');
|
|
||||||
const runnerVersion = fs.readFileSync('src/runnerversion', 'utf8').replace(/\n$/g, '')
|
|
||||||
var trimmedPackages = fs.readFileSync('src/Misc/trimmedpackages_zip.json', 'utf8').replace(/<RUNNER_VERSION>/g, runnerVersion).replace(/<RUNNER_PLATFORM>/g, '${{ matrix.runtime }}')
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<RUNTIME_HASH>/g, '${{hashFiles('**/_layout_trims/runtime/**/*')}}')
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<EXTERNALS_HASH>/g, '${{hashFiles('**/_layout_trims/externals/**/*')}}')
|
|
||||||
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<NO_RUNTIME_EXTERNALS_HASH>/g, '${{steps.sha_noruntime_noexternals.outputs.sha256}}')
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<NO_RUNTIME_HASH>/g, '${{steps.sha_noruntime.outputs.sha256}}')
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<NO_EXTERNALS_HASH>/g, '${{steps.sha_noexternals.outputs.sha256}}')
|
|
||||||
|
|
||||||
console.log(trimmedPackages)
|
|
||||||
fs.writeFileSync('${{ matrix.runtime }}-trimmedpackages.json', trimmedPackages)
|
|
||||||
|
|
||||||
- name: Create trimmedpackages.json for ${{ matrix.runtime }}
|
|
||||||
if: matrix.runtime != 'win-x64'
|
|
||||||
uses: actions/github-script@0.3.0
|
|
||||||
with:
|
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
script: |
|
|
||||||
const core = require('@actions/core')
|
|
||||||
const fs = require('fs');
|
|
||||||
const runnerVersion = fs.readFileSync('src/runnerversion', 'utf8').replace(/\n$/g, '')
|
|
||||||
var trimmedPackages = fs.readFileSync('src/Misc/trimmedpackages_targz.json', 'utf8').replace(/<RUNNER_VERSION>/g, runnerVersion).replace(/<RUNNER_PLATFORM>/g, '${{ matrix.runtime }}')
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<RUNTIME_HASH>/g, '${{hashFiles('**/_layout_trims/runtime/**/*')}}')
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<EXTERNALS_HASH>/g, '${{hashFiles('**/_layout_trims/externals/**/*')}}')
|
|
||||||
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<NO_RUNTIME_EXTERNALS_HASH>/g, '${{steps.sha_noruntime_noexternals.outputs.sha256}}')
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<NO_RUNTIME_HASH>/g, '${{steps.sha_noruntime.outputs.sha256}}')
|
|
||||||
trimmedPackages = trimmedPackages.replace(/<NO_EXTERNALS_HASH>/g, '${{steps.sha_noexternals.outputs.sha256}}')
|
|
||||||
|
|
||||||
console.log(trimmedPackages)
|
|
||||||
fs.writeFileSync('${{ matrix.runtime }}-trimmedpackages.json', trimmedPackages)
|
|
||||||
|
|
||||||
# Upload runner package tar.gz/zip as artifact.
|
|
||||||
# Since each package name is unique, so we don't need to put ${{matrix}} info into artifact name
|
|
||||||
- name: Publish Artifact
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: runner-packages
|
|
||||||
path: |
|
|
||||||
_package
|
|
||||||
_package_trims/trim_externals
|
|
||||||
_package_trims/trim_runtime
|
|
||||||
_package_trims/trim_runtime_externals
|
|
||||||
${{ matrix.runtime }}-trimmedpackages.json
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -242,21 +150,6 @@ jobs:
|
|||||||
releaseNote = releaseNote.replace(/<LINUX_X64_SHA>/g, '${{needs.build.outputs.linux-x64-sha}}')
|
releaseNote = releaseNote.replace(/<LINUX_X64_SHA>/g, '${{needs.build.outputs.linux-x64-sha}}')
|
||||||
releaseNote = releaseNote.replace(/<LINUX_ARM_SHA>/g, '${{needs.build.outputs.linux-arm-sha}}')
|
releaseNote = releaseNote.replace(/<LINUX_ARM_SHA>/g, '${{needs.build.outputs.linux-arm-sha}}')
|
||||||
releaseNote = releaseNote.replace(/<LINUX_ARM64_SHA>/g, '${{needs.build.outputs.linux-arm64-sha}}')
|
releaseNote = releaseNote.replace(/<LINUX_ARM64_SHA>/g, '${{needs.build.outputs.linux-arm64-sha}}')
|
||||||
releaseNote = releaseNote.replace(/<WIN_X64_SHA_NOEXTERNALS>/g, '${{needs.build.outputs.win-x64-sha-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<OSX_X64_SHA_NOEXTERNALS>/g, '${{needs.build.outputs.osx-x64-sha-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_X64_SHA_NOEXTERNALS>/g, '${{needs.build.outputs.linux-x64-sha-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_ARM_SHA_NOEXTERNALS>/g, '${{needs.build.outputs.linux-arm-sha-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_ARM64_SHA_NOEXTERNALS>/g, '${{needs.build.outputs.linux-arm64-sha-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<WIN_X64_SHA_NORUNTIME>/g, '${{needs.build.outputs.win-x64-sha-noruntime}}')
|
|
||||||
releaseNote = releaseNote.replace(/<OSX_X64_SHA_NORUNTIME>/g, '${{needs.build.outputs.osx-x64-sha-noruntime}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_X64_SHA_NORUNTIME>/g, '${{needs.build.outputs.linux-x64-sha-noruntime}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_ARM_SHA_NORUNTIME>/g, '${{needs.build.outputs.linux-arm-sha-noruntime}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_ARM64_SHA_NORUNTIME>/g, '${{needs.build.outputs.linux-arm64-sha-noruntime}}')
|
|
||||||
releaseNote = releaseNote.replace(/<WIN_X64_SHA_NORUNTIME_NOEXTERNALS>/g, '${{needs.build.outputs.win-x64-sha-noruntime-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<OSX_X64_SHA_NORUNTIME_NOEXTERNALS>/g, '${{needs.build.outputs.osx-x64-sha-noruntime-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_X64_SHA_NORUNTIME_NOEXTERNALS>/g, '${{needs.build.outputs.linux-x64-sha-noruntime-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_ARM_SHA_NORUNTIME_NOEXTERNALS>/g, '${{needs.build.outputs.linux-arm-sha-noruntime-noexternals}}')
|
|
||||||
releaseNote = releaseNote.replace(/<LINUX_ARM64_SHA_NORUNTIME_NOEXTERNALS>/g, '${{needs.build.outputs.linux-arm64-sha-noruntime-noexternals}}')
|
|
||||||
console.log(releaseNote)
|
console.log(releaseNote)
|
||||||
core.setOutput('version', runnerVersion);
|
core.setOutput('version', runnerVersion);
|
||||||
core.setOutput('note', releaseNote);
|
core.setOutput('note', releaseNote);
|
||||||
@@ -272,14 +165,14 @@ jobs:
|
|||||||
body: |
|
body: |
|
||||||
${{ steps.releaseNote.outputs.note }}
|
${{ steps.releaseNote.outputs.note }}
|
||||||
|
|
||||||
# Upload release assets (full runner packages)
|
# Upload release assets
|
||||||
- name: Upload Release Asset (win-x64)
|
- name: Upload Release Asset (win-x64)
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
||||||
asset_path: ${{ github.workspace }}/_package/actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}.zip
|
asset_path: ${{ github.workspace }}/actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}.zip
|
||||||
asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}.zip
|
asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}.zip
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
@@ -289,7 +182,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
||||||
asset_path: ${{ github.workspace }}/_package/actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
asset_path: ${{ github.workspace }}/actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
||||||
asset_name: actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
asset_name: actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
@@ -299,7 +192,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
||||||
asset_path: ${{ github.workspace }}/_package/actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
asset_path: ${{ github.workspace }}/actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
||||||
asset_name: actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
asset_name: actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
@@ -309,7 +202,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
||||||
asset_path: ${{ github.workspace }}/_package/actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}.tar.gz
|
asset_path: ${{ github.workspace }}/actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}.tar.gz
|
||||||
asset_name: actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}.tar.gz
|
asset_name: actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}.tar.gz
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
@@ -319,210 +212,6 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
||||||
asset_path: ${{ github.workspace }}/_package/actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
asset_path: ${{ github.workspace }}/actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
||||||
asset_name: actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
asset_name: actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}.tar.gz
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
# Upload release assets (trim externals)
|
|
||||||
- name: Upload Release Asset (win-x64-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_externals/actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noexternals.zip
|
|
||||||
asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noexternals.zip
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-x64-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_externals/actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}-noexternals.tar.gz
|
|
||||||
asset_name: actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}-noexternals.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (osx-x64-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_externals/actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}-noexternals.tar.gz
|
|
||||||
asset_name: actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}-noexternals.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-arm-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_externals/actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}-noexternals.tar.gz
|
|
||||||
asset_name: actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}-noexternals.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-arm64-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_externals/actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}-noexternals.tar.gz
|
|
||||||
asset_name: actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}-noexternals.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
# Upload release assets (trim runtime)
|
|
||||||
- name: Upload Release Asset (win-x64-noruntime)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime/actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noruntime.zip
|
|
||||||
asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noruntime.zip
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-x64-noruntime)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime/actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}-noruntime.tar.gz
|
|
||||||
asset_name: actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}-noruntime.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (osx-x64-noruntime)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime/actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}-noruntime.tar.gz
|
|
||||||
asset_name: actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}-noruntime.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-arm-noruntime)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime/actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}-noruntime.tar.gz
|
|
||||||
asset_name: actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}-noruntime.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-arm64-noruntime)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime/actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}-noruntime.tar.gz
|
|
||||||
asset_name: actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}-noruntime.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
# Upload release assets (trim runtime and externals)
|
|
||||||
- name: Upload Release Asset (win-x64-noruntime-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime_externals/actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.zip
|
|
||||||
asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.zip
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-x64-noruntime-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime_externals/actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.tar.gz
|
|
||||||
asset_name: actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (osx-x64-noruntime-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime_externals/actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.tar.gz
|
|
||||||
asset_name: actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-arm-noruntime-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime_externals/actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.tar.gz
|
|
||||||
asset_name: actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-arm64-noruntime-noexternals)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/_package_trims/trim_runtime_externals/actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.tar.gz
|
|
||||||
asset_name: actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.tar.gz
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
# Upload release assets (trimmedpackages.json)
|
|
||||||
- name: Upload Release Asset (win-x64-trimmedpackages.json)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/win-x64-trimmedpackages.json
|
|
||||||
asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-trimmedpackages.json
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-x64-trimmedpackages.json)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/linux-x64-trimmedpackages.json
|
|
||||||
asset_name: actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}-trimmedpackages.json
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (osx-x64-trimmedpackages.json)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/osx-x64-trimmedpackages.json
|
|
||||||
asset_name: actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}-trimmedpackages.json
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-arm-trimmedpackages.json)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/linux-arm-trimmedpackages.json
|
|
||||||
asset_name: actions-runner-linux-arm-${{ steps.releaseNote.outputs.version }}-trimmedpackages.json
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (linux-arm64-trimmedpackages.json)
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.createRelease.outputs.upload_url }}
|
|
||||||
asset_path: ${{ github.workspace }}/linux-arm64-trimmedpackages.json
|
|
||||||
asset_name: actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}-trimmedpackages.json
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -19,9 +19,7 @@
|
|||||||
node_modules
|
node_modules
|
||||||
_downloads
|
_downloads
|
||||||
_layout
|
_layout
|
||||||
_layout_trims
|
|
||||||
_package
|
_package
|
||||||
_package_trims
|
|
||||||
_dotnetsdk
|
_dotnetsdk
|
||||||
TestResults
|
TestResults
|
||||||
TestLogs
|
TestLogs
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
# GitHub Actions Runner
|
# GitHub Actions Runner
|
||||||
|
|
||||||
[](https://github.com/actions/runner/actions)
|
[](https://github.com/actions/runner/actions)
|
||||||
|
[](https://github.com/actions/runner/actions)
|
||||||
|
|
||||||
The runner is the application that runs a job from a GitHub Actions workflow. It is used by GitHub Actions in the [hosted virtual environments](https://github.com/actions/virtual-environments), or you can [self-host the runner](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners) in your own environment.
|
The runner is the application that runs a job from a GitHub Actions workflow. It is used by GitHub Actions in the [hosted virtual environments](https://github.com/actions/virtual-environments), or you can [self-host the runner](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners) in your own environment.
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Compilation failures during a CI build should surface good error messages.
|
|||||||
|
|
||||||
For example, the actual compile errors from the typescript compiler should bubble as issues in the UI. And not simply "tsc exited with exit code 1".
|
For example, the actual compile errors from the typescript compiler should bubble as issues in the UI. And not simply "tsc exited with exit code 1".
|
||||||
|
|
||||||
VSCode has an extensible model for solving this type of problem. VSCode allows users to configure which [problems matchers](https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher) to use, when scanning output. For example, a user can apply the `tsc` problem matcher to receive a rich error output experience in VSCode, when compiling their typescript project.
|
VSCode has an extensible model for solving this type of problem. VSCode allows users to configure which problems matchers to use, when scanning output. For example, a user can apply the `tsc` problem matcher to receive a rich error output experience in VSCode, when compiling their typescript project.
|
||||||
|
|
||||||
The problem-matcher concept fits well with "setup" actions. For example, the `setup-nodejs` action will download node.js, add it to the PATH, and register the `tsc` problem matcher. For the duration of the job, the `tsc` problem matcher will be applied against the output.
|
The problem-matcher concept fits well with "setup" actions. For example, the `setup-nodejs` action will download node.js, add it to the PATH, and register the `tsc` problem matcher. For the duration of the job, the `tsc` problem matcher will be applied against the output.
|
||||||
|
|
||||||
@@ -18,23 +18,21 @@ The problem-matcher concept fits well with "setup" actions. For example, the `se
|
|||||||
|
|
||||||
### Registration
|
### Registration
|
||||||
|
|
||||||
#### Using `::` command
|
#### Using `##` command
|
||||||
|
|
||||||
`::add-matcher::path-to-problem-matcher-config.json`
|
`##[add-matcher]path-to-problem-matcher-config.json`
|
||||||
|
|
||||||
Using a `::` command allows for flexibility:
|
Using a `##` command allows for flexibility:
|
||||||
- Ad hoc scripts can register problem matchers
|
- Ad hoc scripts can register problem matchers
|
||||||
- Allows problem matchers to be conditionally registered
|
- Allows problem matchers to be conditionally registered
|
||||||
|
|
||||||
Note, if a matcher with the same name is registered a second time, it will clobber the first instance.
|
Note, if a matcher with the same name is registered a second time, it will clobber the first instance.
|
||||||
|
|
||||||
Note, at some point the syntax changed from `##` to `::`.
|
#### Unregister using `##` command
|
||||||
|
|
||||||
#### Unregister using `::` command
|
|
||||||
|
|
||||||
A way out for rare cases where scoping is a problem.
|
A way out for rare cases where scoping is a problem.
|
||||||
|
|
||||||
`::remove-matcher::owner`
|
`##[remove-matcher]owner`
|
||||||
|
|
||||||
For this to be usable, the `owner` needs to be discoverable. Therefore, debug print the owner on registration.
|
For this to be usable, the `owner` needs to be discoverable. Therefore, debug print the owner on registration.
|
||||||
|
|
||||||
@@ -106,7 +104,7 @@ message: ; expected
|
|||||||
fromPath: C:\myrepo\myproject\ConsoleApp1\ClassLibrary1\ClassLibrary1.csproj
|
fromPath: C:\myrepo\myproject\ConsoleApp1\ClassLibrary1\ClassLibrary1.csproj
|
||||||
```
|
```
|
||||||
|
|
||||||
Additionally the line will appear red in the web UI (prefix with `::error`).
|
Additionally the line will appear red in the web UI (prefix with `##[error]`).
|
||||||
|
|
||||||
Note, an error does not imply task failure. Exit codes communicate failure.
|
Note, an error does not imply task failure. Exit codes communicate failure.
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ The runner will look for a file `.setup_info` under the runner's root directory,
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
The runner will use `::group` and `::endgroup` to fold all detail info into an expandable group.
|
The runner will use `##[group]` and `##[endgroup]` to fold all detail info into an expandable group.
|
||||||
|
|
||||||
Both [virtual-environments](https://github.com/actions/virtual-environments) and self-hosted runners can use this mechanism to add extra logging info to the `Set up job` step's log.
|
Both [virtual-environments](https://github.com/actions/virtual-environments) and self-hosted runners can use this mechanism to add extra logging info to the `Set up job` step's log.
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,6 @@ An ADR is an Architectural Decision Record. This allows consensus on the direct
|
|||||||
|
|
||||||
  Git for Windows and Linux [Install Here](https://git-scm.com/downloads) (needed for dev sh script)
|
  Git for Windows and Linux [Install Here](https://git-scm.com/downloads) (needed for dev sh script)
|
||||||
|
|
||||||
 cURL [Install here](https://curl.se/download.html) (needed for external sh script)
|
|
||||||
|
|
||||||
 Visual Studio 2017 or newer [Install here](https://visualstudio.microsoft.com) (needed for dev sh script)
|
|
||||||
|
|
||||||
## Quickstart: Run a job from a real repository
|
## Quickstart: Run a job from a real repository
|
||||||
|
|
||||||
If you just want to get from building the sourcecode to using it to execute an action, you will need:
|
If you just want to get from building the sourcecode to using it to execute an action, you will need:
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 158 KiB |
@@ -23,8 +23,8 @@ You might see something like this which indicate a dependency's missing.
|
|||||||
./config.sh
|
./config.sh
|
||||||
libunwind.so.8 => not found
|
libunwind.so.8 => not found
|
||||||
libunwind-x86_64.so.8 => not found
|
libunwind-x86_64.so.8 => not found
|
||||||
Dependencies is missing for Dotnet Core 6.0
|
Dependencies is missing for Dotnet Core 3.0
|
||||||
Execute ./bin/installdependencies.sh to install any missing Dotnet Core 6.0 dependencies.
|
Execute ./bin/installdependencies.sh to install any missing Dotnet Core 3.0 dependencies.
|
||||||
```
|
```
|
||||||
You can easily correct the problem by executing `./bin/installdependencies.sh`.
|
You can easily correct the problem by executing `./bin/installdependencies.sh`.
|
||||||
The `installdependencies.sh` script should install all required dependencies on all supported Linux versions
|
The `installdependencies.sh` script should install all required dependencies on all supported Linux versions
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Add Runner Configuration option to disable auto update `--disableupdate` (#1558)
|
- Expose GITHUB_REF_* as environment variable (#1314)
|
||||||
- Introduce `GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY` env variable to skip SSL Cert Verification on the Runner (#1616)
|
- Add arch to runner context (#1372)
|
||||||
- Adds support for downloading trimmed versions of the runner when the entire package does not need to be upgraded (#1568)
|
- Support Conditional Steps in Composite Actions (#1438)
|
||||||
|
- Log current runner version in terminal (#1441)
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
- Set Outcome/Conclusion for composite action steps (#1600)
|
|
||||||
|
- Makes the user keychains available to the service (#847)
|
||||||
|
- Use Actions Service health and api.github.com endpoints after connection failure on Actions Server and Hosted (#1385)
|
||||||
|
- Fix an issue where nested local composite actions did not correctly register post steps (#1433)
|
||||||
|
|
||||||
## Misc
|
## Misc
|
||||||
|
|
||||||
- Update `run.sh` to more gracefully handle updates (#1494)
|
- Cleanup Older versions on MacOS now that we recreate node versions as needed (#1410)
|
||||||
- Use 8Mb default chunking for File Container Uploads (#1626)
|
|
||||||
- Performance improvements in handling large amounts of live logs (#1592)
|
|
||||||
- Allow `./svc.sh stop` to exit as soon as runner process exits (#1580)
|
|
||||||
- Add additional tracing to help troubleshoot job message corruption (#1587)
|
|
||||||
|
|
||||||
|
|
||||||
## Windows x64
|
## Windows x64
|
||||||
We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows.
|
We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows.
|
||||||
@@ -86,21 +85,3 @@ The SHA-256 checksums for the packages included in this build are shown below:
|
|||||||
- actions-runner-linux-x64-<RUNNER_VERSION>.tar.gz <!-- BEGIN SHA linux-x64 --><LINUX_X64_SHA><!-- END SHA linux-x64 -->
|
- actions-runner-linux-x64-<RUNNER_VERSION>.tar.gz <!-- BEGIN SHA linux-x64 --><LINUX_X64_SHA><!-- END SHA linux-x64 -->
|
||||||
- actions-runner-linux-arm64-<RUNNER_VERSION>.tar.gz <!-- BEGIN SHA linux-arm64 --><LINUX_ARM64_SHA><!-- END SHA linux-arm64 -->
|
- actions-runner-linux-arm64-<RUNNER_VERSION>.tar.gz <!-- BEGIN SHA linux-arm64 --><LINUX_ARM64_SHA><!-- END SHA linux-arm64 -->
|
||||||
- actions-runner-linux-arm-<RUNNER_VERSION>.tar.gz <!-- BEGIN SHA linux-arm --><LINUX_ARM_SHA><!-- END SHA linux-arm -->
|
- actions-runner-linux-arm-<RUNNER_VERSION>.tar.gz <!-- BEGIN SHA linux-arm --><LINUX_ARM_SHA><!-- END SHA linux-arm -->
|
||||||
|
|
||||||
- actions-runner-win-x64-<RUNNER_VERSION>-noexternals.zip <!-- BEGIN SHA win-x64_noexternals --><WIN_X64_SHA_NOEXTERNALS><!-- END SHA win-x64_noexternals -->
|
|
||||||
- actions-runner-osx-x64-<RUNNER_VERSION>-noexternals.tar.gz <!-- BEGIN SHA osx-x64_noexternals --><OSX_X64_SHA_NOEXTERNALS><!-- END SHA osx-x64_noexternals -->
|
|
||||||
- actions-runner-linux-x64-<RUNNER_VERSION>-noexternals.tar.gz <!-- BEGIN SHA linux-x64_noexternals --><LINUX_X64_SHA_NOEXTERNALS><!-- END SHA linux-x64_noexternals -->
|
|
||||||
- actions-runner-linux-arm64-<RUNNER_VERSION>-noexternals.tar.gz <!-- BEGIN SHA linux-arm64_noexternals --><LINUX_ARM64_SHA_NOEXTERNALS><!-- END SHA linux-arm64_noexternals -->
|
|
||||||
- actions-runner-linux-arm-<RUNNER_VERSION>-noexternals.tar.gz <!-- BEGIN SHA linux-arm_noexternals --><LINUX_ARM_SHA_NOEXTERNALS><!-- END SHA linux-arm_noexternals -->
|
|
||||||
|
|
||||||
- actions-runner-win-x64-<RUNNER_VERSION>-noruntime.zip <!-- BEGIN SHA win-x64_noruntime --><WIN_X64_SHA_NORUNTIME><!-- END SHA win-x64_noruntime -->
|
|
||||||
- actions-runner-osx-x64-<RUNNER_VERSION>-noruntime.tar.gz <!-- BEGIN SHA osx-x64_noruntime --><OSX_X64_SHA_NORUNTIME><!-- END SHA osx-x64_noruntime -->
|
|
||||||
- actions-runner-linux-x64-<RUNNER_VERSION>-noruntime.tar.gz <!-- BEGIN SHA linux-x64_noruntime --><LINUX_X64_SHA_NORUNTIME><!-- END SHA linux-x64_noruntime -->
|
|
||||||
- actions-runner-linux-arm64-<RUNNER_VERSION>-noruntime.tar.gz <!-- BEGIN SHA linux-arm64_noruntime --><LINUX_ARM64_SHA_NORUNTIME><!-- END SHA linux-arm64_noruntime -->
|
|
||||||
- actions-runner-linux-arm-<RUNNER_VERSION>-noruntime.tar.gz <!-- BEGIN SHA linux-arm_noruntime --><LINUX_ARM_SHA_NORUNTIME><!-- END SHA linux-arm_noruntime -->
|
|
||||||
|
|
||||||
- actions-runner-win-x64-<RUNNER_VERSION>-noruntime-noexternals.zip <!-- BEGIN SHA win-x64_noruntime_noexternals --><WIN_X64_SHA_NORUNTIME_NOEXTERNALS><!-- END SHA win-x64_noruntime_noexternals -->
|
|
||||||
- actions-runner-osx-x64-<RUNNER_VERSION>-noruntime-noexternals.tar.gz <!-- BEGIN SHA osx-x64_noruntime_noexternals --><OSX_X64_SHA_NORUNTIME_NOEXTERNALS><!-- END SHA osx-x64_noruntime_noexternals -->
|
|
||||||
- actions-runner-linux-x64-<RUNNER_VERSION>-noruntime-noexternals.tar.gz <!-- BEGIN SHA linux-x64_noruntime_noexternals --><LINUX_X64_SHA_NORUNTIME_NOEXTERNALS><!-- END SHA linux-x64_noruntime_noexternals -->
|
|
||||||
- actions-runner-linux-arm64-<RUNNER_VERSION>-noruntime-noexternals.tar.gz <!-- BEGIN SHA linux-arm64_noruntime_noexternals --><LINUX_ARM64_SHA_NORUNTIME_NOEXTERNALS><!-- END SHA linux-arm64_noruntime_noexternals -->
|
|
||||||
- actions-runner-linux-arm-<RUNNER_VERSION>-noruntime-noexternals.tar.gz <!-- BEGIN SHA linux-arm_noruntime_noexternals --><LINUX_ARM_SHA_NORUNTIME_NOEXTERNALS><!-- END SHA linux-arm_noruntime_noexternals -->
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.287.1
|
<Update to ./src/runnerversion when creating release>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<DefineConstants>$(DefineConstants);X64</DefineConstants>
|
<DefineConstants>$(DefineConstants);X64</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(BUILD_OS)' == 'Linux' AND ('$(PackageRuntime)' == 'linux-x64' OR '$(PackageRuntime)' == '')">
|
<PropertyGroup Condition="'$(BUILD_OS)' == 'Linux' AND ('$(PackageRuntime)' == 'linux-x64' OR '$(PackageRuntime)' == 'linux-musl-x64' OR '$(PackageRuntime)' == '')">
|
||||||
<DefineConstants>$(DefineConstants);X64</DefineConstants>
|
<DefineConstants>$(DefineConstants);X64</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(BUILD_OS)' == 'Linux' AND '$(PackageRuntime)' == 'linux-arm'">
|
<PropertyGroup Condition="'$(BUILD_OS)' == 'Linux' AND '$(PackageRuntime)' == 'linux-arm'">
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
de62d296708908cfd1236e58869aebbc2bae8a8c3d629276968542626c508e37
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
44fcd0422dd98ed17d2c8e9057ff2260c50165f20674236a4ae7d2645a07df25
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
e57652cf322ee16ce3af4f9e58f80858746b9e1e60279e991a3b3d9a6baf8d79
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
bdd247b2ff3f51095524412e2ac588e7a87af805e114d6caf2368366ee7be1ea
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
d23a0cb9f20c0aa1cddb7a39567cd097020cdeb06a1e952940601d1a405c53b8
|
|
||||||
1
src/Misc/contentHash/externals/linux-arm
vendored
1
src/Misc/contentHash/externals/linux-arm
vendored
@@ -1 +0,0 @@
|
|||||||
6ca4a0e1c50b7079ead05321dcf5835c1c25f23dc632add8c1c4667d416d103e
|
|
||||||
1
src/Misc/contentHash/externals/linux-arm64
vendored
1
src/Misc/contentHash/externals/linux-arm64
vendored
@@ -1 +0,0 @@
|
|||||||
b5951dc607d782d9c7571a7224e940eb0975bb23c54ff25c7afdbf959a417081
|
|
||||||
1
src/Misc/contentHash/externals/linux-x64
vendored
1
src/Misc/contentHash/externals/linux-x64
vendored
@@ -1 +0,0 @@
|
|||||||
af819e92011cc9cbca90e8299f9f7651f2cf6bf45b42920f9a4ca22795486147
|
|
||||||
1
src/Misc/contentHash/externals/osx-x64
vendored
1
src/Misc/contentHash/externals/osx-x64
vendored
@@ -1 +0,0 @@
|
|||||||
aa0e6bf4bfaabf48c962ea3b262dca042629ab332005f73d282faec908847036
|
|
||||||
1
src/Misc/contentHash/externals/win-x64
vendored
1
src/Misc/contentHash/externals/win-x64
vendored
@@ -1 +0,0 @@
|
|||||||
40328cff2b8229f9b578f32739183bd8f6aab481c21dadc052b09f1c7e8e4665
|
|
||||||
723
src/Misc/dotnet-install.ps1
vendored
723
src/Misc/dotnet-install.ps1
vendored
@@ -16,15 +16,27 @@
|
|||||||
- LTS - most current supported release
|
- LTS - most current supported release
|
||||||
- 2-part version in a format A.B - represents a specific release
|
- 2-part version in a format A.B - represents a specific release
|
||||||
examples: 2.0, 1.0
|
examples: 2.0, 1.0
|
||||||
- Branch name
|
- 3-part version in a format A.B.Cxx - represents a specific SDK release
|
||||||
examples: release/2.0.0, Master
|
examples: 5.0.1xx, 5.0.2xx
|
||||||
Note: The version parameter overrides the channel parameter.
|
Supported since 5.0 release
|
||||||
|
Note: The version parameter overrides the channel parameter when any version other than 'latest' is used.
|
||||||
|
.PARAMETER Quality
|
||||||
|
Download the latest build of specified quality in the channel. The possible values are: daily, signed, validated, preview, GA.
|
||||||
|
Works only in combination with channel. Not applicable for current and LTS channels and will be ignored if those channels are used.
|
||||||
|
For SDK use channel in A.B.Cxx format: using quality together with channel in A.B format is not supported.
|
||||||
|
Supported since 5.0 release.
|
||||||
|
Note: The version parameter overrides the channel parameter when any version other than 'latest' is used, and therefore overrides the quality.
|
||||||
.PARAMETER Version
|
.PARAMETER Version
|
||||||
Default: latest
|
Default: latest
|
||||||
Represents a build version on specific channel. Possible values:
|
Represents a build version on specific channel. Possible values:
|
||||||
- latest - most latest build on specific channel
|
- latest - most latest build on specific channel
|
||||||
- 3-part version in a format A.B.C - represents specific version of build
|
- 3-part version in a format A.B.C - represents specific version of build
|
||||||
examples: 2.0.0-preview2-006120, 1.1.0
|
examples: 2.0.0-preview2-006120, 1.1.0
|
||||||
|
.PARAMETER Internal
|
||||||
|
Download internal builds. Requires providing credentials via -FeedCredential parameter.
|
||||||
|
.PARAMETER FeedCredential
|
||||||
|
Token to access Azure feed. Used as a query string to append to the Azure feed.
|
||||||
|
This parameter typically is not specified.
|
||||||
.PARAMETER InstallDir
|
.PARAMETER InstallDir
|
||||||
Default: %LocalAppData%\Microsoft\dotnet
|
Default: %LocalAppData%\Microsoft\dotnet
|
||||||
Path to where to install dotnet. Note that binaries will be placed directly in a given directory.
|
Path to where to install dotnet. Note that binaries will be placed directly in a given directory.
|
||||||
@@ -59,9 +71,6 @@
|
|||||||
.PARAMETER UncachedFeed
|
.PARAMETER UncachedFeed
|
||||||
This parameter typically is not changed by the user.
|
This parameter typically is not changed by the user.
|
||||||
It allows changing the URL for the Uncached feed used by this installer.
|
It allows changing the URL for the Uncached feed used by this installer.
|
||||||
.PARAMETER FeedCredential
|
|
||||||
Used as a query string to append to the Azure feed.
|
|
||||||
It allows changing the URL to use non-public blob storage accounts.
|
|
||||||
.PARAMETER ProxyAddress
|
.PARAMETER ProxyAddress
|
||||||
If set, the installer will use the proxy when making web requests
|
If set, the installer will use the proxy when making web requests
|
||||||
.PARAMETER ProxyUseDefaultCredentials
|
.PARAMETER ProxyUseDefaultCredentials
|
||||||
@@ -77,15 +86,19 @@
|
|||||||
.PARAMETER JSonFile
|
.PARAMETER JSonFile
|
||||||
Determines the SDK version from a user specified global.json file
|
Determines the SDK version from a user specified global.json file
|
||||||
Note: global.json must have a value for 'SDK:Version'
|
Note: global.json must have a value for 'SDK:Version'
|
||||||
|
.PARAMETER DownloadTimeout
|
||||||
|
Determines timeout duration in seconds for dowloading of the SDK file
|
||||||
|
Default: 1200 seconds (20 minutes)
|
||||||
#>
|
#>
|
||||||
[cmdletbinding()]
|
[cmdletbinding()]
|
||||||
param(
|
param(
|
||||||
[string]$Channel="LTS",
|
[string]$Channel="LTS",
|
||||||
|
[string]$Quality,
|
||||||
[string]$Version="Latest",
|
[string]$Version="Latest",
|
||||||
|
[switch]$Internal,
|
||||||
[string]$JSonFile,
|
[string]$JSonFile,
|
||||||
[string]$InstallDir="<auto>",
|
[Alias('i')][string]$InstallDir="<auto>",
|
||||||
[string]$Architecture="<auto>",
|
[string]$Architecture="<auto>",
|
||||||
[ValidateSet("dotnet", "aspnetcore", "windowsdesktop", IgnoreCase = $false)]
|
|
||||||
[string]$Runtime,
|
[string]$Runtime,
|
||||||
[Obsolete("This parameter may be removed in a future version of this script. The recommended alternative is '-Runtime dotnet'.")]
|
[Obsolete("This parameter may be removed in a future version of this script. The recommended alternative is '-Runtime dotnet'.")]
|
||||||
[switch]$SharedRuntime,
|
[switch]$SharedRuntime,
|
||||||
@@ -98,7 +111,8 @@ param(
|
|||||||
[switch]$ProxyUseDefaultCredentials,
|
[switch]$ProxyUseDefaultCredentials,
|
||||||
[string[]]$ProxyBypassList=@(),
|
[string[]]$ProxyBypassList=@(),
|
||||||
[switch]$SkipNonVersionedFiles,
|
[switch]$SkipNonVersionedFiles,
|
||||||
[switch]$NoCdn
|
[switch]$NoCdn,
|
||||||
|
[int]$DownloadTimeout=1200
|
||||||
)
|
)
|
||||||
|
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
@@ -167,7 +181,7 @@ function Say-Invocation($Invocation) {
|
|||||||
Say-Verbose "$command $args"
|
Say-Verbose "$command $args"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Invoke-With-Retry([ScriptBlock]$ScriptBlock, [int]$MaxAttempts = 3, [int]$SecondsBetweenAttempts = 1) {
|
function Invoke-With-Retry([ScriptBlock]$ScriptBlock, [System.Threading.CancellationToken]$cancellationToken = [System.Threading.CancellationToken]::None, [int]$MaxAttempts = 3, [int]$SecondsBetweenAttempts = 1) {
|
||||||
$Attempts = 0
|
$Attempts = 0
|
||||||
|
|
||||||
while ($true) {
|
while ($true) {
|
||||||
@@ -176,7 +190,7 @@ function Invoke-With-Retry([ScriptBlock]$ScriptBlock, [int]$MaxAttempts = 3, [in
|
|||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
$Attempts++
|
$Attempts++
|
||||||
if ($Attempts -lt $MaxAttempts) {
|
if (($Attempts -lt $MaxAttempts) -and -not $cancellationToken.IsCancellationRequested) {
|
||||||
Start-Sleep $SecondsBetweenAttempts
|
Start-Sleep $SecondsBetweenAttempts
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -205,7 +219,7 @@ function Get-Machine-Architecture() {
|
|||||||
function Get-CLIArchitecture-From-Architecture([string]$Architecture) {
|
function Get-CLIArchitecture-From-Architecture([string]$Architecture) {
|
||||||
Say-Invocation $MyInvocation
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
switch ($Architecture.ToLower()) {
|
switch ($Architecture.ToLowerInvariant()) {
|
||||||
{ $_ -eq "<auto>" } { return Get-CLIArchitecture-From-Architecture $(Get-Machine-Architecture) }
|
{ $_ -eq "<auto>" } { return Get-CLIArchitecture-From-Architecture $(Get-Machine-Architecture) }
|
||||||
{ ($_ -eq "amd64") -or ($_ -eq "x64") } { return "x64" }
|
{ ($_ -eq "amd64") -or ($_ -eq "x64") } { return "x64" }
|
||||||
{ $_ -eq "x86" } { return "x86" }
|
{ $_ -eq "x86" } { return "x86" }
|
||||||
@@ -215,6 +229,53 @@ function Get-CLIArchitecture-From-Architecture([string]$Architecture) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Get-NormalizedQuality([string]$Quality) {
|
||||||
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($Quality)) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($Quality) {
|
||||||
|
{ @("daily", "signed", "validated", "preview") -contains $_ } { return $Quality.ToLowerInvariant() }
|
||||||
|
#ga quality is available without specifying quality, so normalizing it to empty
|
||||||
|
{ $_ -eq "ga" } { return "" }
|
||||||
|
default { throw "'$Quality' is not a supported value for -Quality option. Supported values are: daily, signed, validated, preview, ga. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues." }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-NormalizedChannel([string]$Channel) {
|
||||||
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($Channel)) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Channel.StartsWith('release/')) {
|
||||||
|
Say-Warning 'Using branch name with -Channel option is no longer supported with newer releases. Use -Quality option with a channel in X.Y format instead, such as "-Channel 5.0 -Quality Daily."'
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($Channel) {
|
||||||
|
{ $_ -eq "lts" } { return "LTS" }
|
||||||
|
{ $_ -eq "current" } { return "current" }
|
||||||
|
default { return $Channel.ToLowerInvariant() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-NormalizedProduct([string]$Runtime) {
|
||||||
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
|
switch ($Runtime) {
|
||||||
|
{ $_ -eq "dotnet" } { return "dotnet-runtime" }
|
||||||
|
{ $_ -eq "aspnetcore" } { return "aspnetcore-runtime" }
|
||||||
|
{ $_ -eq "windowsdesktop" } { return "windowsdesktop-runtime" }
|
||||||
|
{ [string]::IsNullOrEmpty($_) } { return "dotnet-sdk" }
|
||||||
|
default { throw "'$Runtime' is not a supported value for -Runtime option, supported values are: dotnet, aspnetcore, windowsdesktop. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues." }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# The version text returned from the feeds is a 1-line or 2-line string:
|
# The version text returned from the feeds is a 1-line or 2-line string:
|
||||||
# For the SDK and the dotnet runtime (2 lines):
|
# For the SDK and the dotnet runtime (2 lines):
|
||||||
# Line 1: # commit_hash
|
# Line 1: # commit_hash
|
||||||
@@ -243,10 +304,11 @@ function Load-Assembly([string] $Assembly) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetHTTPResponse([Uri] $Uri)
|
function GetHTTPResponse([Uri] $Uri, [bool]$HeaderOnly, [bool]$DisableRedirect, [bool]$DisableFeedCredential)
|
||||||
{
|
{
|
||||||
Invoke-With-Retry(
|
$cts = New-Object System.Threading.CancellationTokenSource
|
||||||
{
|
|
||||||
|
$downloadScript = {
|
||||||
|
|
||||||
$HttpClient = $null
|
$HttpClient = $null
|
||||||
|
|
||||||
@@ -270,32 +332,53 @@ function GetHTTPResponse([Uri] $Uri)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$HttpClientHandler = New-Object System.Net.Http.HttpClientHandler
|
||||||
if($ProxyAddress) {
|
if($ProxyAddress) {
|
||||||
$HttpClientHandler = New-Object System.Net.Http.HttpClientHandler
|
|
||||||
$HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{
|
$HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{
|
||||||
Address=$ProxyAddress;
|
Address=$ProxyAddress;
|
||||||
UseDefaultCredentials=$ProxyUseDefaultCredentials;
|
UseDefaultCredentials=$ProxyUseDefaultCredentials;
|
||||||
BypassList = $ProxyBypassList;
|
BypassList = $ProxyBypassList;
|
||||||
}
|
}
|
||||||
$HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler
|
}
|
||||||
|
if ($DisableRedirect)
|
||||||
|
{
|
||||||
|
$HttpClientHandler.AllowAutoRedirect = $false
|
||||||
|
}
|
||||||
|
$HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler
|
||||||
|
|
||||||
|
# Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out
|
||||||
|
# Defaulting to 20 minutes allows it to work over much slower connections.
|
||||||
|
$HttpClient.Timeout = New-TimeSpan -Seconds $DownloadTimeout
|
||||||
|
|
||||||
|
if ($HeaderOnly){
|
||||||
|
$completionOption = [System.Net.Http.HttpCompletionOption]::ResponseHeadersRead
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$completionOption = [System.Net.Http.HttpCompletionOption]::ResponseContentRead
|
||||||
$HttpClient = New-Object System.Net.Http.HttpClient
|
|
||||||
}
|
}
|
||||||
# Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out
|
|
||||||
# 20 minutes allows it to work over much slower connections.
|
if ($DisableFeedCredential) {
|
||||||
$HttpClient.Timeout = New-TimeSpan -Minutes 20
|
$UriWithCredential = $Uri
|
||||||
$Task = $HttpClient.GetAsync("${Uri}${FeedCredential}").ConfigureAwait("false");
|
}
|
||||||
|
else {
|
||||||
|
$UriWithCredential = "${Uri}${FeedCredential}"
|
||||||
|
}
|
||||||
|
|
||||||
|
$Task = $HttpClient.GetAsync("$UriWithCredential", $completionOption).ConfigureAwait("false");
|
||||||
$Response = $Task.GetAwaiter().GetResult();
|
$Response = $Task.GetAwaiter().GetResult();
|
||||||
|
|
||||||
if (($null -eq $Response) -or (-not ($Response.IsSuccessStatusCode))) {
|
if (($null -eq $Response) -or ((-not $HeaderOnly) -and (-not ($Response.IsSuccessStatusCode)))) {
|
||||||
# The feed credential is potentially sensitive info. Do not log FeedCredential to console output.
|
# The feed credential is potentially sensitive info. Do not log FeedCredential to console output.
|
||||||
$DownloadException = [System.Exception] "Unable to download $Uri."
|
$DownloadException = [System.Exception] "Unable to download $Uri."
|
||||||
|
|
||||||
if ($null -ne $Response) {
|
if ($null -ne $Response) {
|
||||||
$DownloadException.Data["StatusCode"] = [int] $Response.StatusCode
|
$DownloadException.Data["StatusCode"] = [int] $Response.StatusCode
|
||||||
$DownloadException.Data["ErrorMessage"] = "Unable to download $Uri. Returned HTTP status code: " + $DownloadException.Data["StatusCode"]
|
$DownloadException.Data["ErrorMessage"] = "Unable to download $Uri. Returned HTTP status code: " + $DownloadException.Data["StatusCode"]
|
||||||
|
|
||||||
|
if (404 -eq [int] $Response.StatusCode)
|
||||||
|
{
|
||||||
|
$cts.Cancel()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw $DownloadException
|
throw $DownloadException
|
||||||
@@ -323,11 +406,22 @@ function GetHTTPResponse([Uri] $Uri)
|
|||||||
throw $DownloadException
|
throw $DownloadException
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
if ($HttpClient -ne $null) {
|
if ($null -ne $HttpClient) {
|
||||||
$HttpClient.Dispose()
|
$HttpClient.Dispose()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return Invoke-With-Retry $downloadScript $cts.Token
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if ($null -ne $cts)
|
||||||
|
{
|
||||||
|
$cts.Dispose()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) {
|
function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) {
|
||||||
@@ -349,6 +443,9 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) {
|
|||||||
else {
|
else {
|
||||||
throw "Invalid value for `$Runtime"
|
throw "Invalid value for `$Runtime"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Say-Verbose "Constructed latest.version URL: $VersionFileUrl"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Response = GetHTTPResponse -Uri $VersionFileUrl
|
$Response = GetHTTPResponse -Uri $VersionFileUrl
|
||||||
}
|
}
|
||||||
@@ -411,7 +508,7 @@ function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel,
|
|||||||
Say-Invocation $MyInvocation
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
if (-not $JSonFile) {
|
if (-not $JSonFile) {
|
||||||
if ($Version.ToLower() -eq "latest") {
|
if ($Version.ToLowerInvariant() -eq "latest") {
|
||||||
$LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel
|
$LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel
|
||||||
return $LatestVersionInfo.Version
|
return $LatestVersionInfo.Version
|
||||||
}
|
}
|
||||||
@@ -478,57 +575,115 @@ function Get-LegacyDownload-Link([string]$AzureFeed, [string]$SpecificVersion, [
|
|||||||
return $PayloadURL
|
return $PayloadURL
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-Product-Version([string]$AzureFeed, [string]$SpecificVersion) {
|
function Get-Product-Version([string]$AzureFeed, [string]$SpecificVersion, [string]$PackageDownloadLink) {
|
||||||
Say-Invocation $MyInvocation
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
if ($Runtime -eq "dotnet") {
|
# Try to get the version number, using the productVersion.txt file located next to the installer file.
|
||||||
$ProductVersionTxtURL = "$AzureFeed/Runtime/$SpecificVersion/productVersion.txt"
|
$ProductVersionTxtURLs = (Get-Product-Version-Url $AzureFeed $SpecificVersion $PackageDownloadLink -Flattened $true),
|
||||||
}
|
(Get-Product-Version-Url $AzureFeed $SpecificVersion $PackageDownloadLink -Flattened $false)
|
||||||
elseif ($Runtime -eq "aspnetcore") {
|
|
||||||
$ProductVersionTxtURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/productVersion.txt"
|
Foreach ($ProductVersionTxtURL in $ProductVersionTxtURLs) {
|
||||||
}
|
Say-Verbose "Checking for the existence of $ProductVersionTxtURL"
|
||||||
elseif ($Runtime -eq "windowsdesktop") {
|
|
||||||
# The windows desktop runtime is part of the core runtime layout prior to 5.0
|
try {
|
||||||
$ProductVersionTxtURL = "$AzureFeed/Runtime/$SpecificVersion/productVersion.txt"
|
$productVersionResponse = GetHTTPResponse($productVersionTxtUrl)
|
||||||
if ($SpecificVersion -match '^(\d+)\.(.*)')
|
|
||||||
{
|
if ($productVersionResponse.StatusCode -eq 200) {
|
||||||
$majorVersion = [int]$Matches[1]
|
$productVersion = $productVersionResponse.Content.ReadAsStringAsync().Result.Trim()
|
||||||
if ($majorVersion -ge 5)
|
if ($productVersion -ne $SpecificVersion)
|
||||||
{
|
{
|
||||||
$ProductVersionTxtURL = "$AzureFeed/WindowsDesktop/$SpecificVersion/productVersion.txt"
|
Say "Using alternate version $productVersion found in $ProductVersionTxtURL"
|
||||||
|
}
|
||||||
|
return $productVersion
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Say-Verbose "Got StatusCode $($productVersionResponse.StatusCode) when trying to get productVersion.txt at $productVersionTxtUrl."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
catch {
|
||||||
elseif (-not $Runtime) {
|
Say-Verbose "Could not read productVersion.txt at $productVersionTxtUrl (Exception: '$($_.Exception.Message)'. )"
|
||||||
$ProductVersionTxtURL = "$AzureFeed/Sdk/$SpecificVersion/productVersion.txt"
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw "Invalid value '$Runtime' specified for `$Runtime"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Say-Verbose "Checking for existence of $ProductVersionTxtURL"
|
# Getting the version number with productVersion.txt has failed. Try parsing the download link for a version number.
|
||||||
|
if ([string]::IsNullOrEmpty($PackageDownloadLink))
|
||||||
|
{
|
||||||
|
Say-Verbose "Using the default value '$SpecificVersion' as the product version."
|
||||||
|
return $SpecificVersion
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
$productVersion = Get-ProductVersionFromDownloadLink $PackageDownloadLink $SpecificVersion
|
||||||
$productVersionResponse = GetHTTPResponse($productVersionTxtUrl)
|
return $productVersion
|
||||||
|
}
|
||||||
|
|
||||||
if ($productVersionResponse.StatusCode -eq 200) {
|
function Get-Product-Version-Url([string]$AzureFeed, [string]$SpecificVersion, [string]$PackageDownloadLink, [bool]$Flattened) {
|
||||||
$productVersion = $productVersionResponse.Content.ReadAsStringAsync().Result.Trim()
|
Say-Invocation $MyInvocation
|
||||||
if ($productVersion -ne $SpecificVersion)
|
|
||||||
{
|
|
||||||
Say "Using alternate version $productVersion found in $ProductVersionTxtURL"
|
|
||||||
}
|
|
||||||
|
|
||||||
return $productVersion
|
$majorVersion=$null
|
||||||
|
if ($SpecificVersion -match '^(\d+)\.(.*)') {
|
||||||
|
$majorVersion = $Matches[1] -as[int]
|
||||||
|
}
|
||||||
|
|
||||||
|
$pvFileName='productVersion.txt'
|
||||||
|
if($Flattened) {
|
||||||
|
if(-not $Runtime) {
|
||||||
|
$pvFileName='sdk-productVersion.txt'
|
||||||
|
}
|
||||||
|
elseif($Runtime -eq "dotnet") {
|
||||||
|
$pvFileName='runtime-productVersion.txt'
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Say-Verbose "Got StatusCode $($productVersionResponse.StatusCode) trying to get productVersion.txt at $productVersionTxtUrl, so using default value of $SpecificVersion"
|
$pvFileName="$Runtime-productVersion.txt"
|
||||||
$productVersion = $SpecificVersion
|
|
||||||
}
|
}
|
||||||
} catch {
|
|
||||||
Say-Verbose "Could not read productVersion.txt at $productVersionTxtUrl, so using default value of $SpecificVersion (Exception: '$($_.Exception.Message)' )"
|
|
||||||
$productVersion = $SpecificVersion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($PackageDownloadLink)) {
|
||||||
|
if ($Runtime -eq "dotnet") {
|
||||||
|
$ProductVersionTxtURL = "$AzureFeed/Runtime/$SpecificVersion/$pvFileName"
|
||||||
|
}
|
||||||
|
elseif ($Runtime -eq "aspnetcore") {
|
||||||
|
$ProductVersionTxtURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/$pvFileName"
|
||||||
|
}
|
||||||
|
elseif ($Runtime -eq "windowsdesktop") {
|
||||||
|
# The windows desktop runtime is part of the core runtime layout prior to 5.0
|
||||||
|
$ProductVersionTxtURL = "$AzureFeed/Runtime/$SpecificVersion/$pvFileName"
|
||||||
|
if ($majorVersion -ne $null -and $majorVersion -ge 5) {
|
||||||
|
$ProductVersionTxtURL = "$AzureFeed/WindowsDesktop/$SpecificVersion/$pvFileName"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (-not $Runtime) {
|
||||||
|
$ProductVersionTxtURL = "$AzureFeed/Sdk/$SpecificVersion/$pvFileName"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw "Invalid value '$Runtime' specified for `$Runtime"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$ProductVersionTxtURL = $PackageDownloadLink.Substring(0, $PackageDownloadLink.LastIndexOf("/")) + "/$pvFileName"
|
||||||
|
}
|
||||||
|
|
||||||
|
Say-Verbose "Constructed productVersion link: $ProductVersionTxtURL"
|
||||||
|
|
||||||
|
return $ProductVersionTxtURL
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-ProductVersionFromDownloadLink([string]$PackageDownloadLink, [string]$SpecificVersion)
|
||||||
|
{
|
||||||
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
|
#product specific version follows the product name
|
||||||
|
#for filename 'dotnet-sdk-3.1.404-win-x64.zip': the product version is 3.1.400
|
||||||
|
$filename = $PackageDownloadLink.Substring($PackageDownloadLink.LastIndexOf("/") + 1)
|
||||||
|
$filenameParts = $filename.Split('-')
|
||||||
|
if ($filenameParts.Length -gt 2)
|
||||||
|
{
|
||||||
|
$productVersion = $filenameParts[2]
|
||||||
|
Say-Verbose "Extracted product version '$productVersion' from download link '$PackageDownloadLink'."
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Say-Verbose "Using the default value '$SpecificVersion' as the product version."
|
||||||
|
$productVersion = $SpecificVersion
|
||||||
|
}
|
||||||
return $productVersion
|
return $productVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,15 +857,150 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-AkaMSDownloadLink([string]$Channel, [string]$Quality, [bool]$Internal, [string]$Product, [string]$Architecture) {
|
||||||
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
|
#quality is not supported for LTS or current channel
|
||||||
|
if (![string]::IsNullOrEmpty($Quality) -and (@("LTS", "current") -contains $Channel)) {
|
||||||
|
$Quality = ""
|
||||||
|
Say-Warning "Specifying quality for current or LTS channel is not supported, the quality will be ignored."
|
||||||
|
}
|
||||||
|
Say-Verbose "Retrieving primary payload URL from aka.ms link for channel: '$Channel', quality: '$Quality' product: '$Product', os: 'win', architecture: '$Architecture'."
|
||||||
|
|
||||||
|
#construct aka.ms link
|
||||||
|
$akaMsLink = "https://aka.ms/dotnet"
|
||||||
|
if ($Internal) {
|
||||||
|
$akaMsLink += "/internal"
|
||||||
|
}
|
||||||
|
$akaMsLink += "/$Channel"
|
||||||
|
if (-not [string]::IsNullOrEmpty($Quality)) {
|
||||||
|
$akaMsLink +="/$Quality"
|
||||||
|
}
|
||||||
|
$akaMsLink +="/$Product-win-$Architecture.zip"
|
||||||
|
Say-Verbose "Constructed aka.ms link: '$akaMsLink'."
|
||||||
|
$akaMsDownloadLink=$null
|
||||||
|
|
||||||
|
for ($maxRedirections = 9; $maxRedirections -ge 0; $maxRedirections--)
|
||||||
|
{
|
||||||
|
#get HTTP response
|
||||||
|
#do not pass credentials as a part of the $akaMsLink and do not apply credentials in the GetHTTPResponse function
|
||||||
|
#otherwise the redirect link would have credentials as well
|
||||||
|
#it would result in applying credentials twice to the resulting link and thus breaking it, and in echoing credentials to the output as a part of redirect link
|
||||||
|
$Response= GetHTTPResponse -Uri $akaMsLink -HeaderOnly $true -DisableRedirect $true -DisableFeedCredential $true
|
||||||
|
Say-Verbose "Received response:`n$Response"
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($Response)) {
|
||||||
|
Say-Verbose "The link '$akaMsLink' is not valid: failed to get redirect location. The resource is not available."
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
|
||||||
|
#if HTTP code is 301 (Moved Permanently), the redirect link exists
|
||||||
|
if ($Response.StatusCode -eq 301)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$akaMsDownloadLink = $Response.Headers.GetValues("Location")[0]
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($akaMsDownloadLink)) {
|
||||||
|
Say-Verbose "The link '$akaMsLink' is not valid: server returned 301 (Moved Permanently), but the headers do not contain the redirect location."
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
|
||||||
|
Say-Verbose "The redirect location retrieved: '$akaMsDownloadLink'."
|
||||||
|
# This may yet be a link to another redirection. Attempt to retrieve the page again.
|
||||||
|
$akaMsLink = $akaMsDownloadLink
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Say-Verbose "The link '$akaMsLink' is not valid: failed to get redirect location."
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ((($Response.StatusCode -lt 300) -or ($Response.StatusCode -ge 400)) -and (-not [string]::IsNullOrEmpty($akaMsDownloadLink)))
|
||||||
|
{
|
||||||
|
# Redirections have ended.
|
||||||
|
return $akaMsDownloadLink
|
||||||
|
}
|
||||||
|
|
||||||
|
Say-Verbose "The link '$akaMsLink' is not valid: failed to retrieve the redirection location."
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
|
||||||
|
Say-Verbose "Aka.ms links have redirected more than the maximum allowed redirections. This may be caused by a cyclic redirection of aka.ms links."
|
||||||
|
return $null
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Say "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:"
|
Say "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:"
|
||||||
Say "- The SDK needs to be installed without user interaction and without admin rights."
|
Say "- The SDK needs to be installed without user interaction and without admin rights."
|
||||||
Say "- The SDK installation doesn't need to persist across multiple CI runs."
|
Say "- The SDK installation doesn't need to persist across multiple CI runs."
|
||||||
Say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.`r`n"
|
Say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.`r`n"
|
||||||
|
|
||||||
|
if ($Internal -and [string]::IsNullOrWhitespace($FeedCredential)) {
|
||||||
|
$message = "Provide credentials via -FeedCredential parameter."
|
||||||
|
if ($DryRun) {
|
||||||
|
Say-Warning "$message"
|
||||||
|
} else {
|
||||||
|
throw "$message"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#FeedCredential should start with "?", for it to be added to the end of the link.
|
||||||
|
#adding "?" at the beginning of the FeedCredential if needed.
|
||||||
|
if ((![string]::IsNullOrWhitespace($FeedCredential)) -and ($FeedCredential[0] -ne '?')) {
|
||||||
|
$FeedCredential = "?" + $FeedCredential
|
||||||
|
}
|
||||||
|
|
||||||
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
|
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
|
||||||
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version -JSonFile $JSonFile
|
$NormalizedQuality = Get-NormalizedQuality $Quality
|
||||||
$DownloadLink, $EffectiveVersion = Get-Download-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
Say-Verbose "Normalized quality: '$NormalizedQuality'"
|
||||||
$LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
$NormalizedChannel = Get-NormalizedChannel $Channel
|
||||||
|
Say-Verbose "Normalized channel: '$NormalizedChannel'"
|
||||||
|
$NormalizedProduct = Get-NormalizedProduct $Runtime
|
||||||
|
Say-Verbose "Normalized product: '$NormalizedProduct'"
|
||||||
|
$DownloadLink = $null
|
||||||
|
|
||||||
|
#try to get download location from aka.ms link
|
||||||
|
#not applicable when exact version is specified via command or json file
|
||||||
|
if ([string]::IsNullOrEmpty($JSonFile) -and ($Version -eq "latest")) {
|
||||||
|
$AkaMsDownloadLink = Get-AkaMSDownloadLink -Channel $NormalizedChannel -Quality $NormalizedQuality -Internal $Internal -Product $NormalizedProduct -Architecture $CLIArchitecture
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($AkaMsDownloadLink)){
|
||||||
|
if (-not [string]::IsNullOrEmpty($NormalizedQuality)) {
|
||||||
|
# if quality is specified - exit with error - there is no fallback approach
|
||||||
|
Say-Error "Failed to locate the latest version in the channel '$NormalizedChannel' with '$NormalizedQuality' quality for '$NormalizedProduct', os: 'win', architecture: '$CLIArchitecture'."
|
||||||
|
Say-Error "Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support."
|
||||||
|
throw "aka.ms link resolution failure"
|
||||||
|
}
|
||||||
|
Say-Verbose "Falling back to latest.version file approach."
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Say-Verbose "Retrieved primary named payload URL from aka.ms link: '$AkaMsDownloadLink'."
|
||||||
|
$DownloadLink = $AkaMsDownloadLink
|
||||||
|
Say-Verbose "Downloading using legacy url will not be attempted."
|
||||||
|
$LegacyDownloadLink = $null
|
||||||
|
|
||||||
|
#get version from the path
|
||||||
|
$pathParts = $DownloadLink.Split('/')
|
||||||
|
if ($pathParts.Length -ge 2) {
|
||||||
|
$SpecificVersion = $pathParts[$pathParts.Length - 2]
|
||||||
|
Say-Verbose "Version: '$SpecificVersion'."
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Say-Error "Failed to extract the version from download link '$DownloadLink'."
|
||||||
|
}
|
||||||
|
|
||||||
|
#retrieve effective (product) version
|
||||||
|
$EffectiveVersion = Get-Product-Version -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -PackageDownloadLink $DownloadLink
|
||||||
|
Say-Verbose "Product version: '$EffectiveVersion'."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($DownloadLink)) {
|
||||||
|
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version -JSonFile $JSonFile
|
||||||
|
$DownloadLink, $EffectiveVersion = Get-Download-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||||
|
$LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$InstallRoot = Resolve-Installation-Path $InstallDir
|
$InstallRoot = Resolve-Installation-Path $InstallDir
|
||||||
Say-Verbose "InstallRoot: $InstallRoot"
|
Say-Verbose "InstallRoot: $InstallRoot"
|
||||||
@@ -718,9 +1008,9 @@ $ScriptName = $MyInvocation.MyCommand.Name
|
|||||||
|
|
||||||
if ($DryRun) {
|
if ($DryRun) {
|
||||||
Say "Payload URLs:"
|
Say "Payload URLs:"
|
||||||
Say "Primary named payload URL: $DownloadLink"
|
Say "Primary named payload URL: ${DownloadLink}"
|
||||||
if ($LegacyDownloadLink) {
|
if ($LegacyDownloadLink) {
|
||||||
Say "Legacy named payload URL: $LegacyDownloadLink"
|
Say "Legacy named payload URL: ${LegacyDownloadLink}"
|
||||||
}
|
}
|
||||||
$RepeatableCommand = ".\$ScriptName -Version `"$SpecificVersion`" -InstallDir `"$InstallRoot`" -Architecture `"$CLIArchitecture`""
|
$RepeatableCommand = ".\$ScriptName -Version `"$SpecificVersion`" -InstallDir `"$InstallRoot`" -Architecture `"$CLIArchitecture`""
|
||||||
if ($Runtime -eq "dotnet") {
|
if ($Runtime -eq "dotnet") {
|
||||||
@@ -729,11 +1019,20 @@ if ($DryRun) {
|
|||||||
elseif ($Runtime -eq "aspnetcore") {
|
elseif ($Runtime -eq "aspnetcore") {
|
||||||
$RepeatableCommand+=" -Runtime `"aspnetcore`""
|
$RepeatableCommand+=" -Runtime `"aspnetcore`""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (-not [string]::IsNullOrEmpty($NormalizedQuality))
|
||||||
|
{
|
||||||
|
$RepeatableCommand+=" -Quality `"$NormalizedQuality`""
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($key in $MyInvocation.BoundParameters.Keys) {
|
foreach ($key in $MyInvocation.BoundParameters.Keys) {
|
||||||
if (-not (@("Architecture","Channel","DryRun","InstallDir","Runtime","SharedRuntime","Version") -contains $key)) {
|
if (-not (@("Architecture","Channel","DryRun","InstallDir","Runtime","SharedRuntime","Version","Quality","FeedCredential") -contains $key)) {
|
||||||
$RepeatableCommand+=" -$key `"$($MyInvocation.BoundParameters[$key])`""
|
$RepeatableCommand+=" -$key `"$($MyInvocation.BoundParameters[$key])`""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($MyInvocation.BoundParameters.Keys -contains "FeedCredential") {
|
||||||
|
$RepeatableCommand+=" -FeedCredential `"<feedCredential>`""
|
||||||
|
}
|
||||||
Say "Repeatable invocation: $RepeatableCommand"
|
Say "Repeatable invocation: $RepeatableCommand"
|
||||||
if ($SpecificVersion -ne $EffectiveVersion)
|
if ($SpecificVersion -ne $EffectiveVersion)
|
||||||
{
|
{
|
||||||
@@ -779,9 +1078,16 @@ if ($isAssetInstalled) {
|
|||||||
|
|
||||||
New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null
|
New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null
|
||||||
|
|
||||||
$installDrive = $((Get-Item $InstallRoot).PSDrive.Name);
|
$installDrive = $((Get-Item $InstallRoot -Force).PSDrive.Name);
|
||||||
$diskInfo = Get-PSDrive -Name $installDrive
|
$diskInfo = $null
|
||||||
if ($diskInfo.Free / 1MB -le 100) {
|
try{
|
||||||
|
$diskInfo = Get-PSDrive -Name $installDrive
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
Say-Warning "Failed to check the disk space. Installation will continue, but it may fail if you do not have enough disk space."
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ($diskInfo -ne $null) -and ($diskInfo.Free / 1MB -le 100)) {
|
||||||
throw "There is not enough disk space on drive ${installDrive}:"
|
throw "There is not enough disk space on drive ${installDrive}:"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -901,43 +1207,44 @@ Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath
|
|||||||
Say "Note that the script does not resolve dependencies during installation."
|
Say "Note that the script does not resolve dependencies during installation."
|
||||||
Say "To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install/windows#dependencies"
|
Say "To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install/windows#dependencies"
|
||||||
Say "Installation finished"
|
Say "Installation finished"
|
||||||
|
|
||||||
# SIG # Begin signature block
|
# SIG # Begin signature block
|
||||||
# MIIjjwYJKoZIhvcNAQcCoIIjgDCCI3wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
# MIIjhgYJKoZIhvcNAQcCoIIjdzCCI3MCAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
||||||
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
|
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH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3dgLZxikKzYs3hDMaEtJq8IP71cX7QXe6lnMmXU/Hdfz2p897Zd+kU+vZvKI
|
# VSh89abUSooR8QdZciemmoFhcWkEwFg4spzvYNP4nIs193261WyTaRMZoceGun7G
|
||||||
# 3cwLfuVQgK2RZ2z+Kc3K3dRPz2rXycK5XCuRZmvGab/WbrZiC7wJQapgBodltMI5
|
# CT2Rl653uUj+F+g94c63AhzSq4khdL4HlFIP2ePv29smfUnHtGq6yYFDLnT0q/Y+
|
||||||
# GMdFrBg9IeF7/rP4EqVQXeKtevTlZXjpuNhhjuR+2DMt/dWufjXpiW91bo3aH6Ea
|
# Di3jwloF8EWkkHRtSuXlFUbTmwr/lDDgbpZiKhLS7CBTDj32I0L5i532+uHczw82
|
||||||
# jOALXmoxgltCp1K7hrS6gmsvj94cLRf50QQ4U8Qwggd6MIIFYqADAgECAgphDpDS
|
# oZDmYmYmIUSMbZOgS65h797rj5JJ6OkeEUJoAVwwggd6MIIFYqADAgECAgphDpDS
|
||||||
# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
|
# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
|
||||||
# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0
|
# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0
|
||||||
# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0
|
# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0
|
||||||
@@ -977,119 +1284,119 @@ Say "Installation finished"
|
|||||||
# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96
|
# xw4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QL
|
||||||
# v89hpLssI/Gf1BEgNMA4zCuIGQiC8okusVumEpAhhvCEbSiTTTtBdolTnU/CAKui
|
# unGuwFX5lStgNevwUH9DotoASXxgtwNNmtZNDB4NYVCxQLS7RtVSbxP+xFYXbokG
|
||||||
# oxaU3R9XkKh1F4oAM26+dJ1J2BLQXPs5afNvvedDsZWNQUPK1sFF3JRfzxiTrwBW
|
# G4DFVHBr3CGPga3OduE/YUBpxIRxtiDF/9WHo0tJEdS95tfdnsyaGo8eHNzyfTdS
|
||||||
# EJRyflev9gyDoqCHzippgb+6+eti1WTkcA9Q49GIT11S6LOAVqkSC9N7Nqf8ksh8
|
# kjrNsAlqpJRT0Va/ooBXCV7Uny7PlCkRIQRTSJDy/kSXpsL22CTEHw6mU0jEU99k
|
||||||
# ARdwT8jigpsm+mj7lrVU9upDkhVYhKeO8oiZq95Q53Zkteo=
|
# OL4uwu+aVnolWFlpbiJjQxBqfT3plBLIg88=
|
||||||
# SIG # End signature block
|
# SIG # End signature block
|
||||||
|
|||||||
428
src/Misc/dotnet-install.sh
vendored
428
src/Misc/dotnet-install.sh
vendored
@@ -24,7 +24,7 @@ exec 3>&1
|
|||||||
# See if stdout is a terminal
|
# See if stdout is a terminal
|
||||||
if [ -t 1 ] && command -v tput > /dev/null; then
|
if [ -t 1 ] && command -v tput > /dev/null; then
|
||||||
# see if it supports colors
|
# see if it supports colors
|
||||||
ncolors=$(tput colors)
|
ncolors=$(tput colors || echo 0)
|
||||||
if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then
|
if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then
|
||||||
bold="$(tput bold || echo)"
|
bold="$(tput bold || echo)"
|
||||||
normal="$(tput sgr0 || echo)"
|
normal="$(tput sgr0 || echo)"
|
||||||
@@ -224,7 +224,7 @@ get_legacy_os_name() {
|
|||||||
machine_has() {
|
machine_has() {
|
||||||
eval $invocation
|
eval $invocation
|
||||||
|
|
||||||
hash "$1" > /dev/null 2>&1
|
command -v "$1" > /dev/null 2>&1
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,6 +368,75 @@ get_normalized_os() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# args:
|
||||||
|
# quality - $1
|
||||||
|
get_normalized_quality() {
|
||||||
|
eval $invocation
|
||||||
|
|
||||||
|
local quality="$(to_lowercase "$1")"
|
||||||
|
if [ ! -z "$quality" ]; then
|
||||||
|
case "$quality" in
|
||||||
|
daily | signed | validated | preview)
|
||||||
|
echo "$quality"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
ga)
|
||||||
|
#ga quality is available without specifying quality, so normalizing it to empty
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
say_err "'$quality' is not a supported value for --quality option. Supported values are: daily, signed, validated, preview, ga. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues."
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# args:
|
||||||
|
# channel - $1
|
||||||
|
get_normalized_channel() {
|
||||||
|
eval $invocation
|
||||||
|
|
||||||
|
local channel="$(to_lowercase "$1")"
|
||||||
|
|
||||||
|
if [[ $channel == release/* ]]; then
|
||||||
|
say_warning 'Using branch name with -Channel option is no longer supported with newer releases. Use -Quality option with a channel in X.Y format instead.';
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$channel" ]; then
|
||||||
|
case "$channel" in
|
||||||
|
lts)
|
||||||
|
echo "LTS"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$channel"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# args:
|
||||||
|
# runtime - $1
|
||||||
|
get_normalized_product() {
|
||||||
|
eval $invocation
|
||||||
|
|
||||||
|
local runtime="$(to_lowercase "$1")"
|
||||||
|
if [[ "$runtime" == "dotnet" ]]; then
|
||||||
|
product="dotnet-runtime"
|
||||||
|
elif [[ "$runtime" == "aspnetcore" ]]; then
|
||||||
|
product="aspnetcore-runtime"
|
||||||
|
elif [ -z "$runtime" ]; then
|
||||||
|
product="dotnet-sdk"
|
||||||
|
fi
|
||||||
|
echo "$product"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
# The version text returned from the feeds is a 1-line or 2-line string:
|
# The version text returned from the feeds is a 1-line or 2-line string:
|
||||||
# For the SDK and the dotnet runtime (2 lines):
|
# For the SDK and the dotnet runtime (2 lines):
|
||||||
# Line 1: # commit_hash
|
# Line 1: # commit_hash
|
||||||
@@ -541,43 +610,131 @@ construct_download_link() {
|
|||||||
# args:
|
# args:
|
||||||
# azure_feed - $1
|
# azure_feed - $1
|
||||||
# specific_version - $2
|
# specific_version - $2
|
||||||
|
# download link - $3 (optional)
|
||||||
get_specific_product_version() {
|
get_specific_product_version() {
|
||||||
# If we find a 'productVersion.txt' at the root of any folder, we'll use its contents
|
# If we find a 'productVersion.txt' at the root of any folder, we'll use its contents
|
||||||
# to resolve the version of what's in the folder, superseding the specified version.
|
# to resolve the version of what's in the folder, superseding the specified version.
|
||||||
|
# if 'productVersion.txt' is missing but download link is already available, product version will be taken from download link
|
||||||
eval $invocation
|
eval $invocation
|
||||||
|
|
||||||
local azure_feed="$1"
|
local azure_feed="$1"
|
||||||
local specific_version="${2//[$'\t\r\n']}"
|
local specific_version="${2//[$'\t\r\n']}"
|
||||||
local specific_product_version=$specific_version
|
local package_download_link=""
|
||||||
|
if [ $# -gt 2 ]; then
|
||||||
|
local package_download_link="$3"
|
||||||
|
fi
|
||||||
|
local specific_product_version=null
|
||||||
|
|
||||||
|
# Try to get the version number, using the productVersion.txt file located next to the installer file.
|
||||||
|
local download_links=($(get_specific_product_version_url "$azure_feed" "$specific_version" true "$package_download_link")
|
||||||
|
$(get_specific_product_version_url "$azure_feed" "$specific_version" false "$package_download_link"))
|
||||||
|
|
||||||
|
for download_link in "${download_links[@]}"
|
||||||
|
do
|
||||||
|
say_verbose "Checking for the existence of $download_link"
|
||||||
|
|
||||||
|
if machine_has "curl"
|
||||||
|
then
|
||||||
|
specific_product_version=$(curl -s --fail "${download_link}${feed_credential}")
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
echo "${specific_product_version//[$'\t\r\n']}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
elif machine_has "wget"
|
||||||
|
then
|
||||||
|
specific_product_version=$(wget -qO- "${download_link}${feed_credential}")
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
echo "${specific_product_version//[$'\t\r\n']}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Getting the version number with productVersion.txt has failed. Try parsing the download link for a version number.
|
||||||
|
say_verbose "Failed to get the version using productVersion.txt file. Download link will be parsed instead."
|
||||||
|
specific_product_version="$(get_product_specific_version_from_download_link "$package_download_link" "$specific_version")"
|
||||||
|
echo "${specific_product_version//[$'\t\r\n']}"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# args:
|
||||||
|
# azure_feed - $1
|
||||||
|
# specific_version - $2
|
||||||
|
# is_flattened - $3
|
||||||
|
# download link - $4 (optional)
|
||||||
|
get_specific_product_version_url() {
|
||||||
|
eval $invocation
|
||||||
|
|
||||||
|
local azure_feed="$1"
|
||||||
|
local specific_version="$2"
|
||||||
|
local is_flattened="$3"
|
||||||
|
local package_download_link=""
|
||||||
|
if [ $# -gt 3 ]; then
|
||||||
|
local package_download_link="$4"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local pvFileName="productVersion.txt"
|
||||||
|
if [ "$is_flattened" = true ]; then
|
||||||
|
if [ -z "$runtime" ]; then
|
||||||
|
pvFileName="sdk-productVersion.txt"
|
||||||
|
elif [[ "$runtime" == "dotnet" ]]; then
|
||||||
|
pvFileName="runtime-productVersion.txt"
|
||||||
|
else
|
||||||
|
pvFileName="$runtime-productVersion.txt"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
local download_link=null
|
local download_link=null
|
||||||
if [[ "$runtime" == "dotnet" ]]; then
|
|
||||||
download_link="$azure_feed/Runtime/$specific_version/productVersion.txt${feed_credential}"
|
if [ -z "$package_download_link" ]; then
|
||||||
elif [[ "$runtime" == "aspnetcore" ]]; then
|
if [[ "$runtime" == "dotnet" ]]; then
|
||||||
download_link="$azure_feed/aspnetcore/Runtime/$specific_version/productVersion.txt${feed_credential}"
|
download_link="$azure_feed/Runtime/$specific_version/${pvFileName}"
|
||||||
elif [ -z "$runtime" ]; then
|
elif [[ "$runtime" == "aspnetcore" ]]; then
|
||||||
download_link="$azure_feed/Sdk/$specific_version/productVersion.txt${feed_credential}"
|
download_link="$azure_feed/aspnetcore/Runtime/$specific_version/${pvFileName}"
|
||||||
|
elif [ -z "$runtime" ]; then
|
||||||
|
download_link="$azure_feed/Sdk/$specific_version/${pvFileName}"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
return 1
|
download_link="${package_download_link%/*}/${pvFileName}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if machine_has "curl"
|
say_verbose "Constructed productVersion link: $download_link"
|
||||||
then
|
echo "$download_link"
|
||||||
specific_product_version=$(curl -s --fail "$download_link")
|
return 0
|
||||||
if [ $? -ne 0 ]
|
}
|
||||||
then
|
|
||||||
specific_product_version=$specific_version
|
|
||||||
fi
|
|
||||||
elif machine_has "wget"
|
|
||||||
then
|
|
||||||
specific_product_version=$(wget -qO- "$download_link")
|
|
||||||
if [ $? -ne 0 ]
|
|
||||||
then
|
|
||||||
specific_product_version=$specific_version
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
specific_product_version="${specific_product_version//[$'\t\r\n']}"
|
|
||||||
|
|
||||||
|
# args:
|
||||||
|
# download link - $1
|
||||||
|
# specific version - $2
|
||||||
|
get_product_specific_version_from_download_link()
|
||||||
|
{
|
||||||
|
eval $invocation
|
||||||
|
|
||||||
|
local download_link="$1"
|
||||||
|
local specific_version="$2"
|
||||||
|
local specific_product_version=""
|
||||||
|
|
||||||
|
if [ -z "$download_link" ]; then
|
||||||
|
echo "$specific_version"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
#get filename
|
||||||
|
filename="${download_link##*/}"
|
||||||
|
|
||||||
|
#product specific version follows the product name
|
||||||
|
#for filename 'dotnet-sdk-3.1.404-linux-x64.tar.gz': the product version is 3.1.404
|
||||||
|
IFS='-'
|
||||||
|
read -ra filename_elems <<< "$filename"
|
||||||
|
count=${#filename_elems[@]}
|
||||||
|
if [[ "$count" -gt 2 ]]; then
|
||||||
|
specific_product_version="${filename_elems[2]}"
|
||||||
|
else
|
||||||
|
specific_product_version=$specific_version
|
||||||
|
fi
|
||||||
|
unset IFS;
|
||||||
echo "$specific_product_version"
|
echo "$specific_product_version"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -711,19 +868,62 @@ extract_dotnet_package() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# args:
|
||||||
|
# remote_path - $1
|
||||||
|
# disable_feed_credential - $2
|
||||||
|
get_http_header()
|
||||||
|
{
|
||||||
|
eval $invocation
|
||||||
|
local remote_path="$1"
|
||||||
|
local disable_feed_credential="$2"
|
||||||
|
|
||||||
|
local failed=false
|
||||||
|
local response
|
||||||
|
if machine_has "curl"; then
|
||||||
|
get_http_header_curl $remote_path $disable_feed_credential || failed=true
|
||||||
|
elif machine_has "wget"; then
|
||||||
|
get_http_header_wget $remote_path $disable_feed_credential || failed=true
|
||||||
|
else
|
||||||
|
failed=true
|
||||||
|
fi
|
||||||
|
if [ "$failed" = true ]; then
|
||||||
|
say_verbose "Failed to get HTTP header: '$remote_path'."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# args:
|
||||||
|
# remote_path - $1
|
||||||
|
# disable_feed_credential - $2
|
||||||
get_http_header_curl() {
|
get_http_header_curl() {
|
||||||
eval $invocation
|
eval $invocation
|
||||||
local remote_path="$1"
|
local remote_path="$1"
|
||||||
remote_path_with_credential="${remote_path}${feed_credential}"
|
local disable_feed_credential="$2"
|
||||||
|
|
||||||
|
remote_path_with_credential="$remote_path"
|
||||||
|
if [ "$disable_feed_credential" = false ]; then
|
||||||
|
remote_path_with_credential+="$feed_credential"
|
||||||
|
fi
|
||||||
|
|
||||||
curl_options="-I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 "
|
curl_options="-I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 "
|
||||||
curl $curl_options "$remote_path_with_credential" || return 1
|
curl $curl_options "$remote_path_with_credential" || return 1
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# args:
|
||||||
|
# remote_path - $1
|
||||||
|
# disable_feed_credential - $2
|
||||||
get_http_header_wget() {
|
get_http_header_wget() {
|
||||||
eval $invocation
|
eval $invocation
|
||||||
local remote_path="$1"
|
local remote_path="$1"
|
||||||
remote_path_with_credential="${remote_path}${feed_credential}"
|
local disable_feed_credential="$2"
|
||||||
|
|
||||||
|
remote_path_with_credential="$remote_path"
|
||||||
|
if [ "$disable_feed_credential" = false ]; then
|
||||||
|
remote_path_with_credential+="$feed_credential"
|
||||||
|
fi
|
||||||
|
|
||||||
wget_options="-q -S --spider --tries 5 --waitretry 2 --connect-timeout 15 "
|
wget_options="-q -S --spider --tries 5 --waitretry 2 --connect-timeout 15 "
|
||||||
wget $wget_options "$remote_path_with_credential" 2>&1 || return 1
|
wget $wget_options "$remote_path_with_credential" 2>&1 || return 1
|
||||||
return 0
|
return 0
|
||||||
@@ -763,7 +963,7 @@ download() {
|
|||||||
|
|
||||||
say "Download attempt #$attempts has failed: $http_code $download_error_msg"
|
say "Download attempt #$attempts has failed: $http_code $download_error_msg"
|
||||||
say "Attempt #$((attempts+1)) will start in $((attempts*10)) seconds."
|
say "Attempt #$((attempts+1)) will start in $((attempts*10)) seconds."
|
||||||
sleep $((attempts*20))
|
sleep $((attempts*10))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
@@ -783,6 +983,7 @@ downloadcurl() {
|
|||||||
local remote_path="$1"
|
local remote_path="$1"
|
||||||
local out_path="${2:-}"
|
local out_path="${2:-}"
|
||||||
# Append feed_credential as late as possible before calling curl to avoid logging feed_credential
|
# Append feed_credential as late as possible before calling curl to avoid logging feed_credential
|
||||||
|
# Avoid passing URI with credentials to functions: note, most of them echoing parameters of invocation in verbose output.
|
||||||
local remote_path_with_credential="${remote_path}${feed_credential}"
|
local remote_path_with_credential="${remote_path}${feed_credential}"
|
||||||
local curl_options="--retry 20 --retry-delay 2 --connect-timeout 15 -sSL -f --create-dirs "
|
local curl_options="--retry 20 --retry-delay 2 --connect-timeout 15 -sSL -f --create-dirs "
|
||||||
local failed=false
|
local failed=false
|
||||||
@@ -792,7 +993,8 @@ downloadcurl() {
|
|||||||
curl $curl_options -o "$out_path" "$remote_path_with_credential" || failed=true
|
curl $curl_options -o "$out_path" "$remote_path_with_credential" || failed=true
|
||||||
fi
|
fi
|
||||||
if [ "$failed" = true ]; then
|
if [ "$failed" = true ]; then
|
||||||
local response=$(get_http_header_curl $remote_path_with_credential)
|
local disable_feed_credential=false
|
||||||
|
local response=$(get_http_header_curl $remote_path $disable_feed_credential)
|
||||||
http_code=$( echo "$response" | awk '/^HTTP/{print $2}' | tail -1 )
|
http_code=$( echo "$response" | awk '/^HTTP/{print $2}' | tail -1 )
|
||||||
download_error_msg="Unable to download $remote_path."
|
download_error_msg="Unable to download $remote_path."
|
||||||
if [[ $http_code != 2* ]]; then
|
if [[ $http_code != 2* ]]; then
|
||||||
@@ -822,7 +1024,8 @@ downloadwget() {
|
|||||||
wget $wget_options -O "$out_path" "$remote_path_with_credential" || failed=true
|
wget $wget_options -O "$out_path" "$remote_path_with_credential" || failed=true
|
||||||
fi
|
fi
|
||||||
if [ "$failed" = true ]; then
|
if [ "$failed" = true ]; then
|
||||||
local response=$(get_http_header_wget $remote_path_with_credential)
|
local disable_feed_credential=false
|
||||||
|
local response=$(get_http_header_wget $remote_path $disable_feed_credential)
|
||||||
http_code=$( echo "$response" | awk '/^ HTTP/{print $2}' | tail -1 )
|
http_code=$( echo "$response" | awk '/^ HTTP/{print $2}' | tail -1 )
|
||||||
download_error_msg="Unable to download $remote_path."
|
download_error_msg="Unable to download $remote_path."
|
||||||
if [[ $http_code != 2* ]]; then
|
if [[ $http_code != 2* ]]; then
|
||||||
@@ -834,15 +1037,115 @@ downloadwget() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_download_link_from_aka_ms() {
|
||||||
|
eval $invocation
|
||||||
|
|
||||||
|
#quality is not supported for LTS or current channel
|
||||||
|
if [[ ! -z "$normalized_quality" && ("$normalized_channel" == "LTS" || "$normalized_channel" == "current") ]]; then
|
||||||
|
normalized_quality=""
|
||||||
|
say_warning "Specifying quality for current or LTS channel is not supported, the quality will be ignored."
|
||||||
|
fi
|
||||||
|
|
||||||
|
say_verbose "Retrieving primary payload URL from aka.ms for channel: '$normalized_channel', quality: '$normalized_quality', product: '$normalized_product', os: '$normalized_os', architecture: '$normalized_architecture'."
|
||||||
|
|
||||||
|
#construct aka.ms link
|
||||||
|
aka_ms_link="https://aka.ms/dotnet"
|
||||||
|
if [ "$internal" = true ]; then
|
||||||
|
aka_ms_link="$aka_ms_link/internal"
|
||||||
|
fi
|
||||||
|
aka_ms_link="$aka_ms_link/$normalized_channel"
|
||||||
|
if [[ ! -z "$normalized_quality" ]]; then
|
||||||
|
aka_ms_link="$aka_ms_link/$normalized_quality"
|
||||||
|
fi
|
||||||
|
aka_ms_link="$aka_ms_link/$normalized_product-$normalized_os-$normalized_architecture.tar.gz"
|
||||||
|
say_verbose "Constructed aka.ms link: '$aka_ms_link'."
|
||||||
|
|
||||||
|
#get HTTP response
|
||||||
|
#do not pass credentials as a part of the $aka_ms_link and do not apply credentials in the get_http_header function
|
||||||
|
#otherwise the redirect link would have credentials as well
|
||||||
|
#it would result in applying credentials twice to the resulting link and thus breaking it, and in echoing credentials to the output as a part of redirect link
|
||||||
|
disable_feed_credential=true
|
||||||
|
response="$(get_http_header $aka_ms_link $disable_feed_credential)"
|
||||||
|
|
||||||
|
say_verbose "Received response: $response"
|
||||||
|
# Get results of all the redirects.
|
||||||
|
http_codes=$( echo "$response" | awk '$1 ~ /^HTTP/ {print $2}' )
|
||||||
|
# They all need to be 301, otherwise some links are broken (except for the last, which is not a redirect but 200 or 404).
|
||||||
|
broken_redirects=$( echo "$http_codes" | sed '$d' | grep -v '301' )
|
||||||
|
|
||||||
|
# All HTTP codes are 301 (Moved Permanently), the redirect link exists.
|
||||||
|
if [[ -z "$broken_redirects" ]]; then
|
||||||
|
aka_ms_download_link=$( echo "$response" | awk '$1 ~ /^Location/{print $2}' | tail -1 | tr -d '\r')
|
||||||
|
|
||||||
|
if [[ -z "$aka_ms_download_link" ]]; then
|
||||||
|
say_verbose "The aka.ms link '$aka_ms_link' is not valid: failed to get redirect location."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
say_verbose "The redirect location retrieved: '$aka_ms_download_link'."
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
say_verbose "The aka.ms link '$aka_ms_link' is not valid: received HTTP code: $(echo "$broken_redirects" | paste -sd "," -)."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
calculate_vars() {
|
calculate_vars() {
|
||||||
eval $invocation
|
eval $invocation
|
||||||
valid_legacy_download_link=true
|
valid_legacy_download_link=true
|
||||||
|
|
||||||
|
#normalize input variables
|
||||||
normalized_architecture="$(get_normalized_architecture_from_architecture "$architecture")"
|
normalized_architecture="$(get_normalized_architecture_from_architecture "$architecture")"
|
||||||
say_verbose "normalized_architecture=$normalized_architecture"
|
say_verbose "Normalized architecture: '$normalized_architecture'."
|
||||||
|
|
||||||
normalized_os="$(get_normalized_os "$user_defined_os")"
|
normalized_os="$(get_normalized_os "$user_defined_os")"
|
||||||
say_verbose "normalized_os=$normalized_os"
|
say_verbose "Normalized OS: '$normalized_os'."
|
||||||
|
normalized_quality="$(get_normalized_quality "$quality")"
|
||||||
|
say_verbose "Normalized quality: '$normalized_quality'."
|
||||||
|
normalized_channel="$(get_normalized_channel "$channel")"
|
||||||
|
say_verbose "Normalized channel: '$normalized_channel'."
|
||||||
|
normalized_product="$(get_normalized_product "$runtime")"
|
||||||
|
say_verbose "Normalized product: '$normalized_product'."
|
||||||
|
|
||||||
|
#try to get download location from aka.ms link
|
||||||
|
#not applicable when exact version is specified via command or json file
|
||||||
|
normalized_version="$(to_lowercase "$version")"
|
||||||
|
if [[ -z "$json_file" && "$normalized_version" == "latest" ]]; then
|
||||||
|
|
||||||
|
valid_aka_ms_link=true;
|
||||||
|
get_download_link_from_aka_ms || valid_aka_ms_link=false
|
||||||
|
|
||||||
|
if [ "$valid_aka_ms_link" == false ]; then
|
||||||
|
# if quality is specified - exit with error - there is no fallback approach
|
||||||
|
if [ ! -z "$normalized_quality" ]; then
|
||||||
|
say_err "Failed to locate the latest version in the channel '$normalized_channel' with '$normalized_quality' quality for '$normalized_product', os: '$normalized_os', architecture: '$normalized_architecture'."
|
||||||
|
say_err "Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
say_verbose "Falling back to latest.version file approach."
|
||||||
|
else
|
||||||
|
say_verbose "Retrieved primary payload URL from aka.ms link: '$aka_ms_download_link'."
|
||||||
|
download_link=$aka_ms_download_link
|
||||||
|
|
||||||
|
say_verbose "Downloading using legacy url will not be attempted."
|
||||||
|
valid_legacy_download_link=false
|
||||||
|
|
||||||
|
#get version from the path
|
||||||
|
IFS='/'
|
||||||
|
read -ra pathElems <<< "$download_link"
|
||||||
|
count=${#pathElems[@]}
|
||||||
|
specific_version="${pathElems[count-2]}"
|
||||||
|
unset IFS;
|
||||||
|
say_verbose "Version: '$specific_version'."
|
||||||
|
|
||||||
|
#Retrieve product specific version
|
||||||
|
specific_product_version="$(get_specific_product_version "$azure_feed" "$specific_version" "$download_link")"
|
||||||
|
say_verbose "Product specific version: '$specific_product_version'."
|
||||||
|
|
||||||
|
install_root="$(resolve_installation_path "$install_dir")"
|
||||||
|
say_verbose "InstallRoot: '$install_root'."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
specific_version="$(get_specific_version_from_version "$azure_feed" "$channel" "$normalized_architecture" "$version" "$json_file")"
|
specific_version="$(get_specific_version_from_version "$azure_feed" "$channel" "$normalized_architecture" "$version" "$json_file")"
|
||||||
specific_product_version="$(get_specific_product_version "$azure_feed" "$specific_version")"
|
specific_product_version="$(get_specific_product_version "$azure_feed" "$specific_version")"
|
||||||
@@ -1011,6 +1314,8 @@ feed_credential=""
|
|||||||
verbose=false
|
verbose=false
|
||||||
runtime=""
|
runtime=""
|
||||||
runtime_id=""
|
runtime_id=""
|
||||||
|
quality=""
|
||||||
|
internal=false
|
||||||
override_non_versioned_files=true
|
override_non_versioned_files=true
|
||||||
non_dynamic_parameters=""
|
non_dynamic_parameters=""
|
||||||
user_defined_os=""
|
user_defined_os=""
|
||||||
@@ -1027,6 +1332,14 @@ do
|
|||||||
shift
|
shift
|
||||||
version="$1"
|
version="$1"
|
||||||
;;
|
;;
|
||||||
|
-q|--quality|-[Qq]uality)
|
||||||
|
shift
|
||||||
|
quality="$1"
|
||||||
|
;;
|
||||||
|
--internal|-[Ii]nternal)
|
||||||
|
internal=true
|
||||||
|
non_dynamic_parameters+=" $name"
|
||||||
|
;;
|
||||||
-i|--install-dir|-[Ii]nstall[Dd]ir)
|
-i|--install-dir|-[Ii]nstall[Dd]ir)
|
||||||
shift
|
shift
|
||||||
install_dir="$1"
|
install_dir="$1"
|
||||||
@@ -1084,7 +1397,9 @@ do
|
|||||||
--feed-credential|-[Ff]eed[Cc]redential)
|
--feed-credential|-[Ff]eed[Cc]redential)
|
||||||
shift
|
shift
|
||||||
feed_credential="$1"
|
feed_credential="$1"
|
||||||
non_dynamic_parameters+=" $name "\""$1"\"""
|
#feed_credential should start with "?", for it to be added to the end of the link.
|
||||||
|
#adding "?" at the beginning of the feed_credential if needed.
|
||||||
|
[[ -z "$(echo $feed_credential)" ]] || [[ $feed_credential == \?* ]] || feed_credential="?$feed_credential"
|
||||||
;;
|
;;
|
||||||
--runtime-id|-[Rr]untime[Ii]d)
|
--runtime-id|-[Rr]untime[Ii]d)
|
||||||
shift
|
shift
|
||||||
@@ -1116,15 +1431,26 @@ do
|
|||||||
echo " - LTS - most current supported release"
|
echo " - LTS - most current supported release"
|
||||||
echo " - 2-part version in a format A.B - represents a specific release"
|
echo " - 2-part version in a format A.B - represents a specific release"
|
||||||
echo " examples: 2.0; 1.0"
|
echo " examples: 2.0; 1.0"
|
||||||
echo " - Branch name"
|
echo " - 3-part version in a format A.B.Cxx - represents a specific SDK release"
|
||||||
echo " examples: release/2.0.0; Master"
|
echo " examples: 5.0.1xx, 5.0.2xx."
|
||||||
echo " Note: The version parameter overrides the channel parameter."
|
echo " Supported since 5.0 release"
|
||||||
|
echo " Note: The version parameter overrides the channel parameter when any version other than `latest` is used."
|
||||||
echo " -v,--version <VERSION> Use specific VERSION, Defaults to \`$version\`."
|
echo " -v,--version <VERSION> Use specific VERSION, Defaults to \`$version\`."
|
||||||
echo " -Version"
|
echo " -Version"
|
||||||
echo " Possible values:"
|
echo " Possible values:"
|
||||||
echo " - latest - most latest build on specific channel"
|
echo " - latest - most latest build on specific channel"
|
||||||
echo " - 3-part version in a format A.B.C - represents specific version of build"
|
echo " - 3-part version in a format A.B.C - represents specific version of build"
|
||||||
echo " examples: 2.0.0-preview2-006120; 1.1.0"
|
echo " examples: 2.0.0-preview2-006120; 1.1.0"
|
||||||
|
echo " -q,--quality <quality> Download the latest build of specified quality in the channel."
|
||||||
|
echo " -Quality"
|
||||||
|
echo " The possible values are: daily, signed, validated, preview, GA."
|
||||||
|
echo " Works only in combination with channel. Not applicable for current and LTS channels and will be ignored if those channels are used."
|
||||||
|
echo " For SDK use channel in A.B.Cxx format. Using quality for SDK together with channel in A.B format is not supported."
|
||||||
|
echo " Supported since 5.0 release."
|
||||||
|
echo " Note: The version parameter overrides the channel parameter when any version other than `latest` is used, and therefore overrides the quality."
|
||||||
|
echo " --internal,-Internal Download internal builds. Requires providing credentials via --feed-credential parameter."
|
||||||
|
echo " --feed-credential <FEEDCREDENTIAL> Token to access Azure feed. Used as a query string to append to the Azure feed."
|
||||||
|
echo " -FeedCredential This parameter typically is not specified."
|
||||||
echo " -i,--install-dir <DIR> Install under specified location (see Install Location below)"
|
echo " -i,--install-dir <DIR> Install under specified location (see Install Location below)"
|
||||||
echo " -InstallDir"
|
echo " -InstallDir"
|
||||||
echo " --architecture <ARCHITECTURE> Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`."
|
echo " --architecture <ARCHITECTURE> Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`."
|
||||||
@@ -1145,7 +1471,6 @@ do
|
|||||||
echo " --verbose,-Verbose Display diagnostics information."
|
echo " --verbose,-Verbose Display diagnostics information."
|
||||||
echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user."
|
echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user."
|
||||||
echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user."
|
echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user."
|
||||||
echo " --feed-credential,-FeedCredential Azure feed shared access token. This parameter typically is not specified."
|
|
||||||
echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable."
|
echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable."
|
||||||
echo " -SkipNonVersionedFiles"
|
echo " -SkipNonVersionedFiles"
|
||||||
echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly."
|
echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly."
|
||||||
@@ -1186,23 +1511,44 @@ say "- The SDK needs to be installed without user interaction and without admin
|
|||||||
say "- The SDK installation doesn't need to persist across multiple CI runs."
|
say "- The SDK installation doesn't need to persist across multiple CI runs."
|
||||||
say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n"
|
say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n"
|
||||||
|
|
||||||
|
if [ "$internal" = true ] && [ -z "$(echo $feed_credential)" ]; then
|
||||||
|
message="Provide credentials via --feed-credential parameter."
|
||||||
|
if [ "$dry_run" = true ]; then
|
||||||
|
say_warning "$message"
|
||||||
|
else
|
||||||
|
say_err "$message"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
check_min_reqs
|
check_min_reqs
|
||||||
calculate_vars
|
calculate_vars
|
||||||
script_name=$(basename "$0")
|
script_name=$(basename "$0")
|
||||||
|
|
||||||
if [ "$dry_run" = true ]; then
|
if [ "$dry_run" = true ]; then
|
||||||
say "Payload URLs:"
|
say "Payload URLs:"
|
||||||
say "Primary named payload URL: $download_link"
|
say "Primary named payload URL: ${download_link}"
|
||||||
if [ "$valid_legacy_download_link" = true ]; then
|
if [ "$valid_legacy_download_link" = true ]; then
|
||||||
say "Legacy named payload URL: $legacy_download_link"
|
say "Legacy named payload URL: ${legacy_download_link}"
|
||||||
fi
|
fi
|
||||||
repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\"""
|
repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\"""
|
||||||
|
|
||||||
|
if [ ! -z "$normalized_quality" ]; then
|
||||||
|
repeatable_command+=" --quality "\""$normalized_quality"\"""
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$runtime" == "dotnet" ]]; then
|
if [[ "$runtime" == "dotnet" ]]; then
|
||||||
repeatable_command+=" --runtime "\""dotnet"\"""
|
repeatable_command+=" --runtime "\""dotnet"\"""
|
||||||
elif [[ "$runtime" == "aspnetcore" ]]; then
|
elif [[ "$runtime" == "aspnetcore" ]]; then
|
||||||
repeatable_command+=" --runtime "\""aspnetcore"\"""
|
repeatable_command+=" --runtime "\""aspnetcore"\"""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
repeatable_command+="$non_dynamic_parameters"
|
repeatable_command+="$non_dynamic_parameters"
|
||||||
|
|
||||||
|
if [ -n "$feed_credential" ]; then
|
||||||
|
repeatable_command+=" --feed-credential "\""<feed_credential>"\"""
|
||||||
|
fi
|
||||||
|
|
||||||
say "Repeatable invocation: $repeatable_command"
|
say "Repeatable invocation: $repeatable_command"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ PACKAGERUNTIME=$1
|
|||||||
PRECACHE=$2
|
PRECACHE=$2
|
||||||
|
|
||||||
NODE_URL=https://nodejs.org/dist
|
NODE_URL=https://nodejs.org/dist
|
||||||
NODE12_VERSION="12.13.1"
|
NODE12_VERSION="12.22.7"
|
||||||
NODE16_VERSION="16.13.0"
|
NODE16_VERSION="16.13.0"
|
||||||
|
|
||||||
get_abs_path() {
|
get_abs_path() {
|
||||||
@@ -143,7 +143,7 @@ fi
|
|||||||
# Download the external tools for Linux PACKAGERUNTIMEs.
|
# Download the external tools for Linux PACKAGERUNTIMEs.
|
||||||
if [[ "$PACKAGERUNTIME" == "linux-x64" ]]; then
|
if [[ "$PACKAGERUNTIME" == "linux-x64" ]]; then
|
||||||
acquireExternalTool "$NODE_URL/v${NODE12_VERSION}/node-v${NODE12_VERSION}-linux-x64.tar.gz" node12 fix_nested_dir
|
acquireExternalTool "$NODE_URL/v${NODE12_VERSION}/node-v${NODE12_VERSION}-linux-x64.tar.gz" node12 fix_nested_dir
|
||||||
acquireExternalTool "https://vstsagenttools.blob.core.windows.net/tools/nodejs/${NODE12_VERSION}/alpine/x64/node-${NODE12_VERSION}-alpine-x64.tar.gz" node12_alpine
|
acquireExternalTool "https://vstsagenttools.blob.core.windows.net/tools/nodejs/${NODE12_VERSION}/alpine/x64/node-v${NODE12_VERSION}-alpine-x64.tar.gz" node12_alpine
|
||||||
acquireExternalTool "$NODE_URL/v${NODE16_VERSION}/node-v${NODE16_VERSION}-linux-x64.tar.gz" node16 fix_nested_dir
|
acquireExternalTool "$NODE_URL/v${NODE16_VERSION}/node-v${NODE16_VERSION}-linux-x64.tar.gz" node16 fix_nested_dir
|
||||||
acquireExternalTool "https://vstsagenttools.blob.core.windows.net/tools/nodejs/${NODE16_VERSION}/alpine/x64/node-v${NODE16_VERSION}-alpine-x64.tar.gz" node16_alpine
|
acquireExternalTool "https://vstsagenttools.blob.core.windows.net/tools/nodejs/${NODE16_VERSION}/alpine/x64/node-v${NODE16_VERSION}-alpine-x64.tar.gz" node16_alpine
|
||||||
fi
|
fi
|
||||||
@@ -157,3 +157,10 @@ if [[ "$PACKAGERUNTIME" == "linux-arm" ]]; then
|
|||||||
acquireExternalTool "$NODE_URL/v${NODE12_VERSION}/node-v${NODE12_VERSION}-linux-armv7l.tar.gz" node12 fix_nested_dir
|
acquireExternalTool "$NODE_URL/v${NODE12_VERSION}/node-v${NODE12_VERSION}-linux-armv7l.tar.gz" node12 fix_nested_dir
|
||||||
acquireExternalTool "$NODE_URL/v${NODE16_VERSION}/node-v${NODE16_VERSION}-linux-armv7l.tar.gz" node16 fix_nested_dir
|
acquireExternalTool "$NODE_URL/v${NODE16_VERSION}/node-v${NODE16_VERSION}-linux-armv7l.tar.gz" node16 fix_nested_dir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$PACKAGERUNTIME" == "linux-musl-x64" ]]; then
|
||||||
|
acquireExternalTool "$NODE_URL/v${NODE12_VERSION}/node-v${NODE12_VERSION}-linux-x64.tar.gz" node12_glib fix_nested_dir
|
||||||
|
acquireExternalTool "https://vstsagenttools.blob.core.windows.net/tools/nodejs/${NODE12_VERSION}/alpine/x64/node-v${NODE12_VERSION}-alpine-x64.tar.gz" node12
|
||||||
|
acquireExternalTool "$NODE_URL/v${NODE16_VERSION}/node-v${NODE16_VERSION}-linux-x64.tar.gz" node16_glib fix_nested_dir
|
||||||
|
acquireExternalTool "https://vstsagenttools.blob.core.windows.net/tools/nodejs/${NODE16_VERSION}/alpine/x64/node-v${NODE16_VERSION}-alpine-x64.tar.gz" node16
|
||||||
|
fi
|
||||||
@@ -83,7 +83,7 @@ var gracefulShutdown = function (code) {
|
|||||||
listener.kill('SIGINT');
|
listener.kill('SIGINT');
|
||||||
|
|
||||||
console.log('Sending SIGKILL to runner listener');
|
console.log('Sending SIGKILL to runner listener');
|
||||||
setTimeout(() => listener.kill('SIGKILL'), 30000).unref();
|
setTimeout(() => listener.kill('SIGKILL'), 30000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if [ $user_id -eq 0 -a -z "$RUNNER_ALLOW_RUNASROOT" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check dotnet Core 6.0 dependencies for Linux
|
# Check dotnet core 3.0 dependencies for Linux
|
||||||
if [[ (`uname` == "Linux") ]]
|
if [[ (`uname` == "Linux") ]]
|
||||||
then
|
then
|
||||||
command -v ldd > /dev/null
|
command -v ldd > /dev/null
|
||||||
@@ -18,25 +18,25 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
message="Execute sudo ./bin/installdependencies.sh to install any missing Dotnet Core 6.0 dependencies."
|
message="Execute sudo ./bin/installdependencies.sh to install any missing Dotnet Core 3.0 dependencies."
|
||||||
|
|
||||||
ldd ./bin/libcoreclr.so | grep 'not found'
|
ldd ./bin/libcoreclr.so | grep 'not found'
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "Dependencies is missing for Dotnet Core 6.0"
|
echo "Dependencies is missing for Dotnet Core 3.0"
|
||||||
echo $message
|
echo $message
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ldd ./bin/libSystem.Security.Cryptography.Native.OpenSsl.so | grep 'not found'
|
ldd ./bin/System.Security.Cryptography.Native.OpenSsl.so | grep 'not found'
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "Dependencies is missing for Dotnet Core 6.0"
|
echo "Dependencies is missing for Dotnet Core 3.0"
|
||||||
echo $message
|
echo $message
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ldd ./bin/libSystem.IO.Compression.Native.so | grep 'not found'
|
ldd ./bin/System.IO.Compression.Native.so | grep 'not found'
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "Dependencies is missing for Dotnet Core 6.0"
|
echo "Dependencies is missing for Dotnet Core 3.0"
|
||||||
echo $message
|
echo $message
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -54,7 +54,7 @@ then
|
|||||||
libpath=${LD_LIBRARY_PATH:-}
|
libpath=${LD_LIBRARY_PATH:-}
|
||||||
$LDCONFIG_COMMAND -NXv ${libpath//:/ } 2>&1 | grep libicu >/dev/null 2>&1
|
$LDCONFIG_COMMAND -NXv ${libpath//:/ } 2>&1 | grep libicu >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Libicu's dependencies is missing for Dotnet Core 6.0"
|
echo "Libicu's dependencies is missing for Dotnet Core 3.0"
|
||||||
echo $message
|
echo $message
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
actions.runner.plist.template
|
|
||||||
actions.runner.service.template
|
|
||||||
checkScripts/downloadCert.js
|
|
||||||
checkScripts/makeWebRequest.js
|
|
||||||
darwin.svc.sh.template
|
|
||||||
hashFiles/index.js
|
|
||||||
installdependencies.sh
|
|
||||||
macos-run-invoker.js
|
|
||||||
Microsoft.IdentityModel.Logging.dll
|
|
||||||
Microsoft.IdentityModel.Tokens.dll
|
|
||||||
Minimatch.dll
|
|
||||||
Newtonsoft.Json.Bson.dll
|
|
||||||
Newtonsoft.Json.dll
|
|
||||||
Runner.Common.deps.json
|
|
||||||
Runner.Common.dll
|
|
||||||
Runner.Common.pdb
|
|
||||||
Runner.Listener
|
|
||||||
Runner.Listener.deps.json
|
|
||||||
Runner.Listener.dll
|
|
||||||
Runner.Listener.exe
|
|
||||||
Runner.Listener.pdb
|
|
||||||
Runner.Listener.runtimeconfig.json
|
|
||||||
Runner.PluginHost
|
|
||||||
Runner.PluginHost.deps.json
|
|
||||||
Runner.PluginHost.dll
|
|
||||||
Runner.PluginHost.exe
|
|
||||||
Runner.PluginHost.pdb
|
|
||||||
Runner.PluginHost.runtimeconfig.json
|
|
||||||
Runner.Plugins.deps.json
|
|
||||||
Runner.Plugins.dll
|
|
||||||
Runner.Plugins.pdb
|
|
||||||
Runner.Sdk.deps.json
|
|
||||||
Runner.Sdk.dll
|
|
||||||
Runner.Sdk.pdb
|
|
||||||
Runner.Worker
|
|
||||||
Runner.Worker.deps.json
|
|
||||||
Runner.Worker.dll
|
|
||||||
Runner.Worker.exe
|
|
||||||
Runner.Worker.pdb
|
|
||||||
Runner.Worker.runtimeconfig.json
|
|
||||||
RunnerService.exe
|
|
||||||
RunnerService.exe.config
|
|
||||||
RunnerService.js
|
|
||||||
RunnerService.pdb
|
|
||||||
runsvc.sh
|
|
||||||
Sdk.deps.json
|
|
||||||
Sdk.dll
|
|
||||||
Sdk.pdb
|
|
||||||
System.IdentityModel.Tokens.Jwt.dll
|
|
||||||
System.Net.Http.Formatting.dll
|
|
||||||
System.Security.Cryptography.Pkcs.dll
|
|
||||||
System.Security.Cryptography.ProtectedData.dll
|
|
||||||
System.ServiceProcess.ServiceController.dll
|
|
||||||
systemd.svc.sh.template
|
|
||||||
update.cmd.template
|
|
||||||
update.sh.template
|
|
||||||
YamlDotNet.dll
|
|
||||||
@@ -1,263 +0,0 @@
|
|||||||
api-ms-win-core-console-l1-1-0.dll
|
|
||||||
api-ms-win-core-console-l1-2-0.dll
|
|
||||||
api-ms-win-core-datetime-l1-1-0.dll
|
|
||||||
api-ms-win-core-debug-l1-1-0.dll
|
|
||||||
api-ms-win-core-errorhandling-l1-1-0.dll
|
|
||||||
api-ms-win-core-file-l1-1-0.dll
|
|
||||||
api-ms-win-core-file-l1-2-0.dll
|
|
||||||
api-ms-win-core-file-l2-1-0.dll
|
|
||||||
api-ms-win-core-handle-l1-1-0.dll
|
|
||||||
api-ms-win-core-heap-l1-1-0.dll
|
|
||||||
api-ms-win-core-interlocked-l1-1-0.dll
|
|
||||||
api-ms-win-core-libraryloader-l1-1-0.dll
|
|
||||||
api-ms-win-core-localization-l1-2-0.dll
|
|
||||||
api-ms-win-core-memory-l1-1-0.dll
|
|
||||||
api-ms-win-core-namedpipe-l1-1-0.dll
|
|
||||||
api-ms-win-core-processenvironment-l1-1-0.dll
|
|
||||||
api-ms-win-core-processthreads-l1-1-0.dll
|
|
||||||
api-ms-win-core-processthreads-l1-1-1.dll
|
|
||||||
api-ms-win-core-profile-l1-1-0.dll
|
|
||||||
api-ms-win-core-rtlsupport-l1-1-0.dll
|
|
||||||
api-ms-win-core-string-l1-1-0.dll
|
|
||||||
api-ms-win-core-synch-l1-1-0.dll
|
|
||||||
api-ms-win-core-synch-l1-2-0.dll
|
|
||||||
api-ms-win-core-sysinfo-l1-1-0.dll
|
|
||||||
api-ms-win-core-timezone-l1-1-0.dll
|
|
||||||
api-ms-win-core-util-l1-1-0.dll
|
|
||||||
api-ms-win-crt-conio-l1-1-0.dll
|
|
||||||
api-ms-win-crt-convert-l1-1-0.dll
|
|
||||||
api-ms-win-crt-environment-l1-1-0.dll
|
|
||||||
api-ms-win-crt-filesystem-l1-1-0.dll
|
|
||||||
api-ms-win-crt-heap-l1-1-0.dll
|
|
||||||
api-ms-win-crt-locale-l1-1-0.dll
|
|
||||||
api-ms-win-crt-math-l1-1-0.dll
|
|
||||||
api-ms-win-crt-multibyte-l1-1-0.dll
|
|
||||||
api-ms-win-crt-private-l1-1-0.dll
|
|
||||||
api-ms-win-crt-process-l1-1-0.dll
|
|
||||||
api-ms-win-crt-runtime-l1-1-0.dll
|
|
||||||
api-ms-win-crt-stdio-l1-1-0.dll
|
|
||||||
api-ms-win-crt-string-l1-1-0.dll
|
|
||||||
api-ms-win-crt-time-l1-1-0.dll
|
|
||||||
api-ms-win-crt-utility-l1-1-0.dll
|
|
||||||
clrcompression.dll
|
|
||||||
clretwrc.dll
|
|
||||||
clrjit.dll
|
|
||||||
coreclr.dll
|
|
||||||
createdump
|
|
||||||
createdump.exe
|
|
||||||
dbgshim.dll
|
|
||||||
hostfxr.dll
|
|
||||||
hostpolicy.dll
|
|
||||||
libclrjit.dylib
|
|
||||||
libclrjit.so
|
|
||||||
libcoreclr.dylib
|
|
||||||
libcoreclr.so
|
|
||||||
libcoreclrtraceptprovider.so
|
|
||||||
libdbgshim.dylib
|
|
||||||
libdbgshim.so
|
|
||||||
libhostfxr.dylib
|
|
||||||
libhostfxr.so
|
|
||||||
libhostpolicy.dylib
|
|
||||||
libhostpolicy.so
|
|
||||||
libmscordaccore.dylib
|
|
||||||
libmscordaccore.so
|
|
||||||
libmscordbi.dylib
|
|
||||||
libmscordbi.so
|
|
||||||
Microsoft.CSharp.dll
|
|
||||||
Microsoft.DiaSymReader.Native.amd64.dll
|
|
||||||
Microsoft.VisualBasic.Core.dll
|
|
||||||
Microsoft.VisualBasic.dll
|
|
||||||
Microsoft.Win32.Primitives.dll
|
|
||||||
Microsoft.Win32.Registry.dll
|
|
||||||
mscordaccore.dll
|
|
||||||
mscordaccore_amd64_amd64_6.0.21.52210.dll
|
|
||||||
mscordbi.dll
|
|
||||||
mscorlib.dll
|
|
||||||
mscorrc.debug.dll
|
|
||||||
mscorrc.dll
|
|
||||||
msquic.dll
|
|
||||||
netstandard.dll
|
|
||||||
SOS_README.md
|
|
||||||
System.AppContext.dll
|
|
||||||
System.Buffers.dll
|
|
||||||
System.Collections.Concurrent.dll
|
|
||||||
System.Collections.dll
|
|
||||||
System.Collections.Immutable.dll
|
|
||||||
System.Collections.NonGeneric.dll
|
|
||||||
System.Collections.Specialized.dll
|
|
||||||
System.ComponentModel.Annotations.dll
|
|
||||||
System.ComponentModel.DataAnnotations.dll
|
|
||||||
System.ComponentModel.dll
|
|
||||||
System.ComponentModel.EventBasedAsync.dll
|
|
||||||
System.ComponentModel.Primitives.dll
|
|
||||||
System.ComponentModel.TypeConverter.dll
|
|
||||||
System.Configuration.dll
|
|
||||||
System.Console.dll
|
|
||||||
System.Core.dll
|
|
||||||
System.Data.Common.dll
|
|
||||||
System.Data.DataSetExtensions.dll
|
|
||||||
System.Data.dll
|
|
||||||
System.Diagnostics.Contracts.dll
|
|
||||||
System.Diagnostics.Debug.dll
|
|
||||||
System.Diagnostics.DiagnosticSource.dll
|
|
||||||
System.Diagnostics.FileVersionInfo.dll
|
|
||||||
System.Diagnostics.Process.dll
|
|
||||||
System.Diagnostics.StackTrace.dll
|
|
||||||
System.Diagnostics.TextWriterTraceListener.dll
|
|
||||||
System.Diagnostics.Tools.dll
|
|
||||||
System.Diagnostics.TraceSource.dll
|
|
||||||
System.Diagnostics.Tracing.dll
|
|
||||||
System.dll
|
|
||||||
System.Drawing.dll
|
|
||||||
System.Drawing.Primitives.dll
|
|
||||||
System.Dynamic.Runtime.dll
|
|
||||||
System.Formats.Asn1.dll
|
|
||||||
System.Globalization.Calendars.dll
|
|
||||||
System.Globalization.dll
|
|
||||||
System.Globalization.Extensions.dll
|
|
||||||
System.Globalization.Native.dylib
|
|
||||||
System.Globalization.Native.so
|
|
||||||
System.IO.Compression.Brotli.dll
|
|
||||||
System.IO.Compression.dll
|
|
||||||
System.IO.Compression.FileSystem.dll
|
|
||||||
System.IO.Compression.Native.a
|
|
||||||
System.IO.Compression.Native.dll
|
|
||||||
System.IO.Compression.Native.dylib
|
|
||||||
System.IO.Compression.Native.so
|
|
||||||
System.IO.Compression.ZipFile.dll
|
|
||||||
System.IO.dll
|
|
||||||
System.IO.FileSystem.AccessControl.dll
|
|
||||||
System.IO.FileSystem.dll
|
|
||||||
System.IO.FileSystem.DriveInfo.dll
|
|
||||||
System.IO.FileSystem.Primitives.dll
|
|
||||||
System.IO.FileSystem.Watcher.dll
|
|
||||||
System.IO.IsolatedStorage.dll
|
|
||||||
System.IO.MemoryMappedFiles.dll
|
|
||||||
System.IO.Pipes.AccessControl.dll
|
|
||||||
System.IO.Pipes.dll
|
|
||||||
System.IO.UnmanagedMemoryStream.dll
|
|
||||||
System.Linq.dll
|
|
||||||
System.Linq.Expressions.dll
|
|
||||||
System.Linq.Parallel.dll
|
|
||||||
System.Linq.Queryable.dll
|
|
||||||
System.Memory.dll
|
|
||||||
System.Native.a
|
|
||||||
System.Native.dylib
|
|
||||||
System.Native.so
|
|
||||||
System.Net.dll
|
|
||||||
System.Net.Http.dll
|
|
||||||
System.Net.Http.Json.dll
|
|
||||||
System.Net.Http.Native.a
|
|
||||||
System.Net.Http.Native.dylib
|
|
||||||
System.Net.Http.Native.so
|
|
||||||
System.Net.HttpListener.dll
|
|
||||||
System.Net.Mail.dll
|
|
||||||
System.Net.NameResolution.dll
|
|
||||||
System.Net.NetworkInformation.dll
|
|
||||||
System.Net.Ping.dll
|
|
||||||
System.Net.Primitives.dll
|
|
||||||
System.Net.Quic.dll
|
|
||||||
System.Net.Requests.dll
|
|
||||||
System.Net.Security.dll
|
|
||||||
System.Net.Security.Native.a
|
|
||||||
System.Net.Security.Native.dylib
|
|
||||||
System.Net.Security.Native.so
|
|
||||||
System.Net.ServicePoint.dll
|
|
||||||
System.Net.Sockets.dll
|
|
||||||
System.Net.WebClient.dll
|
|
||||||
System.Net.WebHeaderCollection.dll
|
|
||||||
System.Net.WebProxy.dll
|
|
||||||
System.Net.WebSockets.Client.dll
|
|
||||||
System.Net.WebSockets.dll
|
|
||||||
System.Numerics.dll
|
|
||||||
System.Numerics.Vectors.dll
|
|
||||||
System.ObjectModel.dll
|
|
||||||
System.Private.CoreLib.dll
|
|
||||||
System.Private.DataContractSerialization.dll
|
|
||||||
System.Private.Uri.dll
|
|
||||||
System.Private.Xml.dll
|
|
||||||
System.Private.Xml.Linq.dll
|
|
||||||
System.Reflection.DispatchProxy.dll
|
|
||||||
System.Reflection.dll
|
|
||||||
System.Reflection.Emit.dll
|
|
||||||
System.Reflection.Emit.ILGeneration.dll
|
|
||||||
System.Reflection.Emit.Lightweight.dll
|
|
||||||
System.Reflection.Extensions.dll
|
|
||||||
System.Reflection.Metadata.dll
|
|
||||||
System.Reflection.Primitives.dll
|
|
||||||
System.Reflection.TypeExtensions.dll
|
|
||||||
System.Resources.Reader.dll
|
|
||||||
System.Resources.ResourceManager.dll
|
|
||||||
System.Resources.Writer.dll
|
|
||||||
System.Runtime.CompilerServices.Unsafe.dll
|
|
||||||
System.Runtime.CompilerServices.VisualC.dll
|
|
||||||
System.Runtime.dll
|
|
||||||
System.Runtime.Extensions.dll
|
|
||||||
System.Runtime.Handles.dll
|
|
||||||
System.Runtime.InteropServices.dll
|
|
||||||
System.Runtime.InteropServices.RuntimeInformation.dll
|
|
||||||
System.Runtime.InteropServices.WindowsRuntime.dll
|
|
||||||
System.Runtime.Intrinsics.dll
|
|
||||||
System.Runtime.Loader.dll
|
|
||||||
System.Runtime.Numerics.dll
|
|
||||||
System.Runtime.Serialization.dll
|
|
||||||
System.Runtime.Serialization.Formatters.dll
|
|
||||||
System.Runtime.Serialization.Json.dll
|
|
||||||
System.Runtime.Serialization.Primitives.dll
|
|
||||||
System.Runtime.Serialization.Xml.dll
|
|
||||||
System.Runtime.WindowsRuntime.dll
|
|
||||||
System.Runtime.WindowsRuntime.UI.Xaml.dll
|
|
||||||
System.Security.AccessControl.dll
|
|
||||||
System.Security.Claims.dll
|
|
||||||
System.Security.Cryptography.Algorithms.dll
|
|
||||||
System.Security.Cryptography.Cng.dll
|
|
||||||
System.Security.Cryptography.Csp.dll
|
|
||||||
System.Security.Cryptography.Encoding.dll
|
|
||||||
System.Security.Cryptography.Native.Apple.a
|
|
||||||
System.Security.Cryptography.Native.Apple.dylib
|
|
||||||
System.Security.Cryptography.Native.OpenSsl.a
|
|
||||||
System.Security.Cryptography.Native.OpenSsl.dylib
|
|
||||||
System.Security.Cryptography.Native.OpenSsl.so
|
|
||||||
System.Security.Cryptography.OpenSsl.dll
|
|
||||||
System.Security.Cryptography.Primitives.dll
|
|
||||||
System.Security.Cryptography.X509Certificates.dll
|
|
||||||
System.Security.Cryptography.XCertificates.dll
|
|
||||||
System.Security.dll
|
|
||||||
System.Security.Principal.dll
|
|
||||||
System.Security.Principal.Windows.dll
|
|
||||||
System.Security.SecureString.dll
|
|
||||||
System.ServiceModel.Web.dll
|
|
||||||
System.ServiceProcess.dll
|
|
||||||
System.Text.Encoding.CodePages.dll
|
|
||||||
System.Text.Encoding.dll
|
|
||||||
System.Text.Encoding.Extensions.dll
|
|
||||||
System.Text.Encodings.Web.dll
|
|
||||||
System.Text.Json.dll
|
|
||||||
System.Text.RegularExpressions.dll
|
|
||||||
System.Threading.Channels.dll
|
|
||||||
System.Threading.dll
|
|
||||||
System.Threading.Overlapped.dll
|
|
||||||
System.Threading.Tasks.Dataflow.dll
|
|
||||||
System.Threading.Tasks.dll
|
|
||||||
System.Threading.Tasks.Extensions.dll
|
|
||||||
System.Threading.Tasks.Parallel.dll
|
|
||||||
System.Threading.Thread.dll
|
|
||||||
System.Threading.ThreadPool.dll
|
|
||||||
System.Threading.Timer.dll
|
|
||||||
System.Transactions.dll
|
|
||||||
System.Transactions.Local.dll
|
|
||||||
System.ValueTuple.dll
|
|
||||||
System.Web.dll
|
|
||||||
System.Web.HttpUtility.dll
|
|
||||||
System.Windows.dll
|
|
||||||
System.Xml.dll
|
|
||||||
System.Xml.Linq.dll
|
|
||||||
System.Xml.ReaderWriter.dll
|
|
||||||
System.Xml.Serialization.dll
|
|
||||||
System.Xml.XDocument.dll
|
|
||||||
System.Xml.XmlDocument.dll
|
|
||||||
System.Xml.XmlSerializer.dll
|
|
||||||
System.Xml.XPath.dll
|
|
||||||
System.Xml.XPath.XDocument.dll
|
|
||||||
ucrtbase.dll
|
|
||||||
WindowsBase.dll
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"HashValue": "<NO_RUNTIME_EXTERNALS_HASH>",
|
|
||||||
"DownloadUrl": "https://github.com/actions/runner/releases/download/v<RUNNER_VERSION>/actions-runner-<RUNNER_PLATFORM>-<RUNNER_VERSION>-noruntime-noexternals.tar.gz",
|
|
||||||
"TrimmedContents": {
|
|
||||||
"dotnetRuntime": "<RUNTIME_HASH>",
|
|
||||||
"externals": "<EXTERNALS_HASH>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"HashValue": "<NO_RUNTIME_HASH>",
|
|
||||||
"DownloadUrl": "https://github.com/actions/runner/releases/download/v<RUNNER_VERSION>/actions-runner-<RUNNER_PLATFORM>-<RUNNER_VERSION>-noruntime.tar.gz",
|
|
||||||
"TrimmedContents": {
|
|
||||||
"dotnetRuntime": "<RUNTIME_HASH>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"HashValue": "<NO_EXTERNALS_HASH>",
|
|
||||||
"DownloadUrl": "https://github.com/actions/runner/releases/download/v<RUNNER_VERSION>/actions-runner-<RUNNER_PLATFORM>-<RUNNER_VERSION>-noexternals.tar.gz",
|
|
||||||
"TrimmedContents": {
|
|
||||||
"externals": "<EXTERNALS_HASH>"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"HashValue": "<NO_RUNTIME_EXTERNALS_HASH>",
|
|
||||||
"DownloadUrl": "https://github.com/actions/runner/releases/download/v<RUNNER_VERSION>/actions-runner-<RUNNER_PLATFORM>-<RUNNER_VERSION>-noruntime-noexternals.zip",
|
|
||||||
"TrimmedContents": {
|
|
||||||
"dotnetRuntime": "<RUNTIME_HASH>",
|
|
||||||
"externals": "<EXTERNALS_HASH>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"HashValue": "<NO_RUNTIME_HASH>",
|
|
||||||
"DownloadUrl": "https://github.com/actions/runner/releases/download/v<RUNNER_VERSION>/actions-runner-<RUNNER_PLATFORM>-<RUNNER_VERSION>-noruntime.zip",
|
|
||||||
"TrimmedContents": {
|
|
||||||
"dotnetRuntime": "<RUNTIME_HASH>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"HashValue": "<NO_EXTERNALS_HASH>",
|
|
||||||
"DownloadUrl": "https://github.com/actions/runner/releases/download/v<RUNNER_VERSION>/actions-runner-<RUNNER_PLATFORM>-<RUNNER_VERSION>-noexternals.zip",
|
|
||||||
"TrimmedContents": {
|
|
||||||
"externals": "<EXTERNALS_HASH>"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -33,9 +33,6 @@ namespace GitHub.Runner.Common
|
|||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
public string PoolName { get; set; }
|
public string PoolName { get; set; }
|
||||||
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
|
||||||
public bool DisableUpdate { get; set; }
|
|
||||||
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
public bool Ephemeral { get; set; }
|
public bool Ephemeral { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ namespace GitHub.Runner.Common
|
|||||||
public static readonly string Ephemeral = "ephemeral";
|
public static readonly string Ephemeral = "ephemeral";
|
||||||
public static readonly string Help = "help";
|
public static readonly string Help = "help";
|
||||||
public static readonly string Replace = "replace";
|
public static readonly string Replace = "replace";
|
||||||
public static readonly string DisableUpdate = "disableupdate";
|
|
||||||
public static readonly string Once = "once"; // Keep this around since customers still relies on it
|
public static readonly string Once = "once"; // Keep this around since customers still relies on it
|
||||||
public static readonly string RunAsService = "runasservice";
|
public static readonly string RunAsService = "runasservice";
|
||||||
public static readonly string Unattended = "unattended";
|
public static readonly string Unattended = "unattended";
|
||||||
|
|||||||
@@ -98,14 +98,14 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
int logPageSize;
|
int logPageSize;
|
||||||
string logSizeEnv = Environment.GetEnvironmentVariable($"{hostType.ToUpperInvariant()}_LOGSIZE");
|
string logSizeEnv = Environment.GetEnvironmentVariable($"{hostType.ToUpperInvariant()}_LOGSIZE");
|
||||||
if (string.IsNullOrEmpty(logSizeEnv) || !int.TryParse(logSizeEnv, out logPageSize))
|
if (!string.IsNullOrEmpty(logSizeEnv) || !int.TryParse(logSizeEnv, out logPageSize))
|
||||||
{
|
{
|
||||||
logPageSize = _defaultLogPageSize;
|
logPageSize = _defaultLogPageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
int logRetentionDays;
|
int logRetentionDays;
|
||||||
string logRetentionDaysEnv = Environment.GetEnvironmentVariable($"{hostType.ToUpperInvariant()}_LOGRETENTION");
|
string logRetentionDaysEnv = Environment.GetEnvironmentVariable($"{hostType.ToUpperInvariant()}_LOGRETENTION");
|
||||||
if (string.IsNullOrEmpty(logRetentionDaysEnv) || !int.TryParse(logRetentionDaysEnv, out logRetentionDays))
|
if (!string.IsNullOrEmpty(logRetentionDaysEnv) || !int.TryParse(logRetentionDaysEnv, out logRetentionDays))
|
||||||
{
|
{
|
||||||
logRetentionDays = _defaultLogRetentionDays;
|
logRetentionDays = _defaultLogRetentionDays;
|
||||||
}
|
}
|
||||||
@@ -193,11 +193,6 @@ namespace GitHub.Runner.Common
|
|||||||
_trace.Info($"No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)");
|
_trace.Info($"No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
|
|
||||||
{
|
|
||||||
_trace.Warning($"Runner is running under insecure mode: HTTPS server certifcate validation has been turned off by GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY environment variable.");
|
|
||||||
}
|
|
||||||
|
|
||||||
var credFile = GetConfigFile(WellKnownConfigFile.Credentials);
|
var credFile = GetConfigFile(WellKnownConfigFile.Credentials);
|
||||||
if (File.Exists(credFile))
|
if (File.Exists(credFile))
|
||||||
{
|
{
|
||||||
@@ -205,17 +200,9 @@ namespace GitHub.Runner.Common
|
|||||||
if (credData != null &&
|
if (credData != null &&
|
||||||
credData.Data.TryGetValue("clientId", out var clientId))
|
credData.Data.TryGetValue("clientId", out var clientId))
|
||||||
{
|
{
|
||||||
_userAgents.Add(new ProductInfoHeaderValue("ClientId", clientId));
|
_userAgents.Add(new ProductInfoHeaderValue($"RunnerId", clientId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var runnerFile = GetConfigFile(WellKnownConfigFile.Runner);
|
|
||||||
if (File.Exists(runnerFile))
|
|
||||||
{
|
|
||||||
var runnerSettings = IOUtil.LoadObject<RunnerSettings>(runnerFile);
|
|
||||||
_userAgents.Add(new ProductInfoHeaderValue("RunnerId", runnerSettings.AgentId.ToString(CultureInfo.InvariantCulture)));
|
|
||||||
_userAgents.Add(new ProductInfoHeaderValue("GroupId", runnerSettings.PoolId.ToString(CultureInfo.InvariantCulture)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetDirectory(WellKnownDirectory directory)
|
public string GetDirectory(WellKnownDirectory directory)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using GitHub.Runner.Sdk;
|
using GitHub.Runner.Sdk;
|
||||||
|
|
||||||
@@ -14,14 +13,7 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
public HttpClientHandler CreateClientHandler(RunnerWebProxy webProxy)
|
public HttpClientHandler CreateClientHandler(RunnerWebProxy webProxy)
|
||||||
{
|
{
|
||||||
var client = new HttpClientHandler() { Proxy = webProxy };
|
return new HttpClientHandler() { Proxy = webProxy };
|
||||||
|
|
||||||
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
|
|
||||||
{
|
|
||||||
client.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
|
|
||||||
}
|
|
||||||
|
|
||||||
return client;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
|
using GitHub.DistributedTask.WebApi;
|
||||||
|
using GitHub.Runner.Common.Util;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using GitHub.DistributedTask.WebApi;
|
|
||||||
using GitHub.Runner.Sdk;
|
|
||||||
using Pipelines = GitHub.DistributedTask.Pipelines;
|
using Pipelines = GitHub.DistributedTask.Pipelines;
|
||||||
|
using GitHub.Runner.Sdk;
|
||||||
|
|
||||||
namespace GitHub.Runner.Common
|
namespace GitHub.Runner.Common
|
||||||
{
|
{
|
||||||
@@ -75,7 +76,6 @@ namespace GitHub.Runner.Common
|
|||||||
// at the same time we can cut the load to server after the build run for more than 60s
|
// at the same time we can cut the load to server after the build run for more than 60s
|
||||||
private int _webConsoleLineAggressiveDequeueCount = 0;
|
private int _webConsoleLineAggressiveDequeueCount = 0;
|
||||||
private const int _webConsoleLineAggressiveDequeueLimit = 4 * 60;
|
private const int _webConsoleLineAggressiveDequeueLimit = 4 * 60;
|
||||||
private const int _webConsoleLineQueueSizeLimit = 1024;
|
|
||||||
private bool _webConsoleLineAggressiveDequeue = true;
|
private bool _webConsoleLineAggressiveDequeue = true;
|
||||||
private bool _firstConsoleOutputs = true;
|
private bool _firstConsoleOutputs = true;
|
||||||
|
|
||||||
@@ -161,20 +161,8 @@ namespace GitHub.Runner.Common
|
|||||||
|
|
||||||
public void QueueWebConsoleLine(Guid stepRecordId, string line, long? lineNumber)
|
public void QueueWebConsoleLine(Guid stepRecordId, string line, long? lineNumber)
|
||||||
{
|
{
|
||||||
// We only process 500 lines of the queue everytime.
|
Trace.Verbose("Enqueue web console line queue: {0}", line);
|
||||||
// If the queue is backing up due to slow Http request or flood of output from step,
|
_webConsoleLineQueue.Enqueue(new ConsoleLineInfo(stepRecordId, line, lineNumber));
|
||||||
// we will drop the output to avoid extra memory consumption from the runner since the live console feed is best effort.
|
|
||||||
if (!string.IsNullOrEmpty(line) && _webConsoleLineQueue.Count < _webConsoleLineQueueSizeLimit)
|
|
||||||
{
|
|
||||||
Trace.Verbose("Enqueue web console line queue: {0}", line);
|
|
||||||
if (line.Length > 1024)
|
|
||||||
{
|
|
||||||
Trace.Verbose("Web console line is more than 1024 chars, truncate to first 1024 chars");
|
|
||||||
line = $"{line.Substring(0, 1024)}...";
|
|
||||||
}
|
|
||||||
|
|
||||||
_webConsoleLineQueue.Enqueue(new ConsoleLineInfo(stepRecordId, line, lineNumber));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueueFileUpload(Guid timelineId, Guid timelineRecordId, string type, string name, string path, bool deleteSource)
|
public void QueueFileUpload(Guid timelineId, Guid timelineRecordId, string type, string name, string path, bool deleteSource)
|
||||||
@@ -242,6 +230,12 @@ namespace GitHub.Runner.Common
|
|||||||
stepRecordIds.Add(lineInfo.StepRecordId);
|
stepRecordIds.Add(lineInfo.StepRecordId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(lineInfo.Line) && lineInfo.Line.Length > 1024)
|
||||||
|
{
|
||||||
|
Trace.Verbose("Web console line is more than 1024 chars, truncate to first 1024 chars");
|
||||||
|
lineInfo.Line = $"{lineInfo.Line.Substring(0, 1024)}...";
|
||||||
|
}
|
||||||
|
|
||||||
stepsConsoleLines[lineInfo.StepRecordId].Add(new TimelineRecordLogLine(lineInfo.Line, lineInfo.LineNumber));
|
stepsConsoleLines[lineInfo.StepRecordId].Add(new TimelineRecordLogLine(lineInfo.Line, lineInfo.LineNumber));
|
||||||
linesCounter++;
|
linesCounter++;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;linux-musl-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
|
<AssetTargetFallback>portable-net45+win8</AssetTargetFallback>
|
||||||
<NoWarn>NU1701;NU1603</NoWarn>
|
<NoWarn>NU1701;NU1603</NoWarn>
|
||||||
<Version>$(Version)</Version>
|
<Version>$(Version)</Version>
|
||||||
|
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace GitHub.Runner.Common
|
|||||||
Task<PackageMetadata> GetPackageAsync(string packageType, string platform, string version, bool includeToken, CancellationToken cancellationToken);
|
Task<PackageMetadata> GetPackageAsync(string packageType, string platform, string version, bool includeToken, CancellationToken cancellationToken);
|
||||||
|
|
||||||
// agent update
|
// agent update
|
||||||
Task<TaskAgent> UpdateAgentUpdateStateAsync(int agentPoolId, int agentId, string currentState, string trace);
|
Task<TaskAgent> UpdateAgentUpdateStateAsync(int agentPoolId, int agentId, string currentState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class RunnerServer : RunnerService, IRunnerServer
|
public sealed class RunnerServer : RunnerService, IRunnerServer
|
||||||
@@ -341,10 +341,25 @@ namespace GitHub.Runner.Common
|
|||||||
return _genericTaskAgentClient.GetPackageAsync(packageType, platform, version, includeToken, cancellationToken: cancellationToken);
|
return _genericTaskAgentClient.GetPackageAsync(packageType, platform, version, includeToken, cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<TaskAgent> UpdateAgentUpdateStateAsync(int agentPoolId, int agentId, string currentState, string trace)
|
public Task<TaskAgent> UpdateAgentUpdateStateAsync(int agentPoolId, int agentId, string currentState)
|
||||||
{
|
{
|
||||||
CheckConnection(RunnerConnectionType.Generic);
|
CheckConnection(RunnerConnectionType.Generic);
|
||||||
return _genericTaskAgentClient.UpdateAgentUpdateStateAsync(agentPoolId, agentId, currentState, trace);
|
return _genericTaskAgentClient.UpdateAgentUpdateStateAsync(agentPoolId, agentId, currentState);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// Runner Auth Url
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
public Task<string> GetRunnerAuthUrlAsync(int runnerPoolId, int runnerId)
|
||||||
|
{
|
||||||
|
CheckConnection(RunnerConnectionType.MessageQueue);
|
||||||
|
return _messageTaskAgentClient.GetAgentAuthUrlAsync(runnerPoolId, runnerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task ReportRunnerAuthUrlErrorAsync(int runnerPoolId, int runnerId, string error)
|
||||||
|
{
|
||||||
|
CheckConnection(RunnerConnectionType.MessageQueue);
|
||||||
|
return _messageTaskAgentClient.ReportAgentAuthUrlMigrationErrorAsync(runnerPoolId, runnerId, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ namespace GitHub.Runner.Listener
|
|||||||
{
|
{
|
||||||
Constants.Runner.CommandLine.Flags.Check,
|
Constants.Runner.CommandLine.Flags.Check,
|
||||||
Constants.Runner.CommandLine.Flags.Commit,
|
Constants.Runner.CommandLine.Flags.Commit,
|
||||||
Constants.Runner.CommandLine.Flags.DisableUpdate,
|
|
||||||
Constants.Runner.CommandLine.Flags.Ephemeral,
|
Constants.Runner.CommandLine.Flags.Ephemeral,
|
||||||
Constants.Runner.CommandLine.Flags.Help,
|
Constants.Runner.CommandLine.Flags.Help,
|
||||||
Constants.Runner.CommandLine.Flags.Once,
|
Constants.Runner.CommandLine.Flags.Once,
|
||||||
@@ -69,7 +68,6 @@ namespace GitHub.Runner.Listener
|
|||||||
public bool Unattended => TestFlag(Constants.Runner.CommandLine.Flags.Unattended);
|
public bool Unattended => TestFlag(Constants.Runner.CommandLine.Flags.Unattended);
|
||||||
public bool Version => TestFlag(Constants.Runner.CommandLine.Flags.Version);
|
public bool Version => TestFlag(Constants.Runner.CommandLine.Flags.Version);
|
||||||
public bool Ephemeral => TestFlag(Constants.Runner.CommandLine.Flags.Ephemeral);
|
public bool Ephemeral => TestFlag(Constants.Runner.CommandLine.Flags.Ephemeral);
|
||||||
public bool DisableUpdate => TestFlag(Constants.Runner.CommandLine.Flags.DisableUpdate);
|
|
||||||
|
|
||||||
// Keep this around since customers still relies on it
|
// Keep this around since customers still relies on it
|
||||||
public bool RunOnce => TestFlag(Constants.Runner.CommandLine.Flags.Once);
|
public bool RunOnce => TestFlag(Constants.Runner.CommandLine.Flags.Once);
|
||||||
@@ -245,7 +243,6 @@ namespace GitHub.Runner.Listener
|
|||||||
validator: Validators.ServerUrlValidator);
|
validator: Validators.ServerUrlValidator);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OS_WINDOWS
|
|
||||||
public string GetWindowsLogonAccount(string defaultValue, string descriptionMsg)
|
public string GetWindowsLogonAccount(string defaultValue, string descriptionMsg)
|
||||||
{
|
{
|
||||||
return GetArgOrPrompt(
|
return GetArgOrPrompt(
|
||||||
@@ -263,7 +260,7 @@ namespace GitHub.Runner.Listener
|
|||||||
defaultValue: string.Empty,
|
defaultValue: string.Empty,
|
||||||
validator: Validators.NonEmptyValidator);
|
validator: Validators.NonEmptyValidator);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
public string GetWork()
|
public string GetWork()
|
||||||
{
|
{
|
||||||
return GetArgOrPrompt(
|
return GetArgOrPrompt(
|
||||||
|
|||||||
@@ -196,7 +196,6 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
TaskAgent agent;
|
TaskAgent agent;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
runnerSettings.DisableUpdate = command.DisableUpdate;
|
|
||||||
runnerSettings.Ephemeral = command.Ephemeral;
|
runnerSettings.Ephemeral = command.Ephemeral;
|
||||||
runnerSettings.AgentName = command.GetRunnerName();
|
runnerSettings.AgentName = command.GetRunnerName();
|
||||||
|
|
||||||
@@ -214,22 +213,11 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
if (command.GetReplace())
|
if (command.GetReplace())
|
||||||
{
|
{
|
||||||
// Update existing agent with new PublicKey, agent version.
|
// Update existing agent with new PublicKey, agent version.
|
||||||
agent = UpdateExistingAgent(agent, publicKey, userLabels, runnerSettings.Ephemeral, command.DisableUpdate);
|
agent = UpdateExistingAgent(agent, publicKey, userLabels, runnerSettings.Ephemeral);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
agent = await _runnerServer.ReplaceAgentAsync(runnerSettings.PoolId, agent);
|
agent = await _runnerServer.ReplaceAgentAsync(runnerSettings.PoolId, agent);
|
||||||
if (command.DisableUpdate &&
|
|
||||||
command.DisableUpdate != agent.DisableUpdate)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException("The GitHub server does not support configuring a self-hosted runner with 'DisableUpdate' flag.");
|
|
||||||
}
|
|
||||||
if (command.Ephemeral &&
|
|
||||||
command.Ephemeral != agent.Ephemeral)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException("The GitHub server does not support configuring a self-hosted runner with 'Ephemeral' flag.");
|
|
||||||
}
|
|
||||||
|
|
||||||
_term.WriteSuccessMessage("Successfully replaced the runner");
|
_term.WriteSuccessMessage("Successfully replaced the runner");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -248,22 +236,11 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Create a new agent.
|
// Create a new agent.
|
||||||
agent = CreateNewAgent(runnerSettings.AgentName, publicKey, userLabels, runnerSettings.Ephemeral, command.DisableUpdate);
|
agent = CreateNewAgent(runnerSettings.AgentName, publicKey, userLabels, runnerSettings.Ephemeral);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
agent = await _runnerServer.AddAgentAsync(runnerSettings.PoolId, agent);
|
agent = await _runnerServer.AddAgentAsync(runnerSettings.PoolId, agent);
|
||||||
if (command.DisableUpdate &&
|
|
||||||
command.DisableUpdate != agent.DisableUpdate)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException("The GitHub server does not support configuring a self-hosted runner with 'DisableUpdate' flag.");
|
|
||||||
}
|
|
||||||
if (command.Ephemeral &&
|
|
||||||
command.Ephemeral != agent.Ephemeral)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException("The GitHub server does not support configuring a self-hosted runner with 'Ephemeral' flag.");
|
|
||||||
}
|
|
||||||
|
|
||||||
_term.WriteSuccessMessage("Runner successfully added");
|
_term.WriteSuccessMessage("Runner successfully added");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -489,7 +466,7 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private TaskAgent UpdateExistingAgent(TaskAgent agent, RSAParameters publicKey, ISet<string> userLabels, bool ephemeral, bool disableUpdate)
|
private TaskAgent UpdateExistingAgent(TaskAgent agent, RSAParameters publicKey, ISet<string> userLabels, bool ephemeral)
|
||||||
{
|
{
|
||||||
ArgUtil.NotNull(agent, nameof(agent));
|
ArgUtil.NotNull(agent, nameof(agent));
|
||||||
agent.Authorization = new TaskAgentAuthorization
|
agent.Authorization = new TaskAgentAuthorization
|
||||||
@@ -501,7 +478,6 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
agent.Version = BuildConstants.RunnerPackage.Version;
|
agent.Version = BuildConstants.RunnerPackage.Version;
|
||||||
agent.OSDescription = RuntimeInformation.OSDescription;
|
agent.OSDescription = RuntimeInformation.OSDescription;
|
||||||
agent.Ephemeral = ephemeral;
|
agent.Ephemeral = ephemeral;
|
||||||
agent.DisableUpdate = disableUpdate;
|
|
||||||
agent.MaxParallelism = 1;
|
agent.MaxParallelism = 1;
|
||||||
|
|
||||||
agent.Labels.Clear();
|
agent.Labels.Clear();
|
||||||
@@ -518,7 +494,7 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TaskAgent CreateNewAgent(string agentName, RSAParameters publicKey, ISet<string> userLabels, bool ephemeral, bool disableUpdate)
|
private TaskAgent CreateNewAgent(string agentName, RSAParameters publicKey, ISet<string> userLabels, bool ephemeral)
|
||||||
{
|
{
|
||||||
TaskAgent agent = new TaskAgent(agentName)
|
TaskAgent agent = new TaskAgent(agentName)
|
||||||
{
|
{
|
||||||
@@ -530,7 +506,6 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
Version = BuildConstants.RunnerPackage.Version,
|
Version = BuildConstants.RunnerPackage.Version,
|
||||||
OSDescription = RuntimeInformation.OSDescription,
|
OSDescription = RuntimeInformation.OSDescription,
|
||||||
Ephemeral = ephemeral,
|
Ephemeral = ephemeral,
|
||||||
DisableUpdate = disableUpdate
|
|
||||||
};
|
};
|
||||||
|
|
||||||
agent.Labels.Add(new AgentLabel("self-hosted", LabelType.System));
|
agent.Labels.Add(new AgentLabel("self-hosted", LabelType.System));
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
#pragma warning disable CA1416
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -142,7 +141,7 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
Trace.Entering();
|
Trace.Entering();
|
||||||
LocalGroupInfo groupInfo = new LocalGroupInfo();
|
LocalGroupInfo groupInfo = new LocalGroupInfo();
|
||||||
groupInfo.Name = groupName;
|
groupInfo.Name = groupName;
|
||||||
groupInfo.Comment = StringUtil.Format("Built-in group used by GitHub Actions Runner.");
|
groupInfo.Comment = StringUtil.Format("Built-in group used by Team Foundation Server.");
|
||||||
|
|
||||||
int returnCode = NetLocalGroupAdd(null, // computer name
|
int returnCode = NetLocalGroupAdd(null, // computer name
|
||||||
1, // 1 means include comment
|
1, // 1 means include comment
|
||||||
@@ -1328,5 +1327,4 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
public IntPtr hProfile;
|
public IntPtr hProfile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma warning restore CA1416
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
return !string.IsNullOrEmpty(value);
|
return !string.IsNullOrEmpty(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OS_WINDOWS
|
|
||||||
#pragma warning disable CA1416
|
|
||||||
public static bool NTAccountValidator(string arg)
|
public static bool NTAccountValidator(string arg)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(arg) || String.IsNullOrEmpty(arg.TrimStart('.', '\\')))
|
if (string.IsNullOrEmpty(arg) || String.IsNullOrEmpty(arg.TrimStart('.', '\\')))
|
||||||
@@ -89,7 +87,5 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#pragma warning restore CA1416
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
#pragma warning disable CA1416
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -170,5 +169,4 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma warning restore CA1416
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2,19 +2,17 @@ using System;
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using GitHub.DistributedTask.WebApi;
|
using GitHub.DistributedTask.WebApi;
|
||||||
using GitHub.Runner.Common;
|
|
||||||
using GitHub.Runner.Common.Util;
|
using GitHub.Runner.Common.Util;
|
||||||
using GitHub.Runner.Sdk;
|
|
||||||
using GitHub.Services.Common;
|
|
||||||
using GitHub.Services.WebApi;
|
using GitHub.Services.WebApi;
|
||||||
using GitHub.Services.WebApi.Jwt;
|
|
||||||
using Pipelines = GitHub.DistributedTask.Pipelines;
|
using Pipelines = GitHub.DistributedTask.Pipelines;
|
||||||
|
using System.Linq;
|
||||||
|
using GitHub.Services.Common;
|
||||||
|
using GitHub.Runner.Common;
|
||||||
|
using GitHub.Runner.Sdk;
|
||||||
|
using GitHub.Services.WebApi.Jwt;
|
||||||
|
|
||||||
namespace GitHub.Runner.Listener
|
namespace GitHub.Runner.Listener
|
||||||
{
|
{
|
||||||
@@ -36,7 +34,6 @@ namespace GitHub.Runner.Listener
|
|||||||
// and the server will not send another job while this one is still running.
|
// and the server will not send another job while this one is still running.
|
||||||
public sealed class JobDispatcher : RunnerService, IJobDispatcher
|
public sealed class JobDispatcher : RunnerService, IJobDispatcher
|
||||||
{
|
{
|
||||||
private static Regex _invalidJsonRegex = new Regex(@"invalid\ Json\ at\ position\ '(\d+)':", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
||||||
private readonly Lazy<Dictionary<long, TaskResult>> _localRunJobResult = new Lazy<Dictionary<long, TaskResult>>();
|
private readonly Lazy<Dictionary<long, TaskResult>> _localRunJobResult = new Lazy<Dictionary<long, TaskResult>>();
|
||||||
private int _poolId;
|
private int _poolId;
|
||||||
|
|
||||||
@@ -967,30 +964,6 @@ namespace GitHub.Runner.Listener
|
|||||||
TimelineRecord jobRecord = timeline.Records.FirstOrDefault(x => x.Id == message.JobId && x.RecordType == "Job");
|
TimelineRecord jobRecord = timeline.Records.FirstOrDefault(x => x.Id == message.JobId && x.RecordType == "Job");
|
||||||
ArgUtil.NotNull(jobRecord, nameof(jobRecord));
|
ArgUtil.NotNull(jobRecord, nameof(jobRecord));
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(errorMessage) &&
|
|
||||||
message.Variables.TryGetValue("DistributedTask.EnableRunnerIPCDebug", out var enableRunnerIPCDebug) &&
|
|
||||||
StringUtil.ConvertToBoolean(enableRunnerIPCDebug.Value))
|
|
||||||
{
|
|
||||||
// the trace should be best effort and not affect any job result
|
|
||||||
var match = _invalidJsonRegex.Match(errorMessage);
|
|
||||||
if (match.Success &&
|
|
||||||
match.Groups.Count == 2)
|
|
||||||
{
|
|
||||||
var jsonPosition = int.Parse(match.Groups[1].Value);
|
|
||||||
var serializedJobMessage = JsonUtility.ToString(message);
|
|
||||||
var originalJson = serializedJobMessage.Substring(jsonPosition - 10, 20);
|
|
||||||
errorMessage = $"Runner sent Json at position '{jsonPosition}': {originalJson} ({Convert.ToBase64String(Encoding.UTF8.GetBytes(originalJson))})\n{errorMessage}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Trace.Error(ex);
|
|
||||||
errorMessage = $"Fail to check json IPC error: {ex.Message}\n{errorMessage}";
|
|
||||||
}
|
|
||||||
|
|
||||||
var unhandledExceptionIssue = new Issue() { Type = IssueType.Error, Message = errorMessage };
|
var unhandledExceptionIssue = new Issue() { Type = IssueType.Error, Message = errorMessage };
|
||||||
unhandledExceptionIssue.Data[Constants.Runner.InternalTelemetryIssueDataKey] = Constants.Runner.WorkerCrash;
|
unhandledExceptionIssue.Data[Constants.Runner.InternalTelemetryIssueDataKey] = Constants.Runner.WorkerCrash;
|
||||||
jobRecord.ErrorCount++;
|
jobRecord.ErrorCount++;
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;linux-musl-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
|
<AssetTargetFallback>portable-net45+win8</AssetTargetFallback>
|
||||||
<NoWarn>NU1701;NU1603</NoWarn>
|
<NoWarn>NU1701;NU1603</NoWarn>
|
||||||
<Version>$(Version)</Version>
|
<Version>$(Version)</Version>
|
||||||
<PredefinedCulturesOnly>false</PredefinedCulturesOnly>
|
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
|
||||||
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -25,12 +25,6 @@
|
|||||||
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.4.0" />
|
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="..\Misc\runnercoreassets">
|
|
||||||
<LogicalName>GitHub.Runner.Listener.runnercoreassets</LogicalName>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<DebugType>portable</DebugType>
|
<DebugType>portable</DebugType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -425,7 +425,6 @@ namespace GitHub.Runner.Listener
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Trace.Info($"Received job message of length {message.Body.Length} from service, with hash '{IOUtil.GetSha256Hash(message.Body)}'");
|
|
||||||
var jobMessage = StringUtil.ConvertFromJson<Pipelines.AgentJobRequestMessage>(message.Body);
|
var jobMessage = StringUtil.ConvertFromJson<Pipelines.AgentJobRequestMessage>(message.Body);
|
||||||
jobDispatcher.Run(jobMessage, runOnce);
|
jobDispatcher.Run(jobMessage, runOnce);
|
||||||
if (runOnce)
|
if (runOnce)
|
||||||
@@ -540,7 +539,6 @@ Config Options:
|
|||||||
--work string Relative runner work directory (default {Constants.Path.WorkDirectory})
|
--work string Relative runner work directory (default {Constants.Path.WorkDirectory})
|
||||||
--replace Replace any existing runner with the same name (default false)
|
--replace Replace any existing runner with the same name (default false)
|
||||||
--pat GitHub personal access token used for checking network connectivity when executing `.{separator}run.{ext} --check`
|
--pat GitHub personal access token used for checking network connectivity when executing `.{separator}run.{ext} --check`
|
||||||
--disableupdate Disable self-hosted runner automatic update to the latest released version`
|
|
||||||
--ephemeral Configure the runner to only take one job and then let the service un-configure the runner after the job finishes (default false)");
|
--ephemeral Configure the runner to only take one job and then let the service un-configure the runner after the job finishes (default false)");
|
||||||
|
|
||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
@@ -548,7 +546,7 @@ Config Options:
|
|||||||
_term.WriteLine($@" --windowslogonaccount string Account to run the service as. Requires runasservice");
|
_term.WriteLine($@" --windowslogonaccount string Account to run the service as. Requires runasservice");
|
||||||
_term.WriteLine($@" --windowslogonpassword string Password for the service account. Requires runasservice");
|
_term.WriteLine($@" --windowslogonpassword string Password for the service account. Requires runasservice");
|
||||||
#endif
|
#endif
|
||||||
_term.WriteLine($@"
|
_term.WriteLine($@"
|
||||||
Examples:
|
Examples:
|
||||||
Check GitHub server network connectivity:
|
Check GitHub server network connectivity:
|
||||||
.{separator}run.{ext} --check --url <url> --pat <pat>
|
.{separator}run.{ext} --check --url <url> --pat <pat>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;linux-musl-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
|
<AssetTargetFallback>portable-net45+win8</AssetTargetFallback>
|
||||||
<NoWarn>NU1701;NU1603</NoWarn>
|
<NoWarn>NU1701;NU1603</NoWarn>
|
||||||
<Version>$(Version)</Version>
|
<Version>$(Version)</Version>
|
||||||
<PredefinedCulturesOnly>false</PredefinedCulturesOnly>
|
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
|
||||||
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ namespace GitHub.Runner.Plugins.Artifact
|
|||||||
{
|
{
|
||||||
// We should never
|
// We should never
|
||||||
context.Error($"Error '{ex.Message}' when downloading file '{fileToDownload}'. (Downloader {downloaderId})");
|
context.Error($"Error '{ex.Message}' when downloading file '{fileToDownload}'. (Downloader {downloaderId})");
|
||||||
throw;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,7 +469,7 @@ namespace GitHub.Runner.Plugins.Artifact
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
uploadTimer.Restart();
|
uploadTimer.Restart();
|
||||||
using (HttpResponseMessage response = await _fileContainerHttpClient.UploadFileAsync(_containerId, itemPath, fs, _projectId, cancellationToken: token))
|
using (HttpResponseMessage response = await _fileContainerHttpClient.UploadFileAsync(_containerId, itemPath, fs, _projectId, cancellationToken: token, chunkSize: 4 * 1024 * 1024))
|
||||||
{
|
{
|
||||||
if (response == null || response.StatusCode != HttpStatusCode.Created)
|
if (response == null || response.StatusCode != HttpStatusCode.Created)
|
||||||
{
|
{
|
||||||
@@ -528,7 +528,7 @@ namespace GitHub.Runner.Plugins.Artifact
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
context.Output($"File error '{ex.Message}' when uploading file '{fileToUpload}'.");
|
context.Output($"File error '{ex.Message}' when uploading file '{fileToUpload}'.");
|
||||||
throw;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;linux-musl-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
|
<AssetTargetFallback>portable-net45+win8</AssetTargetFallback>
|
||||||
<NoWarn>NU1701;NU1603</NoWarn>
|
<NoWarn>NU1701;NU1603</NoWarn>
|
||||||
<Version>$(Version)</Version>
|
<Version>$(Version)</Version>
|
||||||
|
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;linux-musl-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
|
<AssetTargetFallback>portable-net45+win8</AssetTargetFallback>
|
||||||
<NoWarn>NU1701;NU1603</NoWarn>
|
<NoWarn>NU1701;NU1603</NoWarn>
|
||||||
<Version>$(Version)</Version>
|
<Version>$(Version)</Version>
|
||||||
|
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -27,11 +27,6 @@ namespace GitHub.Runner.Sdk
|
|||||||
|
|
||||||
VssClientHttpRequestSettings.Default.UserAgent = headerValues;
|
VssClientHttpRequestSettings.Default.UserAgent = headerValues;
|
||||||
VssHttpMessageHandler.DefaultWebProxy = proxy;
|
VssHttpMessageHandler.DefaultWebProxy = proxy;
|
||||||
|
|
||||||
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
|
|
||||||
{
|
|
||||||
VssClientHttpRequestSettings.Default.ServerCertificateValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static VssConnection CreateConnection(Uri serverUri, VssCredentials credentials, IEnumerable<DelegatingHandler> additionalDelegatingHandler = null, TimeSpan? timeout = null)
|
public static VssConnection CreateConnection(Uri serverUri, VssCredentials credentials, IEnumerable<DelegatingHandler> additionalDelegatingHandler = null, TimeSpan? timeout = null)
|
||||||
|
|||||||
@@ -381,13 +381,6 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
HostContext.SecretMasker.AddValue(command.Data);
|
HostContext.SecretMasker.AddValue(command.Data);
|
||||||
Trace.Info($"Add new secret mask with length of {command.Data.Length}");
|
Trace.Info($"Add new secret mask with length of {command.Data.Length}");
|
||||||
|
|
||||||
// Also add each individual line. Typically individual lines are processed from STDOUT of child processes.
|
|
||||||
var split = command.Data.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
|
||||||
foreach (var item in split)
|
|
||||||
{
|
|
||||||
HostContext.SecretMasker.AddValue(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
for (var i = 0; i < compositeAction.Steps.Count; i++)
|
for (var i = 0; i < compositeAction.Steps.Count; i++)
|
||||||
{
|
{
|
||||||
// Load stored Ids for later load actions
|
// Store Id's for later load actions
|
||||||
compositeAction.Steps[i].Id = _cachedEmbeddedStepIds[action.Id][i];
|
compositeAction.Steps[i].Id = _cachedEmbeddedStepIds[action.Id][i];
|
||||||
if (string.IsNullOrEmpty(executionContext.Global.Variables.Get("DistributedTask.EnableCompositeActions")) && compositeAction.Steps[i].Reference.Type != Pipelines.ActionSourceType.Script)
|
if (string.IsNullOrEmpty(executionContext.Global.Variables.Get("DistributedTask.EnableCompositeActions")) && compositeAction.Steps[i].Reference.Type != Pipelines.ActionSourceType.Script)
|
||||||
{
|
{
|
||||||
@@ -451,16 +451,6 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_cachedEmbeddedStepIds[action.Id] = new List<Guid>();
|
|
||||||
foreach (var compositeStep in compositeAction.Steps)
|
|
||||||
{
|
|
||||||
var guid = Guid.NewGuid();
|
|
||||||
compositeStep.Id = guid;
|
|
||||||
_cachedEmbeddedStepIds[action.Id].Add(guid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,14 +55,12 @@ namespace GitHub.Runner.Worker
|
|||||||
// Our container feature requires to map working directory from host to the container.
|
// Our container feature requires to map working directory from host to the container.
|
||||||
// If we are already inside a container, we will not able to find out the real working direcotry path on the host.
|
// If we are already inside a container, we will not able to find out the real working direcotry path on the host.
|
||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
#pragma warning disable CA1416
|
|
||||||
// service CExecSvc is Container Execution Agent.
|
// service CExecSvc is Container Execution Agent.
|
||||||
ServiceController[] scServices = ServiceController.GetServices();
|
ServiceController[] scServices = ServiceController.GetServices();
|
||||||
if (scServices.Any(x => String.Equals(x.ServiceName, "cexecsvc", StringComparison.OrdinalIgnoreCase) && x.Status == ServiceControllerStatus.Running))
|
if (scServices.Any(x => String.Equals(x.ServiceName, "cexecsvc", StringComparison.OrdinalIgnoreCase) && x.Status == ServiceControllerStatus.Running))
|
||||||
{
|
{
|
||||||
throw new NotSupportedException("Container feature is not supported when runner is already running inside container.");
|
throw new NotSupportedException("Container feature is not supported when runner is already running inside container.");
|
||||||
}
|
}
|
||||||
#pragma warning restore CA1416
|
|
||||||
#else
|
#else
|
||||||
var initProcessCgroup = File.ReadLines("/proc/1/cgroup");
|
var initProcessCgroup = File.ReadLines("/proc/1/cgroup");
|
||||||
if (initProcessCgroup.Any(x => x.IndexOf(":/docker/", StringComparison.OrdinalIgnoreCase) >= 0))
|
if (initProcessCgroup.Any(x => x.IndexOf(":/docker/", StringComparison.OrdinalIgnoreCase) >= 0))
|
||||||
@@ -72,7 +70,6 @@ namespace GitHub.Runner.Worker
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
#pragma warning disable CA1416
|
|
||||||
// Check OS version (Windows server 1803 is required)
|
// Check OS version (Windows server 1803 is required)
|
||||||
object windowsInstallationType = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallationType", defaultValue: null);
|
object windowsInstallationType = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallationType", defaultValue: null);
|
||||||
ArgUtil.NotNull(windowsInstallationType, nameof(windowsInstallationType));
|
ArgUtil.NotNull(windowsInstallationType, nameof(windowsInstallationType));
|
||||||
@@ -91,7 +88,6 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
throw new ArgumentOutOfRangeException(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId");
|
throw new ArgumentOutOfRangeException(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId");
|
||||||
}
|
}
|
||||||
#pragma warning restore CA1416
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check docker client/server version
|
// Check docker client/server version
|
||||||
@@ -338,18 +334,6 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(container.ContainerId))
|
if (!string.IsNullOrEmpty(container.ContainerId))
|
||||||
{
|
{
|
||||||
if(!container.IsJobContainer)
|
|
||||||
{
|
|
||||||
// Print logs for service container jobs (not the "action" job itself b/c that's already logged).
|
|
||||||
executionContext.Output($"Print service container logs: {container.ContainerDisplayName}");
|
|
||||||
|
|
||||||
int logsExitCode = await _dockerManager.DockerLogs(executionContext, container.ContainerId);
|
|
||||||
if (logsExitCode != 0)
|
|
||||||
{
|
|
||||||
executionContext.Warning($"Docker logs fail with exit code {logsExitCode}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
executionContext.Output($"Stop and remove container: {container.ContainerDisplayName}");
|
executionContext.Output($"Stop and remove container: {container.ContainerDisplayName}");
|
||||||
|
|
||||||
int rmExitCode = await _dockerManager.DockerRemove(executionContext, container.ContainerId);
|
int rmExitCode = await _dockerManager.DockerRemove(executionContext, container.ContainerId);
|
||||||
|
|||||||
@@ -378,14 +378,14 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
{
|
{
|
||||||
// Condition is false
|
// Condition is false
|
||||||
Trace.Info("Skipping step due to condition evaluation.");
|
Trace.Info("Skipping step due to condition evaluation.");
|
||||||
SetStepConclusion(step, TaskResult.Skipped);
|
step.ExecutionContext.Result = TaskResult.Skipped;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (conditionEvaluateError != null)
|
else if (conditionEvaluateError != null)
|
||||||
{
|
{
|
||||||
// Condition error
|
// Condition error
|
||||||
step.ExecutionContext.Error(conditionEvaluateError);
|
step.ExecutionContext.Error(conditionEvaluateError);
|
||||||
SetStepConclusion(step, TaskResult.Failed);
|
step.ExecutionContext.Result = TaskResult.Failed;
|
||||||
ExecutionContext.Result = TaskResult.Failed;
|
ExecutionContext.Result = TaskResult.Failed;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -403,15 +403,13 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
jobCancelRegister = null;
|
jobCancelRegister = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check failed or canceled
|
// Check failed or canceled
|
||||||
if (step.ExecutionContext.Result == TaskResult.Failed || step.ExecutionContext.Result == TaskResult.Canceled)
|
if (step.ExecutionContext.Result == TaskResult.Failed || step.ExecutionContext.Result == TaskResult.Canceled)
|
||||||
{
|
{
|
||||||
Trace.Info($"Update job result with current composite step result '{step.ExecutionContext.Result}'.");
|
Trace.Info($"Update job result with current composite step result '{step.ExecutionContext.Result}'.");
|
||||||
ExecutionContext.Result = TaskResultUtil.MergeTaskResults(ExecutionContext.Result, step.ExecutionContext.Result.Value);
|
ExecutionContext.Result = TaskResultUtil.MergeTaskResults(ExecutionContext.Result, step.ExecutionContext.Result.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update context
|
|
||||||
SetStepsContext(step);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,13 +431,13 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
{
|
{
|
||||||
Trace.Error($"Caught timeout exception from step: {ex.Message}");
|
Trace.Error($"Caught timeout exception from step: {ex.Message}");
|
||||||
step.ExecutionContext.Error("The action has timed out.");
|
step.ExecutionContext.Error("The action has timed out.");
|
||||||
SetStepConclusion(step, TaskResult.Failed);
|
step.ExecutionContext.Result = TaskResult.Failed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Trace.Error($"Caught cancellation exception from step: {ex}");
|
Trace.Error($"Caught cancellation exception from step: {ex}");
|
||||||
step.ExecutionContext.Error(ex);
|
step.ExecutionContext.Error(ex);
|
||||||
SetStepConclusion(step, TaskResult.Canceled);
|
step.ExecutionContext.Result = TaskResult.Canceled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -447,32 +445,17 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
// Log the error and fail the step
|
// Log the error and fail the step
|
||||||
Trace.Error($"Caught exception from step: {ex}");
|
Trace.Error($"Caught exception from step: {ex}");
|
||||||
step.ExecutionContext.Error(ex);
|
step.ExecutionContext.Error(ex);
|
||||||
SetStepConclusion(step, TaskResult.Failed);
|
step.ExecutionContext.Result = TaskResult.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge execution context result with command result
|
// Merge execution context result with command result
|
||||||
if (step.ExecutionContext.CommandResult != null)
|
if (step.ExecutionContext.CommandResult != null)
|
||||||
{
|
{
|
||||||
SetStepConclusion(step, Common.Util.TaskResultUtil.MergeTaskResults(step.ExecutionContext.Result, step.ExecutionContext.CommandResult.Value));
|
step.ExecutionContext.Result = Common.Util.TaskResultUtil.MergeTaskResults(step.ExecutionContext.Result, step.ExecutionContext.CommandResult.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Trace.Info($"Step result: {step.ExecutionContext.Result}");
|
Trace.Info($"Step result: {step.ExecutionContext.Result}");
|
||||||
step.ExecutionContext.Debug($"Finished: {step.DisplayName}");
|
step.ExecutionContext.Debug($"Finished: {step.DisplayName}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetStepConclusion(IStep step, TaskResult result)
|
|
||||||
{
|
|
||||||
step.ExecutionContext.Result = result;
|
|
||||||
SetStepsContext(step);
|
|
||||||
}
|
|
||||||
private void SetStepsContext(IStep step)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(step.ExecutionContext.ContextName) && !step.ExecutionContext.ContextName.StartsWith("__", StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
// TODO: when we support continue on error, we may need to do logic here to change conclusion based on the continue on error result
|
|
||||||
step.ExecutionContext.Global.StepsContext.SetOutcome(step.ExecutionContext.ScopeName, step.ExecutionContext.ContextName, (step.ExecutionContext.Result ?? TaskResult.Succeeded).ToActionResult());
|
|
||||||
step.ExecutionContext.Global.StepsContext.SetConclusion(step.ExecutionContext.ScopeName, step.ExecutionContext.ContextName, (step.ExecutionContext.Result ?? TaskResult.Succeeded).ToActionResult());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
context.Output($"##[group]GITHUB_TOKEN Permissions");
|
context.Output($"##[group]GITHUB_TOKEN Permissions");
|
||||||
var permissions = StringUtil.ConvertFromJson<Dictionary<string, string>>(tokenPermissions);
|
var permissions = StringUtil.ConvertFromJson<Dictionary<string, string>>(tokenPermissions);
|
||||||
foreach (KeyValuePair<string, string> entry in permissions)
|
foreach(KeyValuePair<string, string> entry in permissions)
|
||||||
{
|
{
|
||||||
context.Output($"{entry.Key}: {entry.Value}");
|
context.Output($"{entry.Key}: {entry.Value}");
|
||||||
}
|
}
|
||||||
@@ -142,12 +142,6 @@ namespace GitHub.Runner.Worker
|
|||||||
Trace.Error(ex);
|
Trace.Error(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
var secretSource = context.GetGitHubContext("secret_source");
|
|
||||||
if (!string.IsNullOrEmpty(secretSource))
|
|
||||||
{
|
|
||||||
context.Output($"Secret source: {secretSource}");
|
|
||||||
}
|
|
||||||
|
|
||||||
var repoFullName = context.GetGitHubContext("repository");
|
var repoFullName = context.GetGitHubContext("repository");
|
||||||
ArgUtil.NotNull(repoFullName, nameof(repoFullName));
|
ArgUtil.NotNull(repoFullName, nameof(repoFullName));
|
||||||
context.Debug($"Primary repository: {repoFullName}");
|
context.Debug($"Primary repository: {repoFullName}");
|
||||||
@@ -312,7 +306,7 @@ namespace GitHub.Runner.Worker
|
|||||||
JobExtensionRunner extensionStep = step as JobExtensionRunner;
|
JobExtensionRunner extensionStep = step as JobExtensionRunner;
|
||||||
ArgUtil.NotNull(extensionStep, extensionStep.DisplayName);
|
ArgUtil.NotNull(extensionStep, extensionStep.DisplayName);
|
||||||
Guid stepId = Guid.NewGuid();
|
Guid stepId = Guid.NewGuid();
|
||||||
extensionStep.ExecutionContext = jobContext.CreateChild(stepId, extensionStep.DisplayName, stepId.ToString("N"), null, stepId.ToString("N"), ActionRunStage.Pre);
|
extensionStep.ExecutionContext = jobContext.CreateChild(stepId, extensionStep.DisplayName, null, null, stepId.ToString("N"), ActionRunStage.Pre);
|
||||||
}
|
}
|
||||||
else if (step is IActionRunner actionStep)
|
else if (step is IActionRunner actionStep)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
using System;
|
using GitHub.DistributedTask.WebApi;
|
||||||
|
using Pipelines = GitHub.DistributedTask.Pipelines;
|
||||||
|
using GitHub.Runner.Common.Util;
|
||||||
|
using GitHub.Services.Common;
|
||||||
|
using GitHub.Services.WebApi;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using GitHub.DistributedTask.WebApi;
|
using System.Net.Http;
|
||||||
using GitHub.Runner.Common;
|
using GitHub.Runner.Common;
|
||||||
using GitHub.Runner.Common.Util;
|
|
||||||
using GitHub.Runner.Sdk;
|
using GitHub.Runner.Sdk;
|
||||||
using GitHub.Services.Common;
|
|
||||||
using GitHub.Services.WebApi;
|
|
||||||
using Pipelines = GitHub.DistributedTask.Pipelines;
|
|
||||||
|
|
||||||
namespace GitHub.Runner.Worker
|
namespace GitHub.Runner.Worker
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,6 @@ namespace GitHub.Runner.Worker
|
|||||||
public sealed class JobRunner : RunnerService, IJobRunner
|
public sealed class JobRunner : RunnerService, IJobRunner
|
||||||
{
|
{
|
||||||
private IJobServerQueue _jobServerQueue;
|
private IJobServerQueue _jobServerQueue;
|
||||||
private RunnerSettings _runnerSettings;
|
|
||||||
private ITempDirectoryManager _tempDirectoryManager;
|
private ITempDirectoryManager _tempDirectoryManager;
|
||||||
|
|
||||||
public async Task<TaskResult> RunAsync(Pipelines.AgentJobRequestMessage message, CancellationToken jobRequestCancellationToken)
|
public async Task<TaskResult> RunAsync(Pipelines.AgentJobRequestMessage message, CancellationToken jobRequestCancellationToken)
|
||||||
@@ -109,8 +108,8 @@ namespace GitHub.Runner.Worker
|
|||||||
jobContext.SetRunnerContext("os", VarUtil.OS);
|
jobContext.SetRunnerContext("os", VarUtil.OS);
|
||||||
jobContext.SetRunnerContext("arch", VarUtil.OSArchitecture);
|
jobContext.SetRunnerContext("arch", VarUtil.OSArchitecture);
|
||||||
|
|
||||||
_runnerSettings = HostContext.GetService<IConfigurationStore>().GetSettings();
|
var runnerSettings = HostContext.GetService<IConfigurationStore>().GetSettings();
|
||||||
jobContext.SetRunnerContext("name", _runnerSettings.AgentName);
|
jobContext.SetRunnerContext("name", runnerSettings.AgentName);
|
||||||
|
|
||||||
string toolsDirectory = HostContext.GetDirectory(WellKnownDirectory.Tools);
|
string toolsDirectory = HostContext.GetDirectory(WellKnownDirectory.Tools);
|
||||||
Directory.CreateDirectory(toolsDirectory);
|
Directory.CreateDirectory(toolsDirectory);
|
||||||
@@ -210,53 +209,6 @@ namespace GitHub.Runner.Worker
|
|||||||
jobContext.Debug($"Finishing: {message.JobDisplayName}");
|
jobContext.Debug($"Finishing: {message.JobDisplayName}");
|
||||||
TaskResult result = jobContext.Complete(taskResult);
|
TaskResult result = jobContext.Complete(taskResult);
|
||||||
|
|
||||||
if (_runnerSettings.DisableUpdate == true)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var currentVersion = new PackageVersion(BuildConstants.RunnerPackage.Version);
|
|
||||||
ServiceEndpoint systemConnection = message.Resources.Endpoints.Single(x => string.Equals(x.Name, WellKnownServiceEndpointNames.SystemVssConnection, StringComparison.OrdinalIgnoreCase));
|
|
||||||
VssCredentials serverCredential = VssUtil.GetVssCredential(systemConnection);
|
|
||||||
|
|
||||||
var runnerServer = HostContext.GetService<IRunnerServer>();
|
|
||||||
await runnerServer.ConnectAsync(systemConnection.Url, serverCredential);
|
|
||||||
var serverPackages = await runnerServer.GetPackagesAsync("agent", BuildConstants.RunnerPackage.PackageName, 5, includeToken: false, cancellationToken: CancellationToken.None);
|
|
||||||
if (serverPackages.Count > 0)
|
|
||||||
{
|
|
||||||
serverPackages = serverPackages.OrderByDescending(x => x.Version).ToList();
|
|
||||||
Trace.Info($"Newer packages {StringUtil.ConvertToJson(serverPackages.Select(x => x.Version.ToString()))}");
|
|
||||||
|
|
||||||
var warnOnFailedJob = false; // any minor/patch version behind.
|
|
||||||
var warnOnOldRunnerVersion = false; // >= 2 minor version behind
|
|
||||||
if (serverPackages.Any(x => x.Version.CompareTo(currentVersion) > 0))
|
|
||||||
{
|
|
||||||
Trace.Info($"Current runner version {currentVersion} is behind the latest runner version {serverPackages[0].Version}.");
|
|
||||||
warnOnFailedJob = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (serverPackages.Where(x => x.Version.Major == currentVersion.Major && x.Version.Minor > currentVersion.Minor).Count() > 1)
|
|
||||||
{
|
|
||||||
Trace.Info($"Current runner version {currentVersion} is way behind the latest runner version {serverPackages[0].Version}.");
|
|
||||||
warnOnOldRunnerVersion = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == TaskResult.Failed && warnOnFailedJob)
|
|
||||||
{
|
|
||||||
jobContext.Warning($"This job failure may be caused by using an out of date self-hosted runner. You are currently using runner version {currentVersion}. Please update to the latest version {serverPackages[0].Version}");
|
|
||||||
}
|
|
||||||
else if (warnOnOldRunnerVersion)
|
|
||||||
{
|
|
||||||
jobContext.Warning($"This self-hosted runner is currently using runner version {currentVersion}. This version is out of date. Please update to the latest version {serverPackages[0].Version}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
// Ignore any error since suggest runner update is best effort.
|
|
||||||
Trace.Error($"Caught exception during runner version check: {ex}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ShutdownQueue(throwOnFailure: true);
|
await ShutdownQueue(throwOnFailure: true);
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;linux-musl-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
|
<AssetTargetFallback>portable-net45+win8</AssetTargetFallback>
|
||||||
<NoWarn>NU1701;NU1603</NoWarn>
|
<NoWarn>NU1701;NU1603</NoWarn>
|
||||||
<Version>$(Version)</Version>
|
<Version>$(Version)</Version>
|
||||||
<PredefinedCulturesOnly>false</PredefinedCulturesOnly>
|
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
|
||||||
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ using System.Threading.Tasks;
|
|||||||
using GitHub.Services.WebApi;
|
using GitHub.Services.WebApi;
|
||||||
using GitHub.Runner.Common;
|
using GitHub.Runner.Common;
|
||||||
using GitHub.Runner.Sdk;
|
using GitHub.Runner.Sdk;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace GitHub.Runner.Worker
|
namespace GitHub.Runner.Worker
|
||||||
{
|
{
|
||||||
@@ -25,11 +24,10 @@ namespace GitHub.Runner.Worker
|
|||||||
private ManualResetEvent _completedCommand = new ManualResetEvent(false);
|
private ManualResetEvent _completedCommand = new ManualResetEvent(false);
|
||||||
|
|
||||||
// Do not mask the values of these secrets
|
// Do not mask the values of these secrets
|
||||||
private static HashSet<String> SecretVariableMaskWhitelist = new HashSet<String>(StringComparer.OrdinalIgnoreCase)
|
private static HashSet<String> SecretVariableMaskWhitelist = new HashSet<String>(StringComparer.OrdinalIgnoreCase){
|
||||||
{
|
|
||||||
Constants.Variables.Actions.StepDebug,
|
Constants.Variables.Actions.StepDebug,
|
||||||
Constants.Variables.Actions.RunnerDebug
|
Constants.Variables.Actions.RunnerDebug
|
||||||
};
|
};
|
||||||
|
|
||||||
public async Task<int> RunAsync(string pipeIn, string pipeOut)
|
public async Task<int> RunAsync(string pipeIn, string pipeOut)
|
||||||
{
|
{
|
||||||
@@ -44,7 +42,6 @@ namespace GitHub.Runner.Worker
|
|||||||
ArgUtil.NotNullOrEmpty(pipeOut, nameof(pipeOut));
|
ArgUtil.NotNullOrEmpty(pipeOut, nameof(pipeOut));
|
||||||
VssUtil.InitializeVssClientSettings(HostContext.UserAgents, HostContext.WebProxy);
|
VssUtil.InitializeVssClientSettings(HostContext.UserAgents, HostContext.WebProxy);
|
||||||
var jobRunner = HostContext.CreateService<IJobRunner>();
|
var jobRunner = HostContext.CreateService<IJobRunner>();
|
||||||
var terminal = HostContext.GetService<ITerminal>();
|
|
||||||
|
|
||||||
using (var channel = HostContext.CreateService<IProcessChannel>())
|
using (var channel = HostContext.CreateService<IProcessChannel>())
|
||||||
using (var jobRequestCancellationToken = CancellationTokenSource.CreateLinkedTokenSource(HostContext.RunnerShutdownToken))
|
using (var jobRequestCancellationToken = CancellationTokenSource.CreateLinkedTokenSource(HostContext.RunnerShutdownToken))
|
||||||
@@ -66,22 +63,7 @@ namespace GitHub.Runner.Worker
|
|||||||
Trace.Info("Message received.");
|
Trace.Info("Message received.");
|
||||||
ArgUtil.Equal(MessageType.NewJobRequest, channelMessage.MessageType, nameof(channelMessage.MessageType));
|
ArgUtil.Equal(MessageType.NewJobRequest, channelMessage.MessageType, nameof(channelMessage.MessageType));
|
||||||
ArgUtil.NotNullOrEmpty(channelMessage.Body, nameof(channelMessage.Body));
|
ArgUtil.NotNullOrEmpty(channelMessage.Body, nameof(channelMessage.Body));
|
||||||
Pipelines.AgentJobRequestMessage jobMessage = null;
|
var jobMessage = StringUtil.ConvertFromJson<Pipelines.AgentJobRequestMessage>(channelMessage.Body);
|
||||||
try
|
|
||||||
{
|
|
||||||
jobMessage = StringUtil.ConvertFromJson<Pipelines.AgentJobRequestMessage>(channelMessage.Body);
|
|
||||||
}
|
|
||||||
catch (JsonReaderException ex)
|
|
||||||
{
|
|
||||||
if (channelMessage.Body.Length > ex.LinePosition + 10)
|
|
||||||
{
|
|
||||||
var errorChunk = channelMessage.Body.Substring(ex.LinePosition - 10, 20);
|
|
||||||
terminal.WriteError($"Worker received invalid Json at position '{ex.LinePosition}': {errorChunk} ({Convert.ToBase64String(Encoding.UTF8.GetBytes(errorChunk))})");
|
|
||||||
}
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
ArgUtil.NotNull(jobMessage, nameof(jobMessage));
|
ArgUtil.NotNull(jobMessage, nameof(jobMessage));
|
||||||
HostContext.WritePerfCounter($"WorkerJobMessageReceived_{jobMessage.RequestId.ToString()}");
|
HostContext.WritePerfCounter($"WorkerJobMessageReceived_{jobMessage.RequestId.ToString()}");
|
||||||
|
|
||||||
@@ -156,10 +138,10 @@ namespace GitHub.Runner.Worker
|
|||||||
HostContext.SecretMasker.AddValue(value);
|
HostContext.SecretMasker.AddValue(value);
|
||||||
|
|
||||||
// Also add each individual line. Typically individual lines are processed from STDOUT of child processes.
|
// Also add each individual line. Typically individual lines are processed from STDOUT of child processes.
|
||||||
var split = value.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
var split = value.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
foreach (var item in split)
|
foreach (var item in split)
|
||||||
{
|
{
|
||||||
HostContext.SecretMasker.AddValue(item);
|
HostContext.SecretMasker.AddValue(item.Trim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,14 @@ namespace GitHub.Services.Common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IDictionary<string, object> Properties
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_request.Properties;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IEnumerable<String> IHttpHeaders.GetValues(String name)
|
IEnumerable<String> IHttpHeaders.GetValues(String name)
|
||||||
{
|
{
|
||||||
IEnumerable<String> values;
|
IEnumerable<String> values;
|
||||||
|
|||||||
@@ -14,5 +14,10 @@ namespace GitHub.Services.Common
|
|||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IDictionary<string, object> Properties
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace GitHub.Services.Common.Diagnostics
|
|||||||
public static VssTraceActivity GetActivity(this HttpRequestMessage message)
|
public static VssTraceActivity GetActivity(this HttpRequestMessage message)
|
||||||
{
|
{
|
||||||
Object traceActivity;
|
Object traceActivity;
|
||||||
if (!message.Options.TryGetValue(VssTraceActivity.PropertyName, out traceActivity))
|
if (!message.Properties.TryGetValue(VssTraceActivity.PropertyName, out traceActivity))
|
||||||
{
|
{
|
||||||
return VssTraceActivity.Empty;
|
return VssTraceActivity.Empty;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ namespace GitHub.Services.Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add ourselves to the message so the underlying token issuers may use it if necessary
|
// Add ourselves to the message so the underlying token issuers may use it if necessary
|
||||||
request.Options.Set(new HttpRequestOptionsKey<VssHttpMessageHandler>(VssHttpMessageHandler.PropertyName), this);
|
request.Properties[VssHttpMessageHandler.PropertyName] = this;
|
||||||
|
|
||||||
Boolean succeeded = false;
|
Boolean succeeded = false;
|
||||||
Boolean lastResponseDemandedProxyAuth = false;
|
Boolean lastResponseDemandedProxyAuth = false;
|
||||||
@@ -409,7 +409,7 @@ namespace GitHub.Services.Common
|
|||||||
// Read the completion option provided by the caller. If we don't find the property then we
|
// Read the completion option provided by the caller. If we don't find the property then we
|
||||||
// assume it is OK to buffer by default.
|
// assume it is OK to buffer by default.
|
||||||
HttpCompletionOption completionOption;
|
HttpCompletionOption completionOption;
|
||||||
if (!request.Options.TryGetValue(VssHttpRequestSettings.HttpCompletionOptionPropertyName, out completionOption))
|
if (!request.Properties.TryGetValue(VssHttpRequestSettings.HttpCompletionOptionPropertyName, out completionOption))
|
||||||
{
|
{
|
||||||
completionOption = HttpCompletionOption.ResponseContentRead;
|
completionOption = HttpCompletionOption.ResponseContentRead;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ namespace GitHub.Services.Common
|
|||||||
public static void SetTraceInfo(HttpRequestMessage message, VssHttpMessageHandlerTraceInfo traceInfo)
|
public static void SetTraceInfo(HttpRequestMessage message, VssHttpMessageHandlerTraceInfo traceInfo)
|
||||||
{
|
{
|
||||||
object existingTraceInfo;
|
object existingTraceInfo;
|
||||||
if (!message.Options.TryGetValue(TfsTraceInfoKey, out existingTraceInfo))
|
if (!message.Properties.TryGetValue(TfsTraceInfoKey, out existingTraceInfo))
|
||||||
{
|
{
|
||||||
message.Options.Set(new HttpRequestOptionsKey<VssHttpMessageHandlerTraceInfo>(TfsTraceInfoKey), traceInfo);
|
message.Properties.Add(TfsTraceInfoKey, traceInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ namespace GitHub.Services.Common
|
|||||||
{
|
{
|
||||||
VssHttpMessageHandlerTraceInfo traceInfo = null;
|
VssHttpMessageHandlerTraceInfo traceInfo = null;
|
||||||
|
|
||||||
if (message.Options.TryGetValue(TfsTraceInfoKey, out object traceInfoObject))
|
if (message.Properties.TryGetValue(TfsTraceInfoKey, out object traceInfoObject))
|
||||||
{
|
{
|
||||||
traceInfo = traceInfoObject as VssHttpMessageHandlerTraceInfo;
|
traceInfo = traceInfoObject as VssHttpMessageHandlerTraceInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ using System.Text;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using GitHub.Services.Common;
|
|
||||||
|
|
||||||
namespace GitHub.Services.Common
|
namespace GitHub.Services.Common
|
||||||
{
|
{
|
||||||
@@ -292,12 +291,12 @@ namespace GitHub.Services.Common
|
|||||||
protected internal virtual Boolean ApplyTo(HttpRequestMessage request)
|
protected internal virtual Boolean ApplyTo(HttpRequestMessage request)
|
||||||
{
|
{
|
||||||
// Make sure we only apply the settings to the request once
|
// Make sure we only apply the settings to the request once
|
||||||
if (request.Options.TryGetValue<object>(PropertyName, out _))
|
if (request.Properties.ContainsKey(PropertyName))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
request.Options.Set(new HttpRequestOptionsKey<VssHttpRequestSettings>(PropertyName), this);
|
request.Properties.Add(PropertyName, this);
|
||||||
|
|
||||||
if (this.AcceptLanguages != null && this.AcceptLanguages.Count > 0)
|
if (this.AcceptLanguages != null && this.AcceptLanguages.Count > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace GitHub.Services.Common
|
|||||||
// Allow overriding default retry options per request
|
// Allow overriding default retry options per request
|
||||||
VssHttpRetryOptions retryOptions = m_retryOptions;
|
VssHttpRetryOptions retryOptions = m_retryOptions;
|
||||||
object retryOptionsObject;
|
object retryOptionsObject;
|
||||||
if (request.Options.TryGetValue(HttpRetryOptionsKey, out retryOptionsObject)) // NETSTANDARD compliant, TryGetValue<T> is not
|
if (request.Properties.TryGetValue(HttpRetryOptionsKey, out retryOptionsObject)) // NETSTANDARD compliant, TryGetValue<T> is not
|
||||||
{
|
{
|
||||||
// Fallback to default options if object of unexpected type was passed
|
// Fallback to default options if object of unexpected type was passed
|
||||||
retryOptions = retryOptionsObject as VssHttpRetryOptions ?? m_retryOptions;
|
retryOptions = retryOptionsObject as VssHttpRetryOptions ?? m_retryOptions;
|
||||||
@@ -66,7 +66,7 @@ namespace GitHub.Services.Common
|
|||||||
|
|
||||||
IVssHttpRetryInfo retryInfo = null;
|
IVssHttpRetryInfo retryInfo = null;
|
||||||
object retryInfoObject;
|
object retryInfoObject;
|
||||||
if (request.Options.TryGetValue(HttpRetryInfoKey, out retryInfoObject)) // NETSTANDARD compliant, TryGetValue<T> is not
|
if (request.Properties.TryGetValue(HttpRetryInfoKey, out retryInfoObject)) // NETSTANDARD compliant, TryGetValue<T> is not
|
||||||
{
|
{
|
||||||
retryInfo = retryInfoObject as IVssHttpRetryInfo;
|
retryInfo = retryInfoObject as IVssHttpRetryInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -768,7 +768,6 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
/// <param name="poolId"></param>
|
/// <param name="poolId"></param>
|
||||||
/// <param name="agentId"></param>
|
/// <param name="agentId"></param>
|
||||||
/// <param name="currentState"></param>
|
/// <param name="currentState"></param>
|
||||||
/// <param name="updateTrace"></param>
|
|
||||||
/// <param name="userState"></param>
|
/// <param name="userState"></param>
|
||||||
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
|
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
@@ -776,7 +775,6 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
int poolId,
|
int poolId,
|
||||||
int agentId,
|
int agentId,
|
||||||
string currentState,
|
string currentState,
|
||||||
string updateTrace,
|
|
||||||
object userState = null,
|
object userState = null,
|
||||||
CancellationToken cancellationToken = default)
|
CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
@@ -786,7 +784,6 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
|
|
||||||
List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
|
List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
|
||||||
queryParams.Add("currentState", currentState);
|
queryParams.Add("currentState", currentState);
|
||||||
queryParams.Add("updateTrace", updateTrace);
|
|
||||||
|
|
||||||
return SendAsync<TaskAgent>(
|
return SendAsync<TaskAgent>(
|
||||||
httpMethod,
|
httpMethod,
|
||||||
@@ -797,5 +794,65 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
userState: userState,
|
userState: userState,
|
||||||
cancellationToken: cancellationToken);
|
cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// [Preview API]
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="poolId"></param>
|
||||||
|
/// <param name="agentId"></param>
|
||||||
|
/// <param name="userState"></param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
|
||||||
|
public Task<String> GetAgentAuthUrlAsync(
|
||||||
|
int poolId,
|
||||||
|
int agentId,
|
||||||
|
object userState = null,
|
||||||
|
CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
HttpMethod httpMethod = new HttpMethod("GET");
|
||||||
|
Guid locationId = new Guid("a82a119c-1e46-44b6-8d75-c82a79cf975b");
|
||||||
|
object routeValues = new { poolId = poolId, agentId = agentId };
|
||||||
|
|
||||||
|
return SendAsync<String>(
|
||||||
|
httpMethod,
|
||||||
|
locationId,
|
||||||
|
routeValues: routeValues,
|
||||||
|
version: new ApiResourceVersion(6.0, 1),
|
||||||
|
userState: userState,
|
||||||
|
cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// [Preview API]
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="poolId"></param>
|
||||||
|
/// <param name="agentId"></param>
|
||||||
|
/// <param name="error"></param>
|
||||||
|
/// <param name="userState"></param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
|
||||||
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
|
public virtual async Task ReportAgentAuthUrlMigrationErrorAsync(
|
||||||
|
int poolId,
|
||||||
|
int agentId,
|
||||||
|
string error,
|
||||||
|
object userState = null,
|
||||||
|
CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
HttpMethod httpMethod = new HttpMethod("POST");
|
||||||
|
Guid locationId = new Guid("a82a119c-1e46-44b6-8d75-c82a79cf975b");
|
||||||
|
object routeValues = new { poolId = poolId, agentId = agentId };
|
||||||
|
HttpContent content = new ObjectContent<string>(error, new VssJsonMediaTypeFormatter(true));
|
||||||
|
|
||||||
|
using (HttpResponseMessage response = await SendAsync(
|
||||||
|
httpMethod,
|
||||||
|
locationId,
|
||||||
|
routeValues: routeValues,
|
||||||
|
version: new ApiResourceVersion(6.0, 1),
|
||||||
|
userState: userState,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
content: content).ConfigureAwait(false))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace GitHub.DistributedTask.WebApi
|
namespace GitHub.DistributedTask.WebApi
|
||||||
@@ -61,21 +59,10 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// File ID in file service
|
|
||||||
/// </summary>
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
||||||
public Int32? FileId
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Auth token to download the package
|
/// Auth token to download the package
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember]
|
||||||
public String Token
|
public String Token
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
@@ -83,7 +70,7 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SHA256 hash
|
/// MD5 hash as a base64 string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
public String HashValue
|
public String HashValue
|
||||||
@@ -103,7 +90,7 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The UI uses this to display instructions, e.g. "unzip MyAgent.zip"
|
/// The UI uses this to display instructions, i.e. "unzip MyAgent.zip"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public String Filename
|
public String Filename
|
||||||
@@ -111,43 +98,5 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A set of trimmed down packages:
|
|
||||||
/// - the package without 'externals'
|
|
||||||
/// - the package without 'dotnet runtime'
|
|
||||||
/// - the package without 'dotnet runtime' and 'externals'
|
|
||||||
/// </summary>
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
|
||||||
public List<TrimmedPackageMetadata> TrimmedPackages
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[DataContract]
|
|
||||||
public class TrimmedPackageMetadata
|
|
||||||
{
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
|
||||||
public string HashValue { get; set; }
|
|
||||||
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
|
||||||
public string DownloadUrl { get; set; }
|
|
||||||
|
|
||||||
public Dictionary<string, string> TrimmedContents
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (m_trimmedContents == null)
|
|
||||||
{
|
|
||||||
m_trimmedContents = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
||||||
}
|
|
||||||
return m_trimmedContents;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[DataMember(Name = "TrimmedContents", EmitDefaultValue = false)]
|
|
||||||
private Dictionary<string, string> m_trimmedContents;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
this.ProvisioningState = referenceToBeCloned.ProvisioningState;
|
this.ProvisioningState = referenceToBeCloned.ProvisioningState;
|
||||||
this.AccessPoint = referenceToBeCloned.AccessPoint;
|
this.AccessPoint = referenceToBeCloned.AccessPoint;
|
||||||
this.Ephemeral = referenceToBeCloned.Ephemeral;
|
this.Ephemeral = referenceToBeCloned.Ephemeral;
|
||||||
this.DisableUpdate = referenceToBeCloned.DisableUpdate;
|
|
||||||
|
|
||||||
if (referenceToBeCloned.m_links != null)
|
if (referenceToBeCloned.m_links != null)
|
||||||
{
|
{
|
||||||
@@ -93,16 +92,6 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether or not this agent should auto-update to latest version.
|
|
||||||
/// </summary>
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
|
||||||
public bool? DisableUpdate
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not the agent is online.
|
/// Whether or not the agent is online.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;linux-musl-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
|
<AssetTargetFallback>portable-net45+win8</AssetTargetFallback>
|
||||||
<NoWarn>NU1701;NU1603</NoWarn>
|
<NoWarn>NU1701;NU1603</NoWarn>
|
||||||
<Version>$(Version)</Version>
|
<Version>$(Version)</Version>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -833,7 +833,7 @@ namespace GitHub.Services.WebApi
|
|||||||
{
|
{
|
||||||
if (userState != null)
|
if (userState != null)
|
||||||
{
|
{
|
||||||
message.Options.Set(new HttpRequestOptionsKey<object>(UserStatePropertyName), userState);
|
message.Properties[UserStatePropertyName] = userState;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!message.Headers.Contains(Common.Internal.HttpHeaders.VssE2EID))
|
if (!message.Headers.Contains(Common.Internal.HttpHeaders.VssE2EID))
|
||||||
@@ -842,11 +842,11 @@ namespace GitHub.Services.WebApi
|
|||||||
}
|
}
|
||||||
VssHttpEventSource.Log.HttpRequestStart(traceActivity, message);
|
VssHttpEventSource.Log.HttpRequestStart(traceActivity, message);
|
||||||
message.Trace();
|
message.Trace();
|
||||||
message.Options.Set(new HttpRequestOptionsKey<VssTraceActivity>(VssTraceActivity.PropertyName), traceActivity);
|
message.Properties[VssTraceActivity.PropertyName] = traceActivity;
|
||||||
|
|
||||||
// Send the completion option to the inner handler stack so we know when it's safe to buffer
|
// Send the completion option to the inner handler stack so we know when it's safe to buffer
|
||||||
// and when we should avoid buffering.
|
// and when we should avoid buffering.
|
||||||
message.Options.Set(new HttpRequestOptionsKey<HttpCompletionOption>(VssHttpRequestSettings.HttpCompletionOptionPropertyName), completionOption);
|
message.Properties[VssHttpRequestSettings.HttpCompletionOptionPropertyName] = completionOption;
|
||||||
|
|
||||||
//ConfigureAwait(false) enables the continuation to be run outside
|
//ConfigureAwait(false) enables the continuation to be run outside
|
||||||
//any captured SyncronizationContext (such as ASP.NET's) which keeps things
|
//any captured SyncronizationContext (such as ASP.NET's) which keeps things
|
||||||
@@ -1154,14 +1154,12 @@ namespace GitHub.Services.WebApi
|
|||||||
{
|
{
|
||||||
if (BaseAddress != null)
|
if (BaseAddress != null)
|
||||||
{
|
{
|
||||||
#pragma warning disable SYSLIB0014
|
|
||||||
ServicePoint servicePoint = ServicePointManager.FindServicePoint(BaseAddress);
|
ServicePoint servicePoint = ServicePointManager.FindServicePoint(BaseAddress);
|
||||||
servicePoint.UseNagleAlgorithm = false;
|
servicePoint.UseNagleAlgorithm = false;
|
||||||
servicePoint.SetTcpKeepAlive(
|
servicePoint.SetTcpKeepAlive(
|
||||||
enabled: true,
|
enabled: true,
|
||||||
keepAliveTime: c_keepAliveTime,
|
keepAliveTime: c_keepAliveTime,
|
||||||
keepAliveInterval: c_keepAliveInterval);
|
keepAliveInterval: c_keepAliveInterval);
|
||||||
#pragma warning restore SYSLIB0014
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace GitHub.Services.WebApi
|
|||||||
|
|
||||||
if (routeReplacementOptions.HasFlag(RouteReplacementOptions.EscapeUri))
|
if (routeReplacementOptions.HasFlag(RouteReplacementOptions.EscapeUri))
|
||||||
{
|
{
|
||||||
sbResult = new StringBuilder(Uri.EscapeDataString(sbResult.ToString()));
|
sbResult = new StringBuilder(Uri.EscapeUriString(sbResult.ToString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (routeReplacementOptions.HasFlag(RouteReplacementOptions.AppendUnusedAsQueryParams) && unusedValues.Count > 0)
|
if (routeReplacementOptions.HasFlag(RouteReplacementOptions.AppendUnusedAsQueryParams) && unusedValues.Count > 0)
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ namespace GitHub.Services.WebApi
|
|||||||
|
|
||||||
internal static void Trace(this HttpRequestMessage request)
|
internal static void Trace(this HttpRequestMessage request)
|
||||||
{
|
{
|
||||||
VssRequestTimerTrace tracer;
|
Object tracerObj = null;
|
||||||
if (request.Options.TryGetValue(tracerKey, out object tracerObj))
|
VssRequestTimerTrace tracer = null;
|
||||||
|
if (request.Properties.TryGetValue(tracerKey, out tracerObj))
|
||||||
{
|
{
|
||||||
tracer = tracerObj as VssRequestTimerTrace;
|
tracer = tracerObj as VssRequestTimerTrace;
|
||||||
Debug.Assert(tracer != null, "Tracer object is the wrong type!");
|
Debug.Assert(tracer != null, "Tracer object is the wrong type!");
|
||||||
@@ -25,7 +26,7 @@ namespace GitHub.Services.WebApi
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
tracer = new VssRequestTimerTrace();
|
tracer = new VssRequestTimerTrace();
|
||||||
request.Options.Set(new HttpRequestOptionsKey<VssRequestTimerTrace>(tracerKey), tracer);
|
request.Properties[tracerKey] = tracer;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tracer != null)
|
if (tracer != null)
|
||||||
@@ -36,8 +37,9 @@ namespace GitHub.Services.WebApi
|
|||||||
|
|
||||||
internal static void Trace(this HttpResponseMessage response)
|
internal static void Trace(this HttpResponseMessage response)
|
||||||
{
|
{
|
||||||
|
Object tracerObj = null;
|
||||||
VssRequestTimerTrace tracer = null;
|
VssRequestTimerTrace tracer = null;
|
||||||
if (response.RequestMessage.Options.TryGetValue(tracerKey, out object tracerObj))
|
if (response.RequestMessage.Properties.TryGetValue(tracerKey, out tracerObj))
|
||||||
{
|
{
|
||||||
tracer = tracerObj as VssRequestTimerTrace;
|
tracer = tracerObj as VssRequestTimerTrace;
|
||||||
Debug.Assert(tracer != null, "Tracer object is the wrong type!");
|
Debug.Assert(tracer != null, "Tracer object is the wrong type!");
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
"linux-x64",
|
"linux-x64",
|
||||||
"linux-arm",
|
"linux-arm",
|
||||||
"linux-arm64",
|
"linux-arm64",
|
||||||
|
"linux-musl-x64",
|
||||||
"osx-x64"
|
"osx-x64"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -547,7 +547,6 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OS_WINDOWS
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("Level", "L0")]
|
[Trait("Level", "L0")]
|
||||||
[Trait("Category", nameof(CommandSettings))]
|
[Trait("Category", nameof(CommandSettings))]
|
||||||
@@ -604,7 +603,7 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
Assert.Equal("some windows logon password", actual);
|
Assert.Equal("some windows logon password", actual);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("Level", "L0")]
|
[Trait("Level", "L0")]
|
||||||
[Trait("Category", nameof(CommandSettings))]
|
[Trait("Category", nameof(CommandSettings))]
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace GitHub.Runner.Common.Tests.Listener.Configuration
|
|||||||
_serviceControlManager = new Mock<ILinuxServiceControlManager>();
|
_serviceControlManager = new Mock<ILinuxServiceControlManager>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
var expectedAgent = new TaskAgent(_expectedAgentName) { Id = 1, Ephemeral = true, DisableUpdate = true };
|
var expectedAgent = new TaskAgent(_expectedAgentName) { Id = 1 };
|
||||||
expectedAgent.Authorization = new TaskAgentAuthorization
|
expectedAgent.Authorization = new TaskAgentAuthorization
|
||||||
{
|
{
|
||||||
ClientId = Guid.NewGuid(),
|
ClientId = Guid.NewGuid(),
|
||||||
@@ -163,8 +163,6 @@ namespace GitHub.Runner.Common.Tests.Listener.Configuration
|
|||||||
"--token", _expectedToken,
|
"--token", _expectedToken,
|
||||||
"--labels", userLabels,
|
"--labels", userLabels,
|
||||||
"--ephemeral",
|
"--ephemeral",
|
||||||
"--disableupdate",
|
|
||||||
"--unattended",
|
|
||||||
});
|
});
|
||||||
trace.Info("Constructed.");
|
trace.Info("Constructed.");
|
||||||
_store.Setup(x => x.IsConfigured()).Returns(false);
|
_store.Setup(x => x.IsConfigured()).Returns(false);
|
||||||
@@ -187,7 +185,7 @@ namespace GitHub.Runner.Common.Tests.Listener.Configuration
|
|||||||
// validate GetAgentPoolsAsync gets called twice with automation pool type
|
// validate GetAgentPoolsAsync gets called twice with automation pool type
|
||||||
_runnerServer.Verify(x => x.GetAgentPoolsAsync(It.IsAny<string>(), It.Is<TaskAgentPoolType>(p => p == TaskAgentPoolType.Automation)), Times.Exactly(2));
|
_runnerServer.Verify(x => x.GetAgentPoolsAsync(It.IsAny<string>(), It.Is<TaskAgentPoolType>(p => p == TaskAgentPoolType.Automation)), Times.Exactly(2));
|
||||||
|
|
||||||
var expectedLabels = new List<string>() { "self-hosted", VarUtil.OS, VarUtil.OSArchitecture };
|
var expectedLabels = new List<string>() { "self-hosted", VarUtil.OS, VarUtil.OSArchitecture};
|
||||||
expectedLabels.AddRange(userLabels.Split(",").ToList());
|
expectedLabels.AddRange(userLabels.Split(",").ToList());
|
||||||
|
|
||||||
_runnerServer.Verify(x => x.AddAgentAsync(It.IsAny<int>(), It.Is<TaskAgent>(a => a.Labels.Select(x => x.Name).ToHashSet().SetEquals(expectedLabels))), Times.Once);
|
_runnerServer.Verify(x => x.AddAgentAsync(It.IsAny<int>(), It.Is<TaskAgent>(a => a.Labels.Select(x => x.Name).ToHashSet().SetEquals(expectedLabels))), Times.Once);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ namespace Test.L0.Listener.Configuration
|
|||||||
{
|
{
|
||||||
|
|
||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
#pragma warning disable CA1416
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("Level", "L0")]
|
[Trait("Level", "L0")]
|
||||||
[Trait("Category", "ConfigurationManagement")]
|
[Trait("Category", "ConfigurationManagement")]
|
||||||
@@ -51,7 +50,6 @@ namespace Test.L0.Listener.Configuration
|
|||||||
Assert.True(defaultServiceAccount.ToString().Equals(@"NT AUTHORITY\SYSTEM"), "If agent is getting configured as deployment agent, default service accout should be 'NT AUTHORITY\\SYSTEM'");
|
Assert.True(defaultServiceAccount.ToString().Equals(@"NT AUTHORITY\SYSTEM"), "If agent is getting configured as deployment agent, default service accout should be 'NT AUTHORITY\\SYSTEM'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma warning restore CA1416
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,786 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using GitHub.DistributedTask.WebApi;
|
|
||||||
using GitHub.Runner.Listener;
|
|
||||||
using GitHub.Runner.Sdk;
|
|
||||||
using Moq;
|
|
||||||
using Xunit;
|
|
||||||
|
|
||||||
namespace GitHub.Runner.Common.Tests.Listener
|
|
||||||
{
|
|
||||||
public sealed class SelfUpdaterL0
|
|
||||||
{
|
|
||||||
private Mock<IRunnerServer> _runnerServer;
|
|
||||||
private Mock<ITerminal> _term;
|
|
||||||
private Mock<IConfigurationStore> _configStore;
|
|
||||||
private Mock<IJobDispatcher> _jobDispatcher;
|
|
||||||
private AgentRefreshMessage _refreshMessage = new AgentRefreshMessage(1, "2.299.0");
|
|
||||||
private List<TrimmedPackageMetadata> _trimmedPackages = new List<TrimmedPackageMetadata>();
|
|
||||||
|
|
||||||
#if !OS_WINDOWS
|
|
||||||
private string _packageUrl = null;
|
|
||||||
#else
|
|
||||||
private string _packageUrl = null;
|
|
||||||
#endif
|
|
||||||
public SelfUpdaterL0()
|
|
||||||
{
|
|
||||||
_runnerServer = new Mock<IRunnerServer>();
|
|
||||||
_term = new Mock<ITerminal>();
|
|
||||||
_configStore = new Mock<IConfigurationStore>();
|
|
||||||
_jobDispatcher = new Mock<IJobDispatcher>();
|
|
||||||
_configStore.Setup(x => x.GetSettings()).Returns(new RunnerSettings() { PoolId = 1, AgentId = 1 });
|
|
||||||
|
|
||||||
Environment.SetEnvironmentVariable("_GITHUB_ACTION_EXECUTE_UPDATE_SCRIPT", "1");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task FetchLatestRunner()
|
|
||||||
{
|
|
||||||
var latestVersion = "";
|
|
||||||
var httpClientHandler = new HttpClientHandler();
|
|
||||||
httpClientHandler.AllowAutoRedirect = false;
|
|
||||||
using (var client = new HttpClient(httpClientHandler))
|
|
||||||
{
|
|
||||||
var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "https://github.com/actions/runner/releases/latest"));
|
|
||||||
if (response.StatusCode == System.Net.HttpStatusCode.Redirect)
|
|
||||||
{
|
|
||||||
var redirect = await response.Content.ReadAsStringAsync();
|
|
||||||
Regex regex = new Regex(@"/runner/releases/tag/v(?<version>\d+\.\d+\.\d+)");
|
|
||||||
var match = regex.Match(redirect);
|
|
||||||
if (match.Success)
|
|
||||||
{
|
|
||||||
latestVersion = match.Groups["version"].Value;
|
|
||||||
|
|
||||||
#if !OS_WINDOWS
|
|
||||||
_packageUrl = $"https://github.com/actions/runner/releases/download/v{latestVersion}/actions-runner-{BuildConstants.RunnerPackage.PackageName}-{latestVersion}.tar.gz";
|
|
||||||
#else
|
|
||||||
_packageUrl = $"https://github.com/actions/runner/releases/download/v{latestVersion}/actions-runner-{BuildConstants.RunnerPackage.PackageName}-{latestVersion}.zip";
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
var json = await client.GetStringAsync($"https://github.com/actions/runner/releases/download/v{latestVersion}/actions-runner-{BuildConstants.RunnerPackage.PackageName}-{latestVersion}-trimmedpackages.json");
|
|
||||||
_trimmedPackages = StringUtil.ConvertFromJson<List<TrimmedPackageMetadata>>(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.299.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.299.0"), DownloadUrl = _packageUrl }));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new HttpClientHandlerFactory());
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper();
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper();
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper();
|
|
||||||
p3.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken);
|
|
||||||
Assert.True(result);
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0")));
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0")));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0"), CancellationToken.None);
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0"), CancellationToken.None);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_NoUpdateOnOldVersion()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper();
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper();
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper();
|
|
||||||
p3.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.200.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.200.0"), DownloadUrl = _packageUrl }));
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
var result = await updater.SelfUpdate(new AgentRefreshMessage(1, "2.200.0"), _jobDispatcher.Object, true, hc.RunnerShutdownToken);
|
|
||||||
Assert.False(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_DownloadRetry()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new HttpClientHandlerFactory());
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.299.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.299.0"), DownloadUrl = $"https://github.com/actions/runner/notexists" }));
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper();
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper();
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper();
|
|
||||||
p3.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
|
|
||||||
var ex = await Assert.ThrowsAsync<TaskCanceledException>(() => updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken));
|
|
||||||
Assert.Contains($"failed after {Constants.RunnerDownloadRetryMaxAttempts} download attempts", ex.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_ValidateHash()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new HttpClientHandlerFactory());
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.299.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.299.0"), DownloadUrl = _packageUrl, HashValue = "bad_hash" }));
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper();
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper();
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper();
|
|
||||||
p3.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
|
|
||||||
var ex = await Assert.ThrowsAsync<Exception>(() => updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken));
|
|
||||||
Assert.Contains("did not match expected Runner Hash", ex.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_CloneHash_RuntimeAndExternals()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new HttpClientHandlerFactory());
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper();
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper();
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper();
|
|
||||||
p3.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.299.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.299.0"), DownloadUrl = _packageUrl, TrimmedPackages = new List<TrimmedPackageMetadata>() { new TrimmedPackageMetadata() } }));
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken);
|
|
||||||
Assert.True(result);
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0")));
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0")));
|
|
||||||
|
|
||||||
FieldInfo contentHashesProperty = updater.GetType().GetField("_contentHashes", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
|
|
||||||
Assert.NotNull(contentHashesProperty);
|
|
||||||
Dictionary<string, string> contentHashes = (Dictionary<string, string>)contentHashesProperty.GetValue(updater);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(contentHashes));
|
|
||||||
|
|
||||||
var dotnetRuntimeHashFile = Path.Combine(TestUtil.GetSrcPath(), $"Misc/contentHash/dotnetRuntime/{BuildConstants.RunnerPackage.PackageName}");
|
|
||||||
var externalsHashFile = Path.Combine(TestUtil.GetSrcPath(), $"Misc/contentHash/externals/{BuildConstants.RunnerPackage.PackageName}");
|
|
||||||
|
|
||||||
Assert.Equal(File.ReadAllText(dotnetRuntimeHashFile).Trim(), contentHashes["dotnetRuntime"]);
|
|
||||||
Assert.Equal(File.ReadAllText(externalsHashFile).Trim(), contentHashes["externals"]);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0"), CancellationToken.None);
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0"), CancellationToken.None);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_Cancel_CloneHashTask_WhenNotNeeded()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new Mock<IHttpClientHandlerFactory>().Object);
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper();
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper();
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper();
|
|
||||||
p3.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken);
|
|
||||||
|
|
||||||
FieldInfo contentHashesProperty = updater.GetType().GetField("_contentHashes", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
|
|
||||||
Assert.NotNull(contentHashesProperty);
|
|
||||||
Dictionary<string, string> contentHashes = (Dictionary<string, string>)contentHashesProperty.GetValue(updater);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(contentHashes));
|
|
||||||
|
|
||||||
Assert.NotEqual(2, contentHashes.Count);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
hc.GetTrace().Error(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_UseExternalsTrimmedPackage()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new HttpClientHandlerFactory());
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper(); // hashfiles
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper(); // hashfiles
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper(); // un-tar
|
|
||||||
p3.Initialize(hc);
|
|
||||||
var p4 = new ProcessInvokerWrapper(); // node -v
|
|
||||||
p4.Initialize(hc);
|
|
||||||
var p5 = new ProcessInvokerWrapper(); // node -v
|
|
||||||
p5.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p4);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p5);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
var trim = _trimmedPackages.Where(x => !x.TrimmedContents.ContainsKey("dotnetRuntime")).ToList();
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.299.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.299.0"), DownloadUrl = _packageUrl, TrimmedPackages = trim }));
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken);
|
|
||||||
Assert.True(result);
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0")));
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0")));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0"), CancellationToken.None);
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0"), CancellationToken.None);
|
|
||||||
}
|
|
||||||
|
|
||||||
var traceFile = Path.GetTempFileName();
|
|
||||||
File.Copy(hc.TraceFileName, traceFile, true);
|
|
||||||
|
|
||||||
var externalsHashFile = Path.Combine(TestUtil.GetSrcPath(), $"Misc/contentHash/externals/{BuildConstants.RunnerPackage.PackageName}");
|
|
||||||
var externalsHash = await File.ReadAllTextAsync(externalsHashFile);
|
|
||||||
|
|
||||||
if (externalsHash == trim[0].TrimmedContents["externals"])
|
|
||||||
{
|
|
||||||
Assert.Contains("Use trimmed (externals) package", File.ReadAllText(traceFile));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Assert.Contains("the current runner does not carry those trimmed content (Hash mismatch)", File.ReadAllText(traceFile));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_UseExternalsRuntimeTrimmedPackage()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new HttpClientHandlerFactory());
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper(); // hashfiles
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper(); // hashfiles
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper(); // un-tar
|
|
||||||
p3.Initialize(hc);
|
|
||||||
var p4 = new ProcessInvokerWrapper(); // node -v
|
|
||||||
p4.Initialize(hc);
|
|
||||||
var p5 = new ProcessInvokerWrapper(); // node -v
|
|
||||||
p5.Initialize(hc);
|
|
||||||
var p6 = new ProcessInvokerWrapper(); // runner -v
|
|
||||||
p6.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p4);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p5);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p6);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
var trim = _trimmedPackages.Where(x => x.TrimmedContents.ContainsKey("dotnetRuntime") && x.TrimmedContents.ContainsKey("externals")).ToList();
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.299.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.299.0"), DownloadUrl = _packageUrl, TrimmedPackages = trim }));
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken);
|
|
||||||
Assert.True(result);
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0")));
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0")));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0"), CancellationToken.None);
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0"), CancellationToken.None);
|
|
||||||
}
|
|
||||||
|
|
||||||
var traceFile = Path.GetTempFileName();
|
|
||||||
File.Copy(hc.TraceFileName, traceFile, true);
|
|
||||||
|
|
||||||
var externalsHashFile = Path.Combine(TestUtil.GetSrcPath(), $"Misc/contentHash/externals/{BuildConstants.RunnerPackage.PackageName}");
|
|
||||||
var externalsHash = await File.ReadAllTextAsync(externalsHashFile);
|
|
||||||
|
|
||||||
var runtimeHashFile = Path.Combine(TestUtil.GetSrcPath(), $"Misc/contentHash/dotnetRuntime/{BuildConstants.RunnerPackage.PackageName}");
|
|
||||||
var runtimeHash = await File.ReadAllTextAsync(runtimeHashFile);
|
|
||||||
|
|
||||||
if (externalsHash == trim[0].TrimmedContents["externals"] &&
|
|
||||||
runtimeHash == trim[0].TrimmedContents["dotnetRuntime"])
|
|
||||||
{
|
|
||||||
Assert.Contains("Use trimmed (runtime+externals) package", File.ReadAllText(traceFile));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Assert.Contains("the current runner does not carry those trimmed content (Hash mismatch)", File.ReadAllText(traceFile));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_NotUseExternalsRuntimeTrimmedPackageOnHashMismatch()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new HttpClientHandlerFactory());
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper(); // hashfiles
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper(); // hashfiles
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper(); // un-tar
|
|
||||||
p3.Initialize(hc);
|
|
||||||
var p4 = new ProcessInvokerWrapper(); // node -v
|
|
||||||
p4.Initialize(hc);
|
|
||||||
var p5 = new ProcessInvokerWrapper(); // node -v
|
|
||||||
p5.Initialize(hc);
|
|
||||||
var p6 = new ProcessInvokerWrapper(); // runner -v
|
|
||||||
p6.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p4);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p5);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p6);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
var trim = _trimmedPackages.ToList();
|
|
||||||
foreach (var package in trim)
|
|
||||||
{
|
|
||||||
foreach (var hash in package.TrimmedContents.Keys)
|
|
||||||
{
|
|
||||||
package.TrimmedContents[hash] = "mismatch";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.299.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.299.0"), DownloadUrl = _packageUrl, TrimmedPackages = trim }));
|
|
||||||
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken);
|
|
||||||
Assert.True(result);
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0")));
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0")));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0"), CancellationToken.None);
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0"), CancellationToken.None);
|
|
||||||
}
|
|
||||||
|
|
||||||
var traceFile = Path.GetTempFileName();
|
|
||||||
File.Copy(hc.TraceFileName, traceFile, true);
|
|
||||||
Assert.Contains("the current runner does not carry those trimmed content (Hash mismatch)", File.ReadAllText(traceFile));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Runner")]
|
|
||||||
public async void TestSelfUpdateAsync_FallbackToFullPackage()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await FetchLatestRunner();
|
|
||||||
Assert.NotNull(_packageUrl);
|
|
||||||
Assert.NotNull(_trimmedPackages);
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", Path.GetFullPath(Path.Combine(TestUtil.GetSrcPath(), "..", "_layout", "bin")));
|
|
||||||
using (var hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(_packageUrl);
|
|
||||||
hc.GetTrace().Info(StringUtil.ConvertToJson(_trimmedPackages));
|
|
||||||
|
|
||||||
//Arrange
|
|
||||||
var updater = new Runner.Listener.SelfUpdater();
|
|
||||||
hc.SetSingleton<ITerminal>(_term.Object);
|
|
||||||
hc.SetSingleton<IRunnerServer>(_runnerServer.Object);
|
|
||||||
hc.SetSingleton<IConfigurationStore>(_configStore.Object);
|
|
||||||
hc.SetSingleton<IHttpClientHandlerFactory>(new HttpClientHandlerFactory());
|
|
||||||
|
|
||||||
var p1 = new ProcessInvokerWrapper(); // hashfiles
|
|
||||||
p1.Initialize(hc);
|
|
||||||
var p2 = new ProcessInvokerWrapper(); // hashfiles
|
|
||||||
p2.Initialize(hc);
|
|
||||||
var p3 = new ProcessInvokerWrapper(); // un-tar trim
|
|
||||||
p3.Initialize(hc);
|
|
||||||
var p4 = new ProcessInvokerWrapper(); // un-tar full
|
|
||||||
p4.Initialize(hc);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p1);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p2);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p3);
|
|
||||||
hc.EnqueueInstance<IProcessInvoker>(p4);
|
|
||||||
updater.Initialize(hc);
|
|
||||||
|
|
||||||
var trim = _trimmedPackages.ToList();
|
|
||||||
foreach (var package in trim)
|
|
||||||
{
|
|
||||||
package.HashValue = "mismatch";
|
|
||||||
}
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.GetPackageAsync("agent", BuildConstants.RunnerPackage.PackageName, "2.299.0", true, It.IsAny<CancellationToken>()))
|
|
||||||
.Returns(Task.FromResult(new PackageMetadata() { Platform = BuildConstants.RunnerPackage.PackageName, Version = new PackageVersion("2.299.0"), DownloadUrl = _packageUrl, TrimmedPackages = trim }));
|
|
||||||
|
|
||||||
_runnerServer.Setup(x => x.UpdateAgentUpdateStateAsync(1, 1, It.IsAny<string>(), It.IsAny<string>()))
|
|
||||||
.Callback((int p, int a, string s, string t) =>
|
|
||||||
{
|
|
||||||
hc.GetTrace().Info(t);
|
|
||||||
})
|
|
||||||
.Returns(Task.FromResult(new TaskAgent()));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await updater.SelfUpdate(_refreshMessage, _jobDispatcher.Object, true, hc.RunnerShutdownToken);
|
|
||||||
Assert.True(result);
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0")));
|
|
||||||
Assert.True(Directory.Exists(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0")));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "bin.2.299.0"), CancellationToken.None);
|
|
||||||
IOUtil.DeleteDirectory(Path.Combine(hc.GetDirectory(WellKnownDirectory.Root), "externals.2.299.0"), CancellationToken.None);
|
|
||||||
}
|
|
||||||
|
|
||||||
var traceFile = Path.GetTempFileName();
|
|
||||||
File.Copy(hc.TraceFileName, traceFile, true);
|
|
||||||
Assert.Contains("Something wrong with the trimmed runner package, failback to use the full package for runner updates", File.ReadAllText(traceFile));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Xunit;
|
|
||||||
using GitHub.Runner.Common.Util;
|
|
||||||
using System.Threading.Channels;
|
|
||||||
using GitHub.Runner.Sdk;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace GitHub.Runner.Common.Tests
|
|
||||||
{
|
|
||||||
public sealed class PackagesTrimL0
|
|
||||||
{
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Common")]
|
|
||||||
public async Task RunnerLayoutParts_NewFilesCrossAll()
|
|
||||||
{
|
|
||||||
using (TestHostContext hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
Tracing trace = hc.GetTrace();
|
|
||||||
var runnerCoreAssetsFile = Path.Combine(TestUtil.GetSrcPath(), @"Misc/runnercoreassets");
|
|
||||||
var runnerDotnetRuntimeFile = Path.Combine(TestUtil.GetSrcPath(), @"Misc/runnerdotnetruntimeassets");
|
|
||||||
string layoutBin = Path.Combine(TestUtil.GetSrcPath(), @"../_layout/bin");
|
|
||||||
var newFiles = new List<string>();
|
|
||||||
if (Directory.Exists(layoutBin))
|
|
||||||
{
|
|
||||||
var coreAssets = await File.ReadAllLinesAsync(runnerCoreAssetsFile);
|
|
||||||
var runtimeAssets = await File.ReadAllLinesAsync(runnerDotnetRuntimeFile);
|
|
||||||
foreach (var file in Directory.GetFiles(layoutBin, "*", SearchOption.AllDirectories))
|
|
||||||
{
|
|
||||||
if (!coreAssets.Any(x => file.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).EndsWith(x)) &&
|
|
||||||
!runtimeAssets.Any(x => file.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).EndsWith(x)))
|
|
||||||
{
|
|
||||||
newFiles.Add(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newFiles.Count > 0)
|
|
||||||
{
|
|
||||||
Assert.True(false, $"Found new files '{string.Join('\n', newFiles)}'. These will break runner update using trimmed packages.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Common")]
|
|
||||||
public async Task RunnerLayoutParts_OverlapFiles()
|
|
||||||
{
|
|
||||||
using (TestHostContext hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
Tracing trace = hc.GetTrace();
|
|
||||||
var runnerCoreAssetsFile = Path.Combine(TestUtil.GetSrcPath(), @"Misc/runnercoreassets");
|
|
||||||
var runnerDotnetRuntimeFile = Path.Combine(TestUtil.GetSrcPath(), @"Misc/runnerdotnetruntimeassets");
|
|
||||||
|
|
||||||
var coreAssets = await File.ReadAllLinesAsync(runnerCoreAssetsFile);
|
|
||||||
var runtimeAssets = await File.ReadAllLinesAsync(runnerDotnetRuntimeFile);
|
|
||||||
|
|
||||||
foreach (var line in coreAssets)
|
|
||||||
{
|
|
||||||
if (runtimeAssets.Contains(line, StringComparer.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
Assert.True(false, $"'Misc/runnercoreassets' and 'Misc/runnerdotnetruntimeassets' should not overlap.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Common")]
|
|
||||||
public async Task RunnerLayoutParts_NewRunnerCoreAssets()
|
|
||||||
{
|
|
||||||
using (TestHostContext hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
Tracing trace = hc.GetTrace();
|
|
||||||
var runnerCoreAssetsFile = Path.Combine(TestUtil.GetSrcPath(), @"Misc/runnercoreassets");
|
|
||||||
var coreAssets = await File.ReadAllLinesAsync(runnerCoreAssetsFile);
|
|
||||||
|
|
||||||
string layoutBin = Path.Combine(TestUtil.GetSrcPath(), @"../_layout/bin");
|
|
||||||
var newFiles = new List<string>();
|
|
||||||
if (Directory.Exists(layoutBin))
|
|
||||||
{
|
|
||||||
var binDirs = Directory.GetDirectories(TestUtil.GetSrcPath(), "net6.0", SearchOption.AllDirectories);
|
|
||||||
foreach (var binDir in binDirs)
|
|
||||||
{
|
|
||||||
if (binDir.Contains("Test") || binDir.Contains("obj"))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Directory.GetFiles(binDir, "*", SearchOption.TopDirectoryOnly).ToList().ForEach(x =>
|
|
||||||
{
|
|
||||||
if (!x.Contains("runtimeconfig.dev.json"))
|
|
||||||
{
|
|
||||||
if (!coreAssets.Any(y => x.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).EndsWith(y)))
|
|
||||||
{
|
|
||||||
newFiles.Add(x);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newFiles.Count > 0)
|
|
||||||
{
|
|
||||||
Assert.True(false, $"Found new files '{string.Join('\n', newFiles)}'. These will break runner update using trimmed packages. You might need to update `Misc/runnercoreassets`.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Common")]
|
|
||||||
public async Task RunnerLayoutParts_NewDotnetRuntimeAssets()
|
|
||||||
{
|
|
||||||
using (TestHostContext hc = new TestHostContext(this))
|
|
||||||
{
|
|
||||||
Tracing trace = hc.GetTrace();
|
|
||||||
var runnerDotnetRuntimeFile = Path.Combine(TestUtil.GetSrcPath(), @"Misc/runnerdotnetruntimeassets");
|
|
||||||
var runtimeAssets = await File.ReadAllLinesAsync(runnerDotnetRuntimeFile);
|
|
||||||
|
|
||||||
string layoutTrimsRuntimeAssets = Path.Combine(TestUtil.GetSrcPath(), @"../_layout_trims/runnerdotnetruntimeassets");
|
|
||||||
var newFiles = new List<string>();
|
|
||||||
if (File.Exists(layoutTrimsRuntimeAssets))
|
|
||||||
{
|
|
||||||
var runtimeAssetsCurrent = await File.ReadAllLinesAsync(layoutTrimsRuntimeAssets);
|
|
||||||
foreach (var runtimeFile in runtimeAssetsCurrent)
|
|
||||||
{
|
|
||||||
if (runtimeAssets.Any(x => runtimeFile.EndsWith(x, StringComparison.OrdinalIgnoreCase)))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newFiles.Add(runtimeFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newFiles.Count > 0)
|
|
||||||
{
|
|
||||||
Assert.True(false, $"Found new dotnet runtime files '{string.Join('\n', newFiles)}'. These will break runner update using trimmed packages. You might need to update `Misc/runnerdotnetruntimeassets`.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -197,7 +197,7 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
execTask = processInvoker.ExecuteAsync("", "cmd.exe", $"/c \"choice /T {SecondsToRun} /D y\"", null, tokenSource.Token);
|
execTask = processInvoker.ExecuteAsync("", "cmd.exe", $"/c \"choice /T {SecondsToRun} /D y\"", null, tokenSource.Token);
|
||||||
#else
|
#else
|
||||||
execTask = processInvoker.ExecuteAsync("", "bash", $"-c \"sleep {SecondsToRun}\"", null, tokenSource.Token);
|
execTask = processInvoker.ExecuteAsync("", "bash", $"-c \"sleep {SecondsToRun}s\"", null, tokenSource.Token);
|
||||||
#endif
|
#endif
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
tokenSource.Cancel();
|
tokenSource.Cancel();
|
||||||
|
|||||||
@@ -165,15 +165,7 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
switch (directory)
|
switch (directory)
|
||||||
{
|
{
|
||||||
case WellKnownDirectory.Bin:
|
case WellKnownDirectory.Bin:
|
||||||
var overwriteBinDir = Environment.GetEnvironmentVariable("RUNNER_L0_OVERRIDEBINDIR");
|
path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||||
if (Directory.Exists(overwriteBinDir))
|
|
||||||
{
|
|
||||||
path = overwriteBinDir;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WellKnownDirectory.Diag:
|
case WellKnownDirectory.Diag:
|
||||||
|
|||||||
@@ -122,14 +122,14 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
{
|
{
|
||||||
_ec.Object.Global.EnvironmentVariables = new Dictionary<string, string>();
|
_ec.Object.Global.EnvironmentVariables = new Dictionary<string, string>();
|
||||||
var expressionValues = new DictionaryContextData
|
var expressionValues = new DictionaryContextData
|
||||||
{
|
{
|
||||||
["env"] =
|
["env"] =
|
||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
new DictionaryContextData{ { Constants.Variables.Actions.AllowUnsupportedStopCommandTokens, new StringContextData(allowUnsupportedStopCommandTokens) }}
|
new DictionaryContextData{ { Constants.Variables.Actions.AllowUnsupportedStopCommandTokens, new StringContextData(allowUnsupportedStopCommandTokens) }}
|
||||||
#else
|
#else
|
||||||
new CaseSensitiveDictionaryContextData { { Constants.Variables.Actions.AllowUnsupportedStopCommandTokens, new StringContextData(allowUnsupportedStopCommandTokens) } }
|
new CaseSensitiveDictionaryContextData{ { Constants.Variables.Actions.AllowUnsupportedStopCommandTokens, new StringContextData(allowUnsupportedStopCommandTokens) }}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
_ec.Setup(x => x.ExpressionValues).Returns(expressionValues);
|
_ec.Setup(x => x.ExpressionValues).Returns(expressionValues);
|
||||||
_ec.Setup(x => x.JobTelemetry).Returns(new List<JobTelemetry>());
|
_ec.Setup(x => x.JobTelemetry).Returns(new List<JobTelemetry>());
|
||||||
|
|
||||||
@@ -418,31 +418,6 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Worker")]
|
|
||||||
public void AddMaskWithMultilineValue()
|
|
||||||
{
|
|
||||||
using (TestHostContext hc = CreateTestContext())
|
|
||||||
{
|
|
||||||
// Act
|
|
||||||
_commandManager.TryProcessCommand(_ec.Object, $"::add-mask::abc%0Ddef%0Aghi%0D%0Ajkl", null);
|
|
||||||
_commandManager.TryProcessCommand(_ec.Object, $"::add-mask:: %0D %0A %0D%0A %0D", null);
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.Equal("***", hc.SecretMasker.MaskSecrets("abc"));
|
|
||||||
Assert.Equal("***", hc.SecretMasker.MaskSecrets("def"));
|
|
||||||
Assert.Equal("***", hc.SecretMasker.MaskSecrets("ghi"));
|
|
||||||
Assert.Equal("***", hc.SecretMasker.MaskSecrets("jkl"));
|
|
||||||
Assert.Equal("***", hc.SecretMasker.MaskSecrets("abc\rdef\nghi\r\njkl"));
|
|
||||||
Assert.Equal("", hc.SecretMasker.MaskSecrets(""));
|
|
||||||
Assert.Equal(" ", hc.SecretMasker.MaskSecrets(" "));
|
|
||||||
Assert.Equal(" ", hc.SecretMasker.MaskSecrets(" "));
|
|
||||||
Assert.Equal(" ", hc.SecretMasker.MaskSecrets(" "));
|
|
||||||
Assert.Equal(" ", hc.SecretMasker.MaskSecrets(" "));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private TestHostContext CreateTestContext([CallerMemberName] string testName = "")
|
private TestHostContext CreateTestContext([CallerMemberName] string testName = "")
|
||||||
{
|
{
|
||||||
var hostContext = new TestHostContext(this, testName);
|
var hostContext = new TestHostContext(this, testName);
|
||||||
@@ -456,7 +431,6 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
new InternalPluginSetRepoPathCommandExtension(),
|
new InternalPluginSetRepoPathCommandExtension(),
|
||||||
new SetEnvCommandExtension(),
|
new SetEnvCommandExtension(),
|
||||||
new WarningCommandExtension(),
|
new WarningCommandExtension(),
|
||||||
new AddMaskCommandExtension(),
|
|
||||||
};
|
};
|
||||||
foreach (var command in commands)
|
foreach (var command in commands)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
_message = new Pipelines.AgentJobRequestMessage(plan, timeline, jobId, "test", "test", null, null, null, new Dictionary<string, VariableValue>(), new List<MaskHint>(), new Pipelines.JobResources(), new Pipelines.ContextData.DictionaryContextData(), new Pipelines.WorkspaceOptions(), steps, null, null, null, null);
|
_message = new Pipelines.AgentJobRequestMessage(plan, timeline, jobId, "test", "test", null, null, null, new Dictionary<string, VariableValue>(), new List<MaskHint>(), new Pipelines.JobResources(), new Pipelines.ContextData.DictionaryContextData(), new Pipelines.WorkspaceOptions(), steps, null, null, null, null);
|
||||||
GitHubContext github = new GitHubContext();
|
GitHubContext github = new GitHubContext();
|
||||||
github["repository"] = new Pipelines.ContextData.StringContextData("actions/runner");
|
github["repository"] = new Pipelines.ContextData.StringContextData("actions/runner");
|
||||||
github["secret_source"] = new Pipelines.ContextData.StringContextData("Actions");
|
|
||||||
_message.ContextData.Add("github", github);
|
_message.ContextData.Add("github", github);
|
||||||
|
|
||||||
hc.SetSingleton(_actionManager.Object);
|
hc.SetSingleton(_actionManager.Object);
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;linux-musl-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
|
<AssetTargetFallback>portable-net45+win8</AssetTargetFallback>
|
||||||
<NoWarn>NU1701;NU1603;NU1603;xUnit2013;</NoWarn>
|
<NoWarn>NU1701;NU1603;NU1603;xUnit2013;</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
|
||||||
<PackageReference Include="xunit" Version="2.4.1" />
|
<PackageReference Include="xunit" Version="2.4.1" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||||
<PackageReference Include="System.Buffers" Version="4.3.0" />
|
<PackageReference Include="System.Buffers" Version="4.3.0" />
|
||||||
|
|||||||
119
src/dev.sh
119
src/dev.sh
@@ -14,15 +14,10 @@ DEV_TARGET_RUNTIME=$3
|
|||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
LAYOUT_DIR="$SCRIPT_DIR/../_layout"
|
LAYOUT_DIR="$SCRIPT_DIR/../_layout"
|
||||||
LAYOUT_TRIMS_DIR="$SCRIPT_DIR/../_layout_trims"
|
|
||||||
LAYOUT_TRIM_EXTERNALS_DIR="$LAYOUT_TRIMS_DIR/trim_externals"
|
|
||||||
LAYOUT_TRIM_RUNTIME_DIR="$LAYOUT_TRIMS_DIR/trim_runtime"
|
|
||||||
LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR="$LAYOUT_TRIMS_DIR/trim_runtime_externals"
|
|
||||||
DOWNLOAD_DIR="$SCRIPT_DIR/../_downloads/netcore2x"
|
DOWNLOAD_DIR="$SCRIPT_DIR/../_downloads/netcore2x"
|
||||||
PACKAGE_DIR="$SCRIPT_DIR/../_package"
|
PACKAGE_DIR="$SCRIPT_DIR/../_package"
|
||||||
PACKAGE_TRIMS_DIR="$SCRIPT_DIR/../_package_trims"
|
|
||||||
DOTNETSDK_ROOT="$SCRIPT_DIR/../_dotnetsdk"
|
DOTNETSDK_ROOT="$SCRIPT_DIR/../_dotnetsdk"
|
||||||
DOTNETSDK_VERSION="6.0.100"
|
DOTNETSDK_VERSION="3.1.302"
|
||||||
DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION"
|
DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION"
|
||||||
RUNNER_VERSION=$(cat runnerversion)
|
RUNNER_VERSION=$(cat runnerversion)
|
||||||
|
|
||||||
@@ -52,6 +47,10 @@ elif [[ "$CURRENT_PLATFORM" == 'linux' ]]; then
|
|||||||
aarch64) RUNTIME_ID="linux-arm64";;
|
aarch64) RUNTIME_ID="linux-arm64";;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "/lib/ld-musl-x86_64.so.1" ]; then
|
||||||
|
RUNTIME_ID="linux-musl-x64"
|
||||||
|
fi
|
||||||
elif [[ "$CURRENT_PLATFORM" == 'darwin' ]]; then
|
elif [[ "$CURRENT_PLATFORM" == 'darwin' ]]; then
|
||||||
RUNTIME_ID='osx-x64'
|
RUNTIME_ID='osx-x64'
|
||||||
fi
|
fi
|
||||||
@@ -62,7 +61,7 @@ fi
|
|||||||
|
|
||||||
# Make sure current platform support publish the dotnet runtime
|
# Make sure current platform support publish the dotnet runtime
|
||||||
# Windows can publish win-x86/x64
|
# Windows can publish win-x86/x64
|
||||||
# Linux can publish linux-x64/arm/arm64
|
# Linux can publish linux-x64/arm/arm64/musl-x64
|
||||||
# OSX can publish osx-x64
|
# OSX can publish osx-x64
|
||||||
if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then
|
if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then
|
||||||
if [[ ("$RUNTIME_ID" != 'win-x86') && ("$RUNTIME_ID" != 'win-x64') ]]; then
|
if [[ ("$RUNTIME_ID" != 'win-x86') && ("$RUNTIME_ID" != 'win-x64') ]]; then
|
||||||
@@ -70,7 +69,7 @@ if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
elif [[ "$CURRENT_PLATFORM" == 'linux' ]]; then
|
elif [[ "$CURRENT_PLATFORM" == 'linux' ]]; then
|
||||||
if [[ ("$RUNTIME_ID" != 'linux-x64') && ("$RUNTIME_ID" != 'linux-x86') && ("$RUNTIME_ID" != 'linux-arm64') && ("$RUNTIME_ID" != 'linux-arm') ]]; then
|
if [[ ("$RUNTIME_ID" != 'linux-x64') && ("$RUNTIME_ID" != 'linux-musl-x64') && ("$RUNTIME_ID" != 'linux-arm64') && ("$RUNTIME_ID" != 'linux-arm') ]]; then
|
||||||
echo "Failed: Can't build $RUNTIME_ID package $CURRENT_PLATFORM" >&2
|
echo "Failed: Can't build $RUNTIME_ID package $CURRENT_PLATFORM" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -132,48 +131,6 @@ function layout ()
|
|||||||
|
|
||||||
heading "Setup externals folder for $RUNTIME_ID runner's layout"
|
heading "Setup externals folder for $RUNTIME_ID runner's layout"
|
||||||
bash ./Misc/externals.sh $RUNTIME_ID || checkRC externals.sh
|
bash ./Misc/externals.sh $RUNTIME_ID || checkRC externals.sh
|
||||||
|
|
||||||
heading "Create layout (Trimmed) ..."
|
|
||||||
|
|
||||||
rm -Rf "$LAYOUT_TRIMS_DIR"
|
|
||||||
mkdir -p "$LAYOUT_TRIMS_DIR"
|
|
||||||
mkdir -p "$LAYOUT_TRIMS_DIR/runtime"
|
|
||||||
cp -r "$LAYOUT_DIR/bin/." "$LAYOUT_TRIMS_DIR/runtime"
|
|
||||||
mkdir -p "$LAYOUT_TRIMS_DIR/externals"
|
|
||||||
cp -r "$LAYOUT_DIR/externals/." "$LAYOUT_TRIMS_DIR/externals"
|
|
||||||
|
|
||||||
pushd "$LAYOUT_TRIMS_DIR/runtime" > /dev/null
|
|
||||||
if [[ ("$CURRENT_PLATFORM" == "windows") ]]; then
|
|
||||||
sed -i 's/\n$/\r\n/' "$SCRIPT_DIR/Misc/runnercoreassets"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat "$SCRIPT_DIR/Misc/runnercoreassets" | xargs rm -f
|
|
||||||
find . -empty -type d -delete
|
|
||||||
find . -type f > "$LAYOUT_TRIMS_DIR/runnerdotnetruntimeassets"
|
|
||||||
popd > /dev/null
|
|
||||||
|
|
||||||
heading "Create layout with externals trimmed ..."
|
|
||||||
mkdir -p "$LAYOUT_TRIM_EXTERNALS_DIR"
|
|
||||||
cp -r "$LAYOUT_DIR/." "$LAYOUT_TRIM_EXTERNALS_DIR/"
|
|
||||||
rm -Rf "$LAYOUT_TRIM_EXTERNALS_DIR/externals"
|
|
||||||
echo "Created... $LAYOUT_TRIM_EXTERNALS_DIR"
|
|
||||||
|
|
||||||
heading "Create layout with dotnet runtime trimmed ..."
|
|
||||||
mkdir -p "$LAYOUT_TRIM_RUNTIME_DIR"
|
|
||||||
cp -r "$LAYOUT_DIR/." "$LAYOUT_TRIM_RUNTIME_DIR/"
|
|
||||||
pushd "$LAYOUT_TRIM_RUNTIME_DIR/bin" > /dev/null
|
|
||||||
cat "$LAYOUT_TRIMS_DIR/runnerdotnetruntimeassets" | xargs rm -f
|
|
||||||
echo "Created... $LAYOUT_TRIM_RUNTIME_DIR"
|
|
||||||
popd > /dev/null
|
|
||||||
|
|
||||||
heading "Create layout with externals and dotnet runtime trimmed ..."
|
|
||||||
mkdir -p "$LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR"
|
|
||||||
cp -r "$LAYOUT_DIR/." "$LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR/"
|
|
||||||
rm -Rf "$LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR/externals"
|
|
||||||
pushd "$LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR/bin" > /dev/null
|
|
||||||
cat "$LAYOUT_TRIMS_DIR/runnerdotnetruntimeassets" | xargs rm -f
|
|
||||||
echo "Created... $LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR"
|
|
||||||
popd > /dev/null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function runtest ()
|
function runtest ()
|
||||||
@@ -203,9 +160,7 @@ function package ()
|
|||||||
find "${LAYOUT_DIR}/bin" -type f -name '*.pdb' -delete
|
find "${LAYOUT_DIR}/bin" -type f -name '*.pdb' -delete
|
||||||
|
|
||||||
mkdir -p "$PACKAGE_DIR"
|
mkdir -p "$PACKAGE_DIR"
|
||||||
mkdir -p "$PACKAGE_TRIMS_DIR"
|
|
||||||
rm -Rf "${PACKAGE_DIR:?}"/*
|
rm -Rf "${PACKAGE_DIR:?}"/*
|
||||||
rm -Rf "${PACKAGE_TRIMS_DIR:?}"/*
|
|
||||||
|
|
||||||
pushd "$PACKAGE_DIR" > /dev/null
|
pushd "$PACKAGE_DIR" > /dev/null
|
||||||
|
|
||||||
@@ -223,66 +178,6 @@ function package ()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
runner_trim_externals_pkg_name="actions-runner-${RUNTIME_ID}-${runner_ver}-noexternals"
|
|
||||||
heading "Packaging ${runner_trim_externals_pkg_name} (Trimmed)"
|
|
||||||
|
|
||||||
PACKAGE_TRIM_EXTERNALS_DIR="$PACKAGE_TRIMS_DIR/trim_externals"
|
|
||||||
mkdir -p "$PACKAGE_TRIM_EXTERNALS_DIR"
|
|
||||||
pushd "$PACKAGE_TRIM_EXTERNALS_DIR" > /dev/null
|
|
||||||
if [[ ("$CURRENT_PLATFORM" == "linux") || ("$CURRENT_PLATFORM" == "darwin") ]]; then
|
|
||||||
tar_name="${runner_trim_externals_pkg_name}.tar.gz"
|
|
||||||
echo "Creating $tar_name in ${LAYOUT_TRIM_EXTERNALS_DIR}"
|
|
||||||
tar -czf "${tar_name}" -C "${LAYOUT_TRIM_EXTERNALS_DIR}" .
|
|
||||||
elif [[ ("$CURRENT_PLATFORM" == "windows") ]]; then
|
|
||||||
zip_name="${runner_trim_externals_pkg_name}.zip"
|
|
||||||
echo "Convert ${LAYOUT_TRIM_EXTERNALS_DIR} to Windows style path"
|
|
||||||
window_path=${LAYOUT_TRIM_EXTERNALS_DIR:1}
|
|
||||||
window_path=${window_path:0:1}:${window_path:1}
|
|
||||||
echo "Creating $zip_name in ${window_path}"
|
|
||||||
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "Add-Type -Assembly \"System.IO.Compression.FileSystem\"; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"${window_path}\", \"${zip_name}\")"
|
|
||||||
fi
|
|
||||||
popd > /dev/null
|
|
||||||
|
|
||||||
runner_trim_runtime_pkg_name="actions-runner-${RUNTIME_ID}-${runner_ver}-noruntime"
|
|
||||||
heading "Packaging ${runner_trim_runtime_pkg_name} (Trimmed)"
|
|
||||||
|
|
||||||
PACKAGE_TRIM_RUNTIME_DIR="$PACKAGE_TRIMS_DIR/trim_runtime"
|
|
||||||
mkdir -p "$PACKAGE_TRIM_RUNTIME_DIR"
|
|
||||||
pushd "$PACKAGE_TRIM_RUNTIME_DIR" > /dev/null
|
|
||||||
if [[ ("$CURRENT_PLATFORM" == "linux") || ("$CURRENT_PLATFORM" == "darwin") ]]; then
|
|
||||||
tar_name="${runner_trim_runtime_pkg_name}.tar.gz"
|
|
||||||
echo "Creating $tar_name in ${LAYOUT_TRIM_RUNTIME_DIR}"
|
|
||||||
tar -czf "${tar_name}" -C "${LAYOUT_TRIM_RUNTIME_DIR}" .
|
|
||||||
elif [[ ("$CURRENT_PLATFORM" == "windows") ]]; then
|
|
||||||
zip_name="${runner_trim_runtime_pkg_name}.zip"
|
|
||||||
echo "Convert ${LAYOUT_TRIM_RUNTIME_DIR} to Windows style path"
|
|
||||||
window_path=${LAYOUT_TRIM_RUNTIME_DIR:1}
|
|
||||||
window_path=${window_path:0:1}:${window_path:1}
|
|
||||||
echo "Creating $zip_name in ${window_path}"
|
|
||||||
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "Add-Type -Assembly \"System.IO.Compression.FileSystem\"; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"${window_path}\", \"${zip_name}\")"
|
|
||||||
fi
|
|
||||||
popd > /dev/null
|
|
||||||
|
|
||||||
runner_trim_runtime_externals_pkg_name="actions-runner-${RUNTIME_ID}-${runner_ver}-noruntime-noexternals"
|
|
||||||
heading "Packaging ${runner_trim_runtime_externals_pkg_name} (Trimmed)"
|
|
||||||
|
|
||||||
PACKAGE_TRIM_RUNTIME_EXTERNALS_DIR="$PACKAGE_TRIMS_DIR/trim_runtime_externals"
|
|
||||||
mkdir -p "$PACKAGE_TRIM_RUNTIME_EXTERNALS_DIR"
|
|
||||||
pushd "$PACKAGE_TRIM_RUNTIME_EXTERNALS_DIR" > /dev/null
|
|
||||||
if [[ ("$CURRENT_PLATFORM" == "linux") || ("$CURRENT_PLATFORM" == "darwin") ]]; then
|
|
||||||
tar_name="${runner_trim_runtime_externals_pkg_name}.tar.gz"
|
|
||||||
echo "Creating $tar_name in ${LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR}"
|
|
||||||
tar -czf "${tar_name}" -C "${LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR}" .
|
|
||||||
elif [[ ("$CURRENT_PLATFORM" == "windows") ]]; then
|
|
||||||
zip_name="${runner_trim_runtime_externals_pkg_name}.zip"
|
|
||||||
echo "Convert ${LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR} to Windows style path"
|
|
||||||
window_path=${LAYOUT_TRIM_RUNTIME_EXTERNALS_DIR:1}
|
|
||||||
window_path=${window_path:0:1}:${window_path:1}
|
|
||||||
echo "Creating $zip_name in ${window_path}"
|
|
||||||
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "Add-Type -Assembly \"System.IO.Compression.FileSystem\"; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"${window_path}\", \"${zip_name}\")"
|
|
||||||
fi
|
|
||||||
popd > /dev/null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet") ]]; then
|
if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet") ]]; then
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"sdk": {
|
"sdk": {
|
||||||
"version": "6.0.100"
|
"version": "3.1.302"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.287.1
|
2.284.0
|
||||||
|
|||||||
Reference in New Issue
Block a user