Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add set proxy configuration #8

Merged
merged 62 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
5284c60
start the initial implementation of a set proxy script.
paule96 Jun 15, 2021
c8ff956
add npm support
paule96 Jun 15, 2021
64623e1
fixes a wired bug with npm
paule96 Jun 15, 2021
46dd92f
add apt configuration
paule96 Jun 19, 2021
22057d1
make the apt and npm implementation for linux more robust
paule96 Jun 19, 2021
9838be1
add docker config
paule96 Jun 19, 2021
eece8bc
add powershell configuration
paule96 Jun 19, 2021
7cdf657
add comment
paule96 Jun 19, 2021
5e78f38
add noroot switch
paule96 Jun 19, 2021
75d49d3
add environment configuration
paule96 Jun 19, 2021
da4dabe
unset proxy if there is no proxy address is defined
paule96 Jun 19, 2021
252e9f5
add working unset of proxy config
paule96 Jun 19, 2021
61c3680
add a sample for unsetting the proxy
paule96 Jun 19, 2021
252b32f
fix unsetting git proxy config
paule96 Jun 19, 2021
b2eb9c7
we can unset proxies now.
paule96 Jun 19, 2021
35c6192
fix file names
paule96 Jun 20, 2021
83ffe5b
add some basic tests
paule96 Jun 20, 2021
c3b175d
add dev container json
Aug 16, 2021
839bdc6
add dev container json
Aug 16, 2021
bb79e2d
Change devcontainer.json
paule96 Aug 16, 2021
827fda5
improve linux environment support
paule96 Oct 12, 2021
b966faa
improve samples
paule96 Oct 12, 2021
e5bb162
add tests for set-proxy function.
paule96 Oct 12, 2021
3934a19
add test pester extension to the workspace file
paule96 Oct 12, 2021
9f5b7ce
improve comment in set proxy
paule96 Oct 12, 2021
446e7ee
add first basic tests for set git proxy
paule96 Oct 12, 2021
9e44ce7
fix a git version deteciton issue
paule96 Oct 13, 2021
60dd9ec
add all missing tests for set-gitproxy
paule96 Oct 13, 2021
818e569
cleanup some test lines
paule96 Oct 13, 2021
175e8b9
add tests for full coverage for npm
paule96 Oct 13, 2021
4927016
fix regex bugs in apt get
paule96 Oct 13, 2021
ba5dbf1
add apt tests
paule96 Oct 13, 2021
3e20b87
cmdlet binding is important!1!!
paule96 Oct 13, 2021
e14048a
make the docker settings more stable
paule96 Oct 13, 2021
a15b987
add all docker tests
paule96 Oct 13, 2021
758974e
fix powershell bypasslist and make changes less often to the config
paule96 Oct 14, 2021
2a696c5
add all powershell tests
paule96 Oct 14, 2021
7490196
write test for environment variables
paule96 Oct 14, 2021
58d1a49
fix settings env variables linux
paule96 Oct 14, 2021
6b42bfb
fixing file finding for tests
paule96 Oct 14, 2021
f0cdbb0
try to fix azure pipeline
paule96 Oct 14, 2021
4533233
try to make multi os build
paule96 Oct 14, 2021
f93d0a3
try to fix job names
paule96 Oct 14, 2021
f02505b
try to fix job names again...
paule96 Oct 14, 2021
d2b412b
fix failed linux tests
paule96 Oct 14, 2021
4fea584
try to get a better coverage report
paule96 Oct 14, 2021
aa8dbfb
try to fix the coverage again
paule96 Oct 14, 2021
b7aa00a
try to merge test results
paule96 Oct 14, 2021
4165295
try to fix test merge again
paule96 Oct 14, 2021
51e0bc2
fix messages
paule96 Oct 15, 2021
69380f3
fix messags
paule96 Oct 15, 2021
0a6e848
fix messages
paule96 Oct 15, 2021
03f8d4e
fix tests
paule96 Oct 15, 2021
51c79c9
try to use matrix build in the pipeline
paule96 Oct 15, 2021
943d333
fix dependencie of build package
paule96 Oct 15, 2021
8080f26
our tests are not ready for mac now 🤷‍♀️
paule96 Oct 15, 2021
3c58c5b
try to fix coverage download
paule96 Oct 15, 2021
467779f
try to fix test output
paule96 Oct 15, 2021
be2fe04
try to fix macOS tests
paule96 Oct 15, 2021
2749cf0
fix tests again
paule96 Oct 15, 2021
772ffd7
fix skiping apt tests
paule96 Oct 15, 2021
417b677
try to finaly fix mac tests
paule96 Oct 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CZ.PowerShell.NetworkTools.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
// for well formatted documentation
"docsmsft.docs-authoring-pack",
// for good language
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
// for pester tests
"pspester.pester-test"
]
}
}
166 changes: 114 additions & 52 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,117 @@
trigger:
- main

pool:
vmImage: windows-latest

