summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher A. Snapp <csnapp@chef.io>2020-05-28 09:00:30 -0600
committerChristopher A. Snapp <csnapp@chef.io>2020-05-29 18:02:45 -0600
commitd6d0fee0c5779775a7493cd09776e73a666e1fb8 (patch)
tree6bf149eb4b1df7ddab914dcfc2976cc802948d7e
parent66cb0f6970c3e7f5838a67029f1c0c5b32ee6f85 (diff)
downloadchef-btm/azure-pipelines2.tar.gz
Add end_to_end test to PRs via Azure DevOps Pipelinesbtm/azure-pipelines2
Signed-off-by: Christopher A. Snapp <csnapp@chef.io>
-rw-r--r--azure-pipelines.yml88
1 files changed, 88 insertions, 0 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 0000000000..765812faf9
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,88 @@
+# End-to-End Test of Chef in MacOS
+
+variables:
+ FORCE_FFI_YAJL: 'ext'
+ CHEF_LICENSE: 'accept-no-persist'
+
+trigger:
+- master
+# TODO: 20190528 - should we be testing end_to_end on chef-15 and chef-14?
+#- chef-15
+#- chef-14
+
+pool:
+ vmImage: $(imageName)
+
+jobs:
+ - job:
+ strategy:
+ matrix:
+ linux:
+ imageName: 'ubuntu-latest'
+ mac:
+ imageName: 'macos-latest'
+
+ steps:
+ - script: |
+ curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -c current
+ /opt/chef/bin/chef-client -v
+ /opt/chef/bin/ohai -v
+ /opt/chef/embedded/bin/rake --version
+ /opt/chef/embedded/bin/bundle -v
+ displayName: 'Install Chef/Ohai from Omnitruck'
+
+ - script: |
+ OHAI_VERSION=$(sed -n '/ohai .[0-9]/{s/.*(//;s/)//;p;}' Gemfile.lock)
+ sudo /opt/chef/embedded/bin/gem install appbundler appbundle-updater --no-doc
+ sudo /opt/chef/embedded/bin/appbundle-updater chef ohai v${OHAI_VERSION} --tarball --github chef/ohai
+ sudo /opt/chef/embedded/bin/appbundle-updater chef chef $BUILD_SOURCEVERSION --tarball --github chef/chef
+ echo "Installed Chef / Ohai release:"
+ /opt/chef/bin/chef-client -v
+ /opt/chef/bin/ohai -v
+ displayName: 'Upgrade Chef/Ohai via Appbundler'
+
+ - script: |
+ cd kitchen-tests
+ sudo /opt/chef/embedded/bin/bundle config set without 'omnibus_package docgen ruby_prof'
+ sudo /opt/chef/embedded/bin/bundle install --jobs=3 --retry=3 --path=vendor/bundle
+ sudo /opt/chef/embedded/bin/gem install berkshelf --no-doc
+ sudo /opt/chef/embedded/bin/berks vendor cookbooks
+ sudo /opt/chef/bin/chef-client -z -o end_to_end --chef-license accept-no-persist
+ displayName: 'Run end_to_end::default recipe'
+
+ - job:
+ strategy:
+ matrix:
+ windows:
+ imageName: 'windows-latest'
+
+ steps:
+ - powershell: |
+ . { Invoke-WebRequest -useb https://omnitruck.chef.io/install.ps1 } | Invoke-Expression; Install-Project -project chef -channel current
+ $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH
+ chef-client -v
+ ohai -v
+ rake --version
+ bundle -v
+ displayName: 'Install Chef/Ohai from Omnitruck'
+
+ - powershell: |
+ $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH
+ $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } )
+ gem install appbundler appbundle-updater --no-doc
+ appbundle-updater chef ohai v$env:OHAI_VERSION --tarball --github chef/ohai
+ appbundle-updater chef chef $env:BUILD_SOURCEVERSION --tarball --github chef/chef
+ Write-Output "Installed Chef / Ohai release:"
+ chef-client -v
+ ohai -v
+ displayName: 'Upgrade Chef/Ohai via Appbundler'
+
+ - powershell: |
+ cd kitchen-tests
+ $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH
+ bundle config set without 'omnibus_package docgen ruby_prof'
+ bundle install --jobs=3 --retry=3 --path=vendor/bundle
+ gem install berkshelf --no-doc
+ berks vendor cookbooks
+ chef-client -z -o end_to_end --chef-license accept-no-persist
+ displayName: 'Run end_to_end::default recipe'