File indexing completed on 2022-09-27 15:18:55

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 setup_path = `pwd`
0032 p setup_path
0033 project = 'ring-kde'
0034 builder = CI.new
0035 unless Dir.exist?('app')
0036   Dir.mkdir('app')
0037 end
0038 unless Dir.exist?('appimage')
0039   Dir.mkdir('appimage')
0040 end
0041 builder.run = [CI::Build.new(project)]
0042 builder.cmd = %w[bash -c /in/setup.sh]
0043 builder.create_container(project)
0044 # begin
0045 #   PTY.spawn( cmd ) do |stdout, stdin, pid|
0046 #     begin
0047 #       # Do stuff with the output here. Just printing to show it works
0048 #       stdout.each { |line| print line }
0049 #     rescue Errno::EIO
0050 #       puts "Errno:EIO error, but this probably just means " +
0051 #             "that the process has finished giving output"
0052 #     end
0053 #   end
0054 # rescue PTY::ChildExited
0055 #   puts "The child process exited!"
0056 # end