Compare commits

..

No commits in common. "main" and "1.3.1" have entirely different histories.
main ... 1.3.1

10 changed files with 15 additions and 126 deletions

View file

@ -1,7 +0,0 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10

View file

@ -1,39 +0,0 @@
name: Release
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'puppetlabs/beaker-vmpooler'
steps:
- uses: actions/checkout@v3
- name: Get Version
id: gv
run: |
version=$(grep VERSION lib/beaker-vmpooler/version.rb |rev |cut -d "'" -f2 |rev)
echo "version=$version" >> $GITHUB_OUTPUT
echo "Found version $version from lib/beaker-vmpooler/version.rb"
- name: Tag Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.gv.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
generateReleaseNotes: true
- name: Install Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Build gem
run: gem build *.gemspec
- name: Publish gem
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem push *.gem
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'

View file

@ -1,39 +0,0 @@
name: Security
on:
workflow_dispatch:
push:
branches:
- main
jobs:
scan:
name: Mend Scanning
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
# setup a package lock if one doesn't exist, otherwise do nothing
- name: check lock
run: '[ -f "Gemfile.lock" ] && echo "package lock file exists, skipping" || bundle lock'
# install java
- uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
# download mend
- name: download_mend
run: curl -o wss-unified-agent.jar https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
- name: run mend
run: java -jar wss-unified-agent.jar
env:
WS_APIKEY: ${{ secrets.MEND_API_KEY }}
WS_WSS_URL: https://saas-eu.whitesourcesoftware.com/agent
WS_USERKEY: ${{ secrets.MEND_TOKEN }}
WS_PRODUCTNAME: RE
WS_PROJECTNAME: ${{ github.event.repository.name }}

View file

@ -1,26 +0,0 @@
name: Testing
on:
pull_request:
branches:
- main
jobs:
spec_tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run spec tests
run: bundle exec rake test

View file

@ -1,2 +0,0 @@
* @puppetlabs/release-engineering

11
Gemfile
View file

@ -1,6 +1,8 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
gemspec :development_group => :acceptance_testing
gemspec
def location_for(place, fake_version = nil)
if place =~ /^(git:[^#]*)#(.*)/
@ -12,13 +14,14 @@ def location_for(place, fake_version = nil)
end
end
# We don't put beaker in as a test dependency because we
# don't want to create a transitive dependency
group :acceptance_testing do
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 5.0', '< 7')
gem "beaker-abs"
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.0')
end
if File.exist? "#{__FILE__}.local"
if File.exists? "#{__FILE__}.local"
eval(File.read("#{__FILE__}.local"), binding)
end

View file

@ -20,8 +20,13 @@ Gem::Specification.new do |s|
# Testing dependencies
s.add_development_dependency 'rspec', '~> 3.0'
s.add_development_dependency 'rspec-its'
s.add_development_dependency 'fakefs', '~> 2.4'
s.add_development_dependency 'rake', '~> 13.0'
# pin fakefs for Ruby < 2.3
if RUBY_VERSION < "2.3"
s.add_development_dependency 'fakefs', '~> 0.6', '< 0.14'
else
s.add_development_dependency 'fakefs', '~> 0.6'
end
s.add_development_dependency 'rake', '~> 10.1'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'pry', '~> 0.10'

View file

@ -1,3 +1,3 @@
module BeakerVmpooler
VERSION = '1.4.0'
VERSION = '1.3.1'
end

View file

@ -114,7 +114,6 @@ module Beaker
uri = URI.parse(@options['pooling_api'] + '/vm/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Post.new(uri.request_uri)
if @credentials[:vmpooler_token]
@ -186,7 +185,6 @@ module Beaker
uri = URI.parse(@options[:pooling_api] + '/vm/' + h['vmhostname'].split('.')[0])
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Put.new(uri.request_uri)
# merge pre-defined tags with host tags
@ -252,7 +250,6 @@ module Beaker
uri = URI.parse(get_template_url(@options['pooling_api'], name))
http = Net::HTTP.new( uri.host, uri.port )
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Delete.new(uri.request_uri)
if @credentials[:vmpooler_token]
@ -280,7 +277,6 @@ module Beaker
uri = URI.parse(@options[:pooling_api] + '/api/v1/vm/' + hostname + '/disk/' + disk_size.to_s)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Post.new(uri.request_uri)
request['X-AUTH-TOKEN'] = @credentials[:vmpooler_token]
@ -313,7 +309,6 @@ module Beaker
uri = URI.parse(@options[:pooling_api] + '/vm/' + hostname)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)

View file

@ -5,7 +5,6 @@ module Beaker
before :each do
stub_const( "Net", MockNet )
allow_any_instance_of(MockNet::HTTP).to receive(:use_ssl=)
allow( JSON ).to receive( :parse ) do |arg|
arg
end