2020-06-20 16:56:19 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
require 'time'
|
|
|
|
|
|
|
|
system("bin/cleanup_dokuwiki")
|
|
|
|
|
|
|
|
tag = ARGV[0]
|
|
|
|
|
|
|
|
unless tag
|
|
|
|
puts "Usage: #{$0} <tag>"
|
|
|
|
|
2020-06-13 21:49:54 +00:00
|
|
|
exit 1
|
2020-06-20 16:56:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Dir.chdir "dokuwiki" do
|
|
|
|
system("git fetch")
|
|
|
|
system("git checkout #{tag}")
|
|
|
|
|
|
|
|
if $? != 0
|
|
|
|
puts "Tag not found!"
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
puts "#{tag} exists, updating files"
|
|
|
|
|
|
|
|
today = Time.now.strftime('%Y-%m-%d')
|
|
|
|
version = tag.gsub(/^release_(stable|candidate)_/, '')
|
|
|
|
|
|
|
|
File.open('.sandstorm/app-marketing-version', 'w') { |fh| fh.puts "#{version}~#{today}" }
|
|
|
|
|
|
|
|
lines = File.readlines('.sandstorm/sandstorm-pkgdef.capnp')
|
|
|
|
|
|
|
|
lines = lines.map do |line|
|
|
|
|
next line unless line['appVersion']
|
|
|
|
|
2020-09-01 23:26:34 +00:00
|
|
|
line.gsub(/= ([0-9]+),/) { |m| "= #{$1.to_i + 1}," }
|
2020-06-20 16:56:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
File.open('.sandstorm/sandstorm-pkgdef.capnp', 'w') { |fh| fh.print lines.join }
|
|
|
|
|
|
|
|
puts "Now:"
|
|
|
|
puts
|
|
|
|
puts "vagrant-spk vm destroy"
|
|
|
|
puts "vagrant-spk vm up"
|
|
|
|
puts "vagrant-spk dev to Test locally"
|
|
|
|
puts "vagrant-spk pack ../dokuwiki-sandstorm-#{version}.pkg"
|
|
|
|
puts "Test upgrade"
|
|
|
|
puts "vagrant-spk publish ../dokuwiki-sandstorm-#{version}.pkg"
|
2020-06-13 21:49:54 +00:00
|
|
|
|