File indexing completed on 2022-10-04 16:21:32

0001 #!/usr/bin/env ruby
0002 # frozen_string_literal: true
0003 #
0004 # Copyright (C) 2016 Scarlett Clark <sgclark@kde.org>
0005 # Copyright (C) 2015-2016 Harald Sitter <sitter@kde.org>
0006 #
0007 # This library is free software; you can redistribute it and/or
0008 # modify it under the terms of the GNU Lesser General Public
0009 # License as published by the Free Software Foundation; either
0010 # version 2.1 of the License, or (at your option) version 3, or any
0011 # later version accepted by the membership of KDE e.V. (or its
0012 # successor approved by the membership of KDE e.V.), which shall
0013 # act as a proxy defined in Section 6 of version 3 of the license.
0014 #
0015 # This library is distributed in the hope that it will be useful,
0016 # but WITHOUT ANY WARRANTY; without even the implied warranty of
0017 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018 # Lesser General Public License fo-r more details.
0019 #
0020 # You should have received a copy of the GNU Lesser General Public
0021 # License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0022 
0023 require_relative 'appimage-template/libs/builddocker.rb'
0024 require 'fileutils'
0025 require 'pty'
0026 
0027 if RUBY_VERSION =~ /1.9/ # assuming you're running Ruby ~1.9
0028   Encoding.default_external = Encoding::UTF_8
0029   Encoding.default_internal = Encoding::UTF_8
0030 end
0031 
0032 FileUtils.rm_rf("artifacts", secure: true)
0033 Dir.mkdir('artifacts')
0034 project = ENV["JOB_NAME"]
0035 builder = CI.new
0036 builder.run = [CI::Build.new(project)]
0037 builder.cmd = %w[bash -c /in/setup.sh]
0038 builder.create_container(project)