From e58bc11b60c6781deb5b172e674cac405d4b4d6d Mon Sep 17 00:00:00 2001 From: Aria Li Date: Mon, 22 Apr 2024 14:54:35 -0700 Subject: [PATCH] (PUP-12031) Add Rake task for building puppet gems This commit adds a Rake task, gem:build, that will build all puppet gems which includes the three platform specific puppet gems: x86-mingw32, x64-mingw32, and universal-darwin --- Rakefile | 13 +++++++++++++ ext/project_data.yaml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index b03184d7eee..806e1c04dfb 100644 --- a/Rakefile +++ b/Rakefile @@ -45,6 +45,19 @@ task :default do sh %{rake -T} end +namespace :pl_ci do + desc 'Build puppet gems' + task :gem_build do + stdout, stderr, status = Open3.capture3('gem build puppet.gemspec --platform x86-mingw32 && gem build puppet.gemspec --platform x64-mingw32 && gem build puppet.gemspec --platform universal-darwin && gem build puppet.gemspec') + if !status.exitstatus.zero? + puts "Error building facter.gemspec \n#{stdout} \n#{stderr}" + exit(1) + else + puts stdout + end + end +end + task :spec do ENV["LOG_SPEC_ORDER"] = "true" sh %{rspec #{ENV['TEST'] || ENV['TESTS'] || 'spec'}} diff --git a/ext/project_data.yaml b/ext/project_data.yaml index 43e549795ab..91adc895e4d 100644 --- a/ext/project_data.yaml +++ b/ext/project_data.yaml @@ -7,4 +7,4 @@ gem_rdoc_options: - README.md - --line-numbers pre_tasks: - 'package:apple': 'cfpropertylist' \ No newline at end of file + 'package:apple': 'cfpropertylist'