summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc A. Paradise2020-02-04 12:10:55 -0500
committerMarc A. Paradise2020-02-04 12:11:18 -0500
commit9d31c013226cabe4ccab0fb2bfba408b2f688f98 (patch)
treeee663c4b2e3ccd7aee9b5a8f067abada31b067b5
parent3b454d267ff1f29c071bbe36d9883afd328546c1 (diff)
downloadaur-9d31c013226cabe4ccab0fb2bfba408b2f688f98.tar.gz
Make updates scripted
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
-rw-r--r--.gitignore1
-rw-r--r--Gemfile2
-rw-r--r--Makefile3
-rw-r--r--PKGBUILD7
-rw-r--r--update.rb30
5 files changed, 37 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index f05a7493bf44..62844c527a03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
/src/
/*.deb
/*.tar.xz
+Gemfile.lock
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 000000000000..383c431e141f
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,2 @@
+gem "mixlib-install"
+
diff --git a/Makefile b/Makefile
index 45e9310685c8..67fd70da7555 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
default: build
build: clean namcap
+ rm Gemfile.lock
+ bundle install
+ bundle exec ruby update.rb
makepkg
makepkg --printsrcinfo > .SRCINFO
diff --git a/PKGBUILD b/PKGBUILD
index cf0a632afb4f..28c7915aa7ee 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,8 +3,6 @@
pkgname=chef-workstation
pkgver=0.14.16
pkgrel=1
-_ubunturel=18
-_ubuntuver=04
pkgdesc="Chef Workstation gives you everything you need to get started with Chef. Start scanning and configuring your environments today with InSpec and chef-run."
arch=('x86_64')
url="https://downloads.chef.io/chef-workstation/"
@@ -19,10 +17,7 @@ package() {
bsdtar -xf data.tar.xz -C "$pkgdir"
mkdir -p "$pkgdir/usr/bin"
-
- chefdk_binaries="berks chef chef-apply chef-client chef-shell chef-solo chef-vault cookstyle dco delivery foodcritic inspec kitchen knife ohai push-apply pushy-client pushy-service-manager"
- binaries="chef-run chefx $chefdk_binaries"
-
+ binaries="chef-run berks chef chef-apply chef-client chef-shell chef-solo chef-vault cookstyle dco delivery foodcritic inspec kitchen knife ohai push-apply pushy-client pushy-service-manager"
for binary in $binaries; do
ln -s "/opt/$pkgname/bin/$binary" "$pkgdir/usr/bin/" || error_exit "Cannot link $binary to /usr/bin"
done
diff --git a/update.rb b/update.rb
new file mode 100644
index 000000000000..bdaac6f4c29b
--- /dev/null
+++ b/update.rb
@@ -0,0 +1,30 @@
+require 'mixlib/install'
+require 'json'
+
+options = {
+ channel: :stable,
+ product_name: 'chef-workstation',
+ platform: "ubuntu",
+ platform_version: "18.04",
+ architecture: "x86_64"
+}
+
+artifact = Mixlib::Install.new(options).artifact_info
+pkgbuild = File.read("PKGBUILD")
+pkgbuild.split("\n").each do |line|
+ if line =~ /pkgver=(.*)/
+ puts "#{$1} → #{artifact.version}"
+ if $1 == artifact.version
+ puts "This version is already current!"
+ exit 1
+ end
+ break
+ end
+end
+
+pkgbuild = pkgbuild.gsub(/pkgver=.*/, "pkgver=#{artifact.version}").
+ gsub(/sha256sums=.*/, "sha256sums=('#{artifact.sha256}')").
+ gsub(/source=.*/, "source=('#{artifact.url}')").
+ gsub(/arch=.*/, "arch=('#{artifact.architecture}')")
+
+File.open("PKGBUILD", "w") { |f| f.write(pkgbuild) }