steps:
- task: PowerShell@2
displayName: "Run pester tests"
inputs:
targetType: 'inline'
script: |
Install-Module -Scope CurrentUser -Force -AllowClobber -SkipPublisherCheck Pester;
Import-Module Pester;
$configuration = [PesterConfiguration]::Default;
$configuration.CodeCoverage.Enabled = $true;
$configuration.CodeCoverage.Path = (Get-ChildItem src/*.ps1 | ForEach-Object{$_.FullName});
$configuration.CodeCoverage.OutputFormat = "JaCoCo";
$configuration.TestResult.Enabled = $true;
$configuration.Run.Exit = $true;
$configuration.Run.Path = (Get-ChildItem tests/*ps1 | ForEach-Object{$_.FullName});
Invoke-Pester -Configuration $configuration;
showWarnings: true
pwsh: true
- task: PowerShell@2
displayName: "Build the powershell package"
inputs:
filePath: 'build/build.ps1'
showWarnings: true
pwsh: true
- task: PowerShell@2
displayName: "Debug files"
inputs:
targetType: 'inline'
script: |
ls -Recurse | select FullName;
showWarnings: true
pwsh: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'src/bin/'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'testResults.xml'
failTaskOnFailedTests: true
testRunTitle: 'CZ.PowerShell.NetworkTools'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: 'coverage.xml'
pathToSources: 'src/'
failIfCoverageEmpty: true
jobs:
- job: 'tests'
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macOS-latest'
windows:
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
steps:
- task: PowerShell@2
displayName: "Run pester tests"
inputs:
targetType: 'inline'
script: |
Install-Module -Scope CurrentUser -Force -AllowClobber -SkipPublisherCheck Pester;
Import-Module Pester;
$configuration = [PesterConfiguration]::Default;
$configuration.CodeCoverage.Enabled = $true;
$configuration.CodeCoverage.Path = (Get-ChildItem src/*.ps1 | ForEach-Object{$_.FullName});
$configuration.CodeCoverage.OutputFormat = "JaCoCo";
$configuration.CodeCoverage.OutputPath = '$(imageName)-coverage.xml'
$configuration.TestResult.Enabled = $true;
$configuration.TestResult.OutputPath = '$(imageName)-testResults.xml'
$configuration.Run.Exit = $true;
$configuration.Run.Path = (Get-ChildItem tests/*ps1 | ForEach-Object{$_.FullName});
Invoke-Pester -Configuration $configuration;
showWarnings: true
pwsh: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Coverage'
condition: always()
inputs:
PathtoPublish: '$(imageName)-coverage.xml'
ArtifactName: 'coverage'
publishLocation: Container
- task: PublishBuildArtifacts@1
displayName: 'Publish Tests'
condition: always()
inputs:
PathtoPublish: '$(imageName)-testResults.xml'
ArtifactName: 'tests'
publishLocation: Container
- job: 'build_package'
pool:
vmImage: windows-latest
dependsOn:
- 'tests'
steps:
- task: PowerShell@2
displayName: "Build the powershell package"
inputs:
filePath: 'build/build.ps1'
showWarnings: true
pwsh: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'src/bin/'
ArtifactName: 'drop'
publishLocation: 'Container'
- job: 'publish_coverage_and_tests'
pool:
vmImage: windows-latest
dependsOn:
- 'tests'
steps:
# - task: DownloadBuildArtifacts@0
# displayName: 'Download Coverage Windows Artifacts'
# inputs:
# artifactName: windows-coverage
# downloadPath: $(System.DefaultWorkingDirectory)/
# - task: DownloadBuildArtifacts@0
# displayName: 'Download Coverage Linux Artifacts'
# inputs:
# artifactName: linux-coverage
# downloadPath: $(System.DefaultWorkingDirectory)/
# - task: DownloadBuildArtifacts@0
# displayName: 'Download Tests Windows Artifacts'
# inputs:
# artifactName: windows-tests
# downloadPath: $(System.DefaultWorkingDirectory)/
# - task: DownloadBuildArtifacts@0
# displayName: 'Download Tests Linux Artifacts'
# inputs:
# artifactName: linux-tests
# downloadPath: $(System.DefaultWorkingDirectory)/
- task: DownloadBuildArtifacts@1
displayName: 'Download All Tests Artifacts'
inputs:
artifactName: 'tests'
downloadPath: $(System.DefaultWorkingDirectory)/
- task: DownloadBuildArtifacts@1
displayName: 'Download All Coverage Artifacts'
inputs:
artifactName: 'coverage'
downloadPath: $(System.DefaultWorkingDirectory)/
- task: PublishCodeCoverageResults@1
condition: always()
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/*coverage.xml'
pathToSources: 'src/'
failIfCoverageEmpty: true
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(System.DefaultWorkingDirectory)/tests/*testResults.xml'
failTaskOnFailedTests: true
testRunTitle: 'CZ.PowerShell.NetworkTools'
mergeTestResults: true
24 changes: 24 additions & 0 deletions devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"files.trimTrailingWhitespace": true,
"cSpell.words": [
"cmdlet",
"paule"
]
},
"extensions": {
// for the powershell scripts
"ms-vscode.powershell",
// for the jupiter notebook integration for powershell
"ms-dotnettools.dotnet-interactive-vscode",
// for good language in the docs
"streetsidesoftware.code-spell-checker",
// for well formatted documentation
"docsmsft.docs-authoring-pack"
}
}
4 changes: 4 additions & 0 deletions samples/basic.noproxy.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"ProxyAddress": null,
"BypassList": []
}
6 changes: 6 additions & 0 deletions samples/basic.proxy.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ProxyAddress": "http://proxy.codez.one:80",
"BypassList": [
"git.codez.one"
]
}
3 changes: 3 additions & 0 deletions samples/basic.systemproxy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"UseSystemProxyAddress": true
}
Loading