From 260998bff5eda5f402cf412ba5aa35638bb5e849 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 13:13:47 -0500 Subject: [PATCH 01/18] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..aa91291 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,19 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +steps: +- script: echo Hello, world! + displayName: 'Run a one-line script' + +- script: | + echo Add other tasks to build, test, and deploy your project. + echo See https://aka.ms/yaml + displayName: 'Run a multi-line script' From 4c4c59657d53938bb53cf9be6e6abe92d0ebf4e9 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 13:27:50 -0500 Subject: [PATCH 02/18] testing pipeline for nuspec build --- CIS4Azure.Tests.Pester.nuspec | 9 ++++++++- azure-pipelines-preview.yml | 36 +++++++++++++++++++++++++++++++++++ azure-pipelines.yml | 19 ------------------ 3 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 azure-pipelines-preview.yml delete mode 100644 azure-pipelines.yml diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index 5f862d0..cf22e21 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -11,6 +11,13 @@ - + + + + + + + + \ No newline at end of file diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml new file mode 100644 index 0000000..14f276b --- /dev/null +++ b/azure-pipelines-preview.yml @@ -0,0 +1,36 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +name: $(Rev:r) + +variables: + Major: 1 + Minor: 1 + Patch: $[counter(format('{0}.{1}', variables['Major'], variables['Minor'], 0))] + Version: '$(Major).$(Minor).$(Patch)-preview' + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +steps: +- task: NuGetCommand@2 + displayName: Pack NuGet package + inputs: + command: 'pack' + packagesToPack: 'CIS4Azure.Tests.Pester.nuspec' + versioningScheme: byEnvVar + versionEnvVar: 'Version' + +- task: NuGetCommand@2 + displayName: Push Pester Tests NuGet Package to Azure Artifacts + inputs: + command: 'push' + packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' + nuGetFeedType: 'internal' + publishVstsFeed: 'sample-pester-tests' + diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index aa91291..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- master - -pool: - vmImage: 'ubuntu-latest' - -steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' - -- script: | - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script' From d194ed95877332aa59b49e2b94bc5f630c2627cb Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 13:34:30 -0500 Subject: [PATCH 03/18] Fixed formatting error in files spec --- CIS4Azure.Tests.Pester.nuspec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index cf22e21..71d53ef 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -11,13 +11,13 @@ - - - - - - - - + + + + + + + + \ No newline at end of file From faa1f7774bf9d507871e2b2da6e72daaf13aec4c Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 13:45:47 -0500 Subject: [PATCH 04/18] Update azure-pipelines-preview.yml for Azure Pipelines manuallly specifying vresion --- azure-pipelines-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml index 14f276b..aa99e29 100644 --- a/azure-pipelines-preview.yml +++ b/azure-pipelines-preview.yml @@ -24,7 +24,7 @@ steps: command: 'pack' packagesToPack: 'CIS4Azure.Tests.Pester.nuspec' versioningScheme: byEnvVar - versionEnvVar: 'Version' + versionEnvVar: '1.1.0' - task: NuGetCommand@2 displayName: Push Pester Tests NuGet Package to Azure Artifacts From 07b1ac99c958192702fd2cad9ba1ff056dcf5304 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 13:50:28 -0500 Subject: [PATCH 05/18] Update azure-pipelines-preview.yml for Azure Pipelines trying to specify in a different spot --- azure-pipelines-preview.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml index aa99e29..b2bf71d 100644 --- a/azure-pipelines-preview.yml +++ b/azure-pipelines-preview.yml @@ -8,8 +8,7 @@ name: $(Rev:r) variables: Major: 1 Minor: 1 - Patch: $[counter(format('{0}.{1}', variables['Major'], variables['Minor'], 0))] - Version: '$(Major).$(Minor).$(Patch)-preview' + Version: '1.1.1-preview' trigger: - master @@ -24,7 +23,7 @@ steps: command: 'pack' packagesToPack: 'CIS4Azure.Tests.Pester.nuspec' versioningScheme: byEnvVar - versionEnvVar: '1.1.0' + versionEnvVar: 'Version - task: NuGetCommand@2 displayName: Push Pester Tests NuGet Package to Azure Artifacts From d1720d4c21b6501b7dd3343fdb210e81589a9c8c Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 13:56:09 -0500 Subject: [PATCH 06/18] Update azure-pipelines-preview.yml for Azure Pipelines 3rd way --- azure-pipelines-preview.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml index b2bf71d..d03a2a6 100644 --- a/azure-pipelines-preview.yml +++ b/azure-pipelines-preview.yml @@ -8,7 +8,8 @@ name: $(Rev:r) variables: Major: 1 Minor: 1 - Version: '1.1.1-preview' + Patch: 1 + Version: '$(Major).$(Minor).$(Patch)-preview' trigger: - master @@ -23,7 +24,7 @@ steps: command: 'pack' packagesToPack: 'CIS4Azure.Tests.Pester.nuspec' versioningScheme: byEnvVar - versionEnvVar: 'Version + versionEnvVar: 'Version' - task: NuGetCommand@2 displayName: Push Pester Tests NuGet Package to Azure Artifacts From ed244e3cfa2eddcbb50418067cee280895c0111e Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:03:47 -0500 Subject: [PATCH 07/18] Fixed pipeline... --- azure-pipelines-preview.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml index d03a2a6..3bdc219 100644 --- a/azure-pipelines-preview.yml +++ b/azure-pipelines-preview.yml @@ -1,4 +1,5 @@ # Starter pipeline + # Start with a minimal pipeline that you can customize to build and deploy your code. # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml @@ -9,7 +10,8 @@ variables: Major: 1 Minor: 1 Patch: 1 - Version: '$(Major).$(Minor).$(Patch)-preview' + Build: $[counter(format('{0}.{1}', variables['Major'], variables['Minor'], variables['Patch'], 0))] + Version: '$(Major).$(Minor).$(Patch).$(Build)-preview' trigger: - master @@ -25,12 +27,11 @@ steps: packagesToPack: 'CIS4Azure.Tests.Pester.nuspec' versioningScheme: byEnvVar versionEnvVar: 'Version' - + - task: NuGetCommand@2 - displayName: Push Pester Tests NuGet Package to Azure Artifacts inputs: command: 'push' packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' nuGetFeedType: 'internal' - publishVstsFeed: 'sample-pester-tests' + publishVstsFeed: '0c9f7885-2a77-4783-b820-e802e8a5c872/7c987d4d-459a-4f98-921c-c1f41db79528' From 8424f63c1976881ea291649dbab20e94d2374afd Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:22:00 -0500 Subject: [PATCH 08/18] created initial workflow for github action --- .github/workflows/test-nuget.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/test-nuget.yml diff --git a/.github/workflows/test-nuget.yml b/.github/workflows/test-nuget.yml new file mode 100644 index 0000000..b2340b2 --- /dev/null +++ b/.github/workflows/test-nuget.yml @@ -0,0 +1,17 @@ +name: CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Run a one-line script + run: echo Hello, world! + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. From bb61c37cab66528432e5634f4376f6f981ca6de9 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:27:42 -0500 Subject: [PATCH 09/18] added more specific ID so I can test nuget.org --- CIS4Azure.Tests.Pester.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index 71d53ef..8f49a69 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -2,7 +2,7 @@ - CIS4Azure.Tests.Pester + CIS4Azure.Tests.Pester.TJS 1.1.0 This is a suite of tests written using Pester (Powershell) that allows for testing of infrastructure against the CIS Benchmark for Azure at build-time. mgarner From c655d721c04355a110a7e64829b7fabb3a1a76f4 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:32:36 -0500 Subject: [PATCH 10/18] added license to nuspec --- CIS4Azure.Tests.Pester.nuspec | 1 + 1 file changed, 1 insertion(+) diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index 8f49a69..fcf5c75 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -10,6 +10,7 @@ + LICENSE From 6311cc05fdd9df9a03b0be0569194341d57cba3a Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:39:10 -0500 Subject: [PATCH 11/18] moved license to an optional header in metadata --- CIS4Azure.Tests.Pester.nuspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index fcf5c75..199de5f 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -8,9 +8,10 @@ mgarner + LICENSE - LICENSE + From 7e3f1d70521566b757e8525b3739c9440c5dcf0a Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:42:56 -0500 Subject: [PATCH 12/18] Trying license with expression --- CIS4Azure.Tests.Pester.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index 199de5f..38c26b3 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -8,7 +8,7 @@ mgarner - LICENSE + MIT From b5177d4ecd31dc2d0c7bcca589eadbda9200b089 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:50:15 -0500 Subject: [PATCH 13/18] checking to see if windows VM image fixes issue with nuget --- azure-pipelines-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml index 3bdc219..78590c7 100644 --- a/azure-pipelines-preview.yml +++ b/azure-pipelines-preview.yml @@ -17,7 +17,7 @@ trigger: - master pool: - vmImage: 'ubuntu-latest' + vmImage: 'windows-latest' steps: - task: NuGetCommand@2 From 7061fb32a39f3d36a97862e78f1dc00ac1651d1d Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:55:44 -0500 Subject: [PATCH 14/18] trying to removing metadata xmlns --- CIS4Azure.Tests.Pester.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index 38c26b3..0be4da8 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -1,5 +1,5 @@ - + CIS4Azure.Tests.Pester.TJS From 7900e70c05c99d1280e733ba2588dca8b2cd9965 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 15:58:35 -0500 Subject: [PATCH 15/18] trying differnt schema date --- CIS4Azure.Tests.Pester.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index 0be4da8..c314ba6 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -1,5 +1,5 @@ - + CIS4Azure.Tests.Pester.TJS From 8c0746e55da7e9560cc746ff26779a20c5f14322 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 16:00:28 -0500 Subject: [PATCH 16/18] Update azure-pipelines-preview.yml for Azure Pipelines --- azure-pipelines-preview.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml index 78590c7..b4b4ef5 100644 --- a/azure-pipelines-preview.yml +++ b/azure-pipelines-preview.yml @@ -1,5 +1,6 @@ # Starter pipeline + # Start with a minimal pipeline that you can customize to build and deploy your code. # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml @@ -20,6 +21,10 @@ pool: vmImage: 'windows-latest' steps: +- task: NuGetToolInstaller@1 + inputs: + versionSpec: '5.3.1' + checkLatest: true - task: NuGetCommand@2 displayName: Pack NuGet package inputs: From a865a41e1525e75de773a2b3ca0bf541d0a36261 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 16:23:51 -0500 Subject: [PATCH 17/18] Update azure-pipelines-preview.yml for Azure Pipelines test push to nuget.org --- azure-pipelines-preview.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml index b4b4ef5..d46d9ca 100644 --- a/azure-pipelines-preview.yml +++ b/azure-pipelines-preview.yml @@ -1,6 +1,4 @@ # Starter pipeline - - # Start with a minimal pipeline that you can customize to build and deploy your code. # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml @@ -37,6 +35,6 @@ steps: inputs: command: 'push' packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' - nuGetFeedType: 'internal' - publishVstsFeed: '0c9f7885-2a77-4783-b820-e802e8a5c872/7c987d4d-459a-4f98-921c-c1f41db79528' + nuGetFeedType: 'external' + publishFeedCredentials: 'nuget.org TJS CIS view' From 2c9cbc1393bd10eb7ac408dfdc7ba10bb04cd539 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 29 Oct 2019 16:31:31 -0500 Subject: [PATCH 18/18] Ready to pull into markgar version Removed github actions test, there seems to be a bug in the existing nuget build samples (link will be added to PR) Reverted CIS4Azure.Tests.Pester.nuspec to be more similar to existing one in mark repo. Updated schema version, added license, etc. This should be the initial version of the azure pipeline spec. Instructions on how to add to AzDO will be added to PR. --- .github/workflows/test-nuget.yml | 17 ----------------- CIS4Azure.Tests.Pester.nuspec | 2 +- azure-pipelines-preview.yml | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 .github/workflows/test-nuget.yml diff --git a/.github/workflows/test-nuget.yml b/.github/workflows/test-nuget.yml deleted file mode 100644 index b2340b2..0000000 --- a/.github/workflows/test-nuget.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: CI - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Run a one-line script - run: echo Hello, world! - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. diff --git a/CIS4Azure.Tests.Pester.nuspec b/CIS4Azure.Tests.Pester.nuspec index c314ba6..13707e7 100644 --- a/CIS4Azure.Tests.Pester.nuspec +++ b/CIS4Azure.Tests.Pester.nuspec @@ -2,7 +2,7 @@ - CIS4Azure.Tests.Pester.TJS + CIS4Azure.Tests.Pester 1.1.0 This is a suite of tests written using Pester (Powershell) that allows for testing of infrastructure against the CIS Benchmark for Azure at build-time. mgarner diff --git a/azure-pipelines-preview.yml b/azure-pipelines-preview.yml index d46d9ca..c8d2268 100644 --- a/azure-pipelines-preview.yml +++ b/azure-pipelines-preview.yml @@ -36,5 +36,5 @@ steps: command: 'push' packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' nuGetFeedType: 'external' - publishFeedCredentials: 'nuget.org TJS CIS view' + publishFeedCredentials: 'nuget.org'