mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2025-12-22 09:07:07 +00:00
Add rake tasks for common build process
This commit is contained in:
23
Rakefile
Normal file
23
Rakefile
Normal file
@@ -0,0 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
desc 'Cleanup old build files'
|
||||
task :clean do
|
||||
sh('sudo rm -rf out')
|
||||
sh('rm build_tools*.tar.gz')
|
||||
end
|
||||
|
||||
desc 'Build version anew'
|
||||
task build: :clean do
|
||||
sh('mkdir out')
|
||||
sh('docker build --tag onlyoffice-document-editors-builder .')
|
||||
sh("docker run -v #{Dir.pwd}/out:/build_tools/out onlyoffice-document-editors-builder")
|
||||
end
|
||||
|
||||
desc 'Archive current build version'
|
||||
task :archive do
|
||||
commit_hash = `git rev-parse --short HEAD`.strip
|
||||
branch = `git rev-parse --abbrev-ref HEAD`.gsub('/', '_').strip
|
||||
current_data = Time.now.strftime('%Y.%m.%d-%H.%M')
|
||||
archive_name = "build_tools-#{branch}-#{commit_hash}-#{current_data}.tar.gz"
|
||||
sh("tar -zcvf #{archive_name} out")
|
||||
end
|
||||
Reference in New Issue
Block a user