diff --git a/Gemfile b/Gemfile index fdea8d4..de80a0e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,10 @@ source 'http://rubygems.org' gem 'bundler' gem 'docker-api', git: 'https://github.com/swipely/docker-api' gem 'fileutils' gem 'logger' gem 'logger-colors' gem 'rspec' -gem 'rugged', git: 'https://github.com/libgit2/rugged.git', submodules: true gem 'test-unit' gem 'tty-command' gem 'zlib' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 5be0d88..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,66 +0,0 @@ -GIT - remote: https://github.com/libgit2/rugged.git - revision: ca994bb99f34fd7e2645d383b94e26313baccb37 - submodules: true - specs: - rugged (0.27.2) - -GIT - remote: https://github.com/swipely/docker-api - revision: 5765bf7a6c0414d132f00df9a61a4515e68d0d8e - specs: - docker-api (1.34.2) - excon (>= 0.47.0) - multi_json - -GEM - remote: http://rubygems.org/ - specs: - diff-lcs (1.3) - equatable (0.5.0) - excon (0.62.0) - fileutils (1.1.0) - logger (1.2.8) - logger-colors (1.0.0) - multi_json (1.13.1) - pastel (0.7.2) - equatable (~> 0.5.0) - tty-color (~> 0.4.0) - power_assert (1.1.3) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - test-unit (3.2.8) - power_assert - tty-color (0.4.3) - tty-command (0.8.2) - pastel (~> 0.7.0) - zlib (1.0.0) - -PLATFORMS - ruby - -DEPENDENCIES - bundler - docker-api! - fileutils - logger - logger-colors - rspec - rugged! - test-unit - tty-command - zlib - -BUNDLED WITH - 1.17.1 diff --git a/Jenkinsfile b/Jenkinsfile index 569d409..47b6b1f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,105 +1,105 @@ #!groovy /* The MIT License Copyright (c) 2015-, CloudBees, Inc., and a number of other of contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ pipeline { agent { node { label 'linux' } } environment { WORKSPACE=pwd() PATH="/opt/usr/bin:$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH" - JOB_NAME="mgmt_tooling_tests" + JOB_NAME="tests" RBENV_VERSION="2.5.0" } options { disableConcurrentBuilds() timestamps() buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3')) } triggers { pollSCM('H */4 * * 1-5') } stages { stage( 'Checkout' ) { steps { checkout scm } } stage( 'Setup' ) { steps { - sh 'echo "gem: --no-rdoc --no-ri" >> /var/lib/jenkins/.gemrc' + sh 'echo "gem: --no-rdoc --no-ri" >> $HOME/.gemrc' sh ''' - echo "BUNDLE_PATH: ~/vendor/bundle" >> /var/lib/jenkins/.bundle/config - echo 'BUNDLE_DISABLE_SHARED_GEMS: "1"' >> /var/lib/jenkins/.bundle/config + echo "BUNDLE_PATH: ~/vendor/bundle" >> $HOME/.bundle/config + echo 'BUNDLE_DISABLE_SHARED_GEMS: "1"' >> $HOME/.bundle/config ''' sh '''#!/usr/bin/env bash set -e echo $PATH if [[ ! -d ~/.rbenv ]] ; then git clone https://github.com/sstephenson/rbenv.git ~/.rbenv git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build git clone git://github.com/carsomyr/rbenv-bundler.git ~/.rbenv/plugins/bundler rbenv init - rbenv install 2.5.0 rbenv rehash else echo "Rbenv exists, moving on" - if [[ ! -d /var/lib/jenkins/.rbenv/versions/2.5.0 ]] ; then + if [[ ! -d $HOME/.rbenv/versions/2.5.0 ]] ; then rbenv install 2.5.0 rbenv rehash fi fi - echo 'eval "$(rbenv init -)"' >> /var/lib/jenkins/.bashrc && rbenv init - + echo 'eval "$(rbenv init -)"' >> $HOME/.bashrc && rbenv init - ''' sh '''#!/usr/bin/env bash set -e - export RBENV_ROOT=/var/lib/jenkins/.rbenv + export RBENV_ROOT=$HOME/.rbenv rbenv rehash - if [[ ! -d /var/lib/jenkins/.gem ]] ; then - rm -rfv /var/lib/jenkins/.gem + if [[ ! -d $HOME/.gem ]] ; then + rm -rfv $HOME/.gem fi which ruby ruby -v gem install --no-ri --no-rdoc bundler && rbenv rehash ''' } } stage( 'Build' ) { steps { sh 'rbenv init -' sh 'which ruby && ruby -v' sh '''#!/usr/bin/env bash set -e echo $PATH - cd $JOB_NAME && chmod +x setup.sh + pwd chmod +x tests/setup.sh bundle bundle show rspec rbenv rehash bundle list --paths bundle env bundle exec ruby tests/deploy.rb ''' } } stage('Tests') { steps { step([$class: 'LogParserPublisher', failBuildOnError: true, projectRulePath: "$JOB_NAME/appimage-template/parser.rules", showGraphs: true, unstableOnWarning: true, useProjectRule: true]) } } } } diff --git a/docker/Dockerfile b/docker/Dockerfile index 6f19d7e..4712e7f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,142 +1,149 @@ FROM ubuntu:16.04 RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list RUN echo "deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list RUN echo "deb http://ca.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list RUN echo "deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list RUN echo "deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list #link to bash RUN rm /bin/sh && ln -s /bin/bash /bin/sh RUN ln -s -f /bin/true /usr/bin/chfn #tooling dependencies RUN apt-get update && apt-get -y install wget git libreadline-dev cmake sudo \ bzip2 libssl-dev zlib1g-dev pkg-config # Create jenkins user -RUN groupadd -g 128 jenkins -RUN useradd -m -u 120 -g 128 -d /home/jenkins jenkins +RUN groupadd -g 127 jenkins +#Must match host. +RUN useradd -m -u 120 -g 127 -d /var/jenkins_home jenkins RUN mkdir -p /{artifacts,appimages,app.Dir,source,app} RUN chown jenkins.jenkins /appimages && chown jenkins.jenkins /app.Dir && chown jenkins.jenkins /source && \ chown jenkins.jenkins /artifacts && chown jenkins.jenkins /opt && chown jenkins.jenkins /app RUN adduser jenkins sudo RUN echo 'jenkins ALL=NOPASSWD: ALL' >> /etc/sudoers -RUN echo 'bundler ALL=NOPASSWD: /home/jenkins/.rbenv/bin/bundler' >> /etc/sudoers +RUN echo 'bundler ALL=NOPASSWD: /var/jenkins_home/.rbenv/bin/bundler' >> /etc/sudoers # Cpan perl lib needed by kf5 RUN cd $SOURCES && cpan URI::Escape # Everythin else as jenkins user USER jenkins #Set ENV ENV LD_LIBRARY_PATH /opt/usr/lib:/opt/usr/lib/gstreamer-1.0:/opt/usr/lib/x86_64-linux-gnu:/usr/lib:/usr/lib64:/lib -ENV PATH /opt/usr/bin:/home/jenkins/.rbenv/bin:/home/jenkins/.rbenv/shims:$PATH +ENV PATH /opt/usr/bin:/var/jenkins_home/.rbenv/bin:/var/jenkins_home/.rbenv/shims:$PATH ENV PKG_CONFIG_PATH /opt/usr/lib/pkgconfig:/opt/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig ENV CXXFLAGS -std=c++11 -fPIC ENV SOURCES /source # Install rbenv and ruby-build RUN echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc -RUN git clone https://github.com/sstephenson/rbenv.git /home/jenkins/.rbenv -RUN git clone https://github.com/sstephenson/ruby-build.git /home/jenkins/.rbenv/plugins/ruby-build -RUN git clone git://github.com/carsomyr/rbenv-bundler.git /home/jenkins/.rbenv/plugins/bundler +RUN git clone https://github.com/sstephenson/rbenv.git /var/jenkins_home/.rbenv +RUN git clone https://github.com/sstephenson/ruby-build.git /var/jenkins_home/.rbenv/plugins/ruby-build +RUN git clone git://github.com/carsomyr/rbenv-bundler.git /var/jenkins_home/.rbenv/plugins/bundler RUN rbenv install -v 2.5.0 && rbenv global 2.5.0 && rbenv rehash && gem install bundler && rbenv rehash -RUN mkdir /home/jenkins/.bundle -RUN echo "BUNDLE_PATH: ~/vendor/bundle" >> /home/jenkins/.bundle/config -RUN echo 'BUNDLE_DISABLE_SHARED_GEMS: "1"' >> /home/jenkins/.bundle/config -RUN echo 'eval "$(rbenv init -)"' >> /home/jenkins/.bashrc && rbenv init - -ADD Gemfile /home/jenkins/Gemfile -RUN cd /home/jenkins && bundle install --binstubs && bundle show rspec +RUN mkdir /var/jenkins_home/.bundle +RUN echo "BUNDLE_PATH: ~/vendor/bundle" >> /var/jenkins_home/.bundle/config +RUN echo 'BUNDLE_DISABLE_SHARED_GEMS: "1"' >> /var/jenkins_home/.bundle/config +RUN echo 'eval "$(rbenv init -)"' >> /var/jenkins_home/.bashrc && rbenv init - +ADD Gemfile /var/jenkins_home/Gemfile +RUN cd /var/jenkins_home && bundle install --binstubs && bundle show rspec # QT5 and KF5 dependencies RUN sudo apt-get update && sudo apt-get -y --force-yes install \ '^libxcb.*-dev' \ libhyphen-dev \ autoconf \ autopoint \ bzr \ clang-3.8 \ docbook-xml \ docbook-xsl \ doxygen \ festival \ festival-dev \ fftw-dev \ firebird-dev \ fonts-noto \ freeglut3-dev \ +gobject-introspection \ graphviz \ gtk-doc-tools \ guile-2.0-dev \ intltool \ libatkmm-1.6-dev \ libatomic-ops-dev \ +libattr1-dev \ libboost-all-dev \ libbz2-dev \ libcap-dev \ libclang-3.8-dev \ libdbus-glib-1-dev \ libdouble-conversion-dev \ libegl1-mesa-drivers \ libfftw3-dev \ libgegl-dev \ +libgirepository1.0-dev \ +libgif-dev \ libgit2-dev \ libglew-dev \ libglm-dev \ libgtk-3-dev \ libgudev-1.0-dev \ libical-dev \ +libjansson-dev \ libldap2-dev \ +liblmdb-dev \ liblzma-dev \ libndp-dev \ libnl-3-dev \ libnm-dev \ libnss3-dev \ libopus-dev \ libpolkit-agent-1-dev \ libpolkit-backend-1-dev \ libpolkit-gobject-1-dev \ libqrencode-dev \ libsasl2-dev \ libsndfile1-dev \ libsystemd-dev \ libtool \ libunistring-dev \ libunwind8-dev \ libvorbis-dev \ libwebp-dev \ libxapian-dev \ libxerces-c-dev \ iptables-dev \ lldb-3.8 \ llvm-3.8 \ llvm-3.8-dev \ ml-lex \ modemmanager-dev \ mysql-client-5.7 \ mysql-server-core-5.7 \ postgresql \ postgresql-contrib \ postgresql-server-dev-all \ ppp-dev \ python-dev \ python3-dev \ software-properties-common \ subversion \ texinfo \ transfig \ unzip \ uuid-dev \ x11proto-dri3-dev \ x11proto-present-dev \ xsdcxx \ xsltproc \ yasm \ zsync RUN sudo apt-get -y remove '.*wayland.*' RUN sudo add-apt-repository -y ppa:wayland.admin/daily-builds && sudo apt-get update && sudo apt-get -y install libinput-dev libwayland-dev \ libwayland-server0 libwayland0 libegl1-mesa-dev libwayland-egl1-mesa libwayland-egl1 && sudo add-apt-repository -y -r ppa:wayland.admin/daily-builds RUN sudo add-apt-repository -y ppa:brightbox/ruby-ng-experimental && sudo apt update && sudo apt-get -y install ruby2.5 ruby2.5-dev RUN sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y build-dep qt5-default RUN sudo apt-get update && sudo apt-get -y build-dep libqt5webkit5-dev RUN sudo add-apt-repository -y -r ppa:brightbox/ruby-ng-experimental RUN sudo apt-get -y remove '.*qt.*' diff --git a/libs/build.rb b/libs/build.rb index db0f9e7..b94237b 100644 --- a/libs/build.rb +++ b/libs/build.rb @@ -1,222 +1,222 @@ #!/usr/bin/env ruby # frozen_string_literal: true # # Copyright (C) 2016 Scarlett Moore # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) version 3, or any # later version accepted by the membership of KDE e.V. (or its # successor approved by the membership of KDE e.V.), which shall # act as a proxy defined in Section 6 of version 3 of the license. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library. If not, see . require 'tty-command' require 'fileutils' # Run the builds class Build attr_accessor :pre attr_accessor :status - def initialize(working_dir, need_patches, insource = false) + def initialize(working_dir, need_patches = false, insource = false) unless File.exist?(working_dir) puts 'The source directory does not exist, something is terribly wrong.' end Dir.chdir(working_dir) if need_patches == true FileUtils.cp_r('/in/patches/.', "#{working_dir}/patches") end @pre = './' return unless insource == false Dir.mkdir('build') Dir.chdir('build') @pre = '../' end def run_build(type, options = '', profile = '') puts type puts options case type when 'cmake' build_cmake(options) build_make @status = $CHILD_STATUS when 'qmake' build_qmake(options, profile) build_make @status = $CHILD_STATUS when 'make' build_configure(options) build_make @status = $CHILD_STATUS when 'autoconf' build_autoconf build_configure(options) build_make @status = $CHILD_STATUS when 'autogen' build_autogen(options) build_configure(options) build_make @status = $CHILD_STATUS when 'custom' build_custom(options) @status = $CHILD_STATUS else puts "You gave me #{type} -- I am not configured for that." end end def build_cmake(options) puts 'cmake ' + options puts @pre cmd = TTY::Command.new if @pre == '../' cmd.run('cmake ../ ' + options) else cmd.run('cmake ' + options) end @status = $CHILD_STATUS puts @status end def build_qmake(options = null, profile) puts 'qmake ' + options.to_s Open3.popen2('qmake', options.to_s, @pre + profile) do |stdin, stdout, status_thread| stdout.each_line do |line| puts "LINE: #{line}" end raise 'QMake failed' unless status_thread.value.success? @status = $CHILD_STATUS end end def build_autogen(options = null) puts @pre + 'autogen.sh ' + options.to_s cmd = TTY::Command.new cmd.run('ls') cmd.run(@pre + 'autogen.sh ' + options.to_s) @status = $CHILD_STATUS end def build_configure(options = null) puts 'configure ' + options.to_s cmd = TTY::Command.new cmd.run(@pre + 'configure ' + options.to_s) @status = $CHILD_STATUS puts @status end def build_make cmd = TTY::Command.new cmd.run('make VERBOSE=1 -j 8') @status = $CHILD_STATUS puts @status cmd = TTY::Command.new cmd.run('make install') @status = $CHILD_STATUS puts @status end def run_autoconf cmd = TTY::Command.new cmd.run('aclocal') @status = $CHILD_STATUS puts @status cmd.run('automake --add-missing') @status = $CHILD_STATUS puts @status cmd.run('autoconf') @status = $CHILD_STATUS puts @status end def build_autoconf unless File.exist?('configure') if @pre == '../' Dir.chdir('../') do run_autoconf return end end else run_autoconf return end if File.exist?('configure') Open3.popen2('autoreconf', '--force', '--install', @pre) do |stdin, stdout, status_thread| stdout.each_line do |line| puts "LINE: #{line}" end raise 'Autoconf failed' unless status_thread.value.success? @status = $CHILD_STATUS end end end def build_custom(command) puts command cmd = TTY::Command.new cmd.run(command) @status = $CHILD_STATUS end def apply_patch(patch) puts "Applying #{patch}" cmd = TTY::Command.new if @pre == '../' Dir.chdir('../') do cmd.run('patch -p1 < ' + patch) return end else cmd.run('patch -p1 < ' + patch) @status = $CHILD_STATUS end end end # def run_build(buildsystem, options, path, autoreconf, insource) # when 'autogen' # cmd = '' # Dir.chdir("#{path}") do # unless "#{insource}" == true # cmd = "mkdir #{name}-builddir && cd #{name}-builddir && " # end # if "#{insource}" == true # cmd = "" # end # unless "#{autoreconf}" == true # cmd = cmd + "sh ../autogen.sh && ../configure --prefix=/opt/usr #{options} && make VERBOSE=1 -j 8 && make install" # end # if "#{autoreconf}" == true # cmd = cmd + "autoreconf --force --install && mkdir #{name}-builddir && cd #{name}-builddir && ../configure --prefix=/opt/usr #{options} && make VERBOSE=1 -j 8 && make install prefix=/opt/usr" # end # p "Running " + cmd # system(cmd) # FileUtils.rm_rf("#{name}-builddir", secure: true) # end # $?.exitstatus # when 'bootstrap' # Dir.chdir(path) do # p "running ./bootstrap #{options}" # system("./bootstrap #{options}") # system('make VERBOSE=1 -j 8 && make install') # end # $?.exitstatus # else # "You gave me #{buildsystem} -- I have no idea what to do with that." # end # end # end diff --git a/libs/sources.rb b/libs/sources.rb index 23c4bf9..1b28a3b 100644 --- a/libs/sources.rb +++ b/libs/sources.rb @@ -1,150 +1,145 @@ #!/usr/bin/env ruby # frozen_string_literal: true # # Copyright (C) 2016 Scarlett Moore # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) version 3, or any # later version accepted by the membership of KDE e.V. (or its # successor approved by the membership of KDE e.V.), which shall # act as a proxy defined in Section 6 of version 3 of the license. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library. If not, see . require 'yaml' require 'fileutils' require_relative 'urlresolver' -require 'rugged' require 'open3' require 'tty-command' require 'digest/md5' # Retrieve sources class Sources attr_accessor :branch def initialize(working_dir) unless File.exist?(working_dir) FileUtils.mkdir_p(working_dir) end Dir.chdir(working_dir) end def check_md5sum(tarball, md5sum) downloaded = Digest::MD5.file(tarball).to_s site = md5sum puts 'Downloaded: ' + downloaded puts 'Site: ' + site downloaded == site end def fetch_tarball(url) name = File.basename(url) get_file = UrlResolver.new response = get_file.resolve(url) File.open(name, 'w+') do |file| file.write(response) # write the contents end end def unpack_tarball(file, name) type = File.extname(file).delete('.') FileUtils.mkdir(name) case type when 'gz' Open3.popen2('tar', '-zxvf', file, '-C', name, '--strip-components=1') do |stdin, stdout, status_thread| stdout.each_line do |line| puts "LINE: #{line}" end raise 'Untar failed' unless status_thread.value.success? end when 'xz' Open3.popen2('tar', '-xvf', file, '-C', name, '--strip-components=1') do |stdin, stdout, status_thread| stdout.each_line do |line| puts "LINE: #{line}" end raise 'Untar failed' unless status_thread.value.success? end when 'bz2' Open3.popen2('tar', '-jxvf', file, '-C', name, '--strip-components=1') do |stdin, stdout, status_thread| stdout.each_line do |line| puts "LINE: #{line}" end raise 'Untar failed' unless status_thread.value.success? end end end def clone_git(url, branch = 'master') name = File.basename(url) - Rugged::Repository.clone_at(url, "/app/src/#{name}") - repo = Rugged::Repository.new("/app/src/#{name}") - Dir.chdir(repo.workdir) - #FIX-ME rugged checkout is not working with branches that have a / in the name... - #repo.checkout(branch) - system("git checkout #{branch}") - branch = repo.branches[branch] - @branch = branch.name - puts @branch + cmd = TTY::Command.new + cmd.run("git clone #{url} /app/src/#{name}") + Dir.chdir("/app/src/#{name}") + cmd.run("git checkout #{branch}") + puts branch end end # when 'xz' # Dir.chdir('/app/src/') # unless Dir.exist?("/app/src/#{name}") # system("wget #{url}") # system("tar -xvf #{name}*.tar.xz") # end # when 'gz' # Dir.chdir('/app/src/') # unless Dir.exist?("/app/src/#{name}") # system("wget #{url}") # system("tar -zxvf #{name}*.tar.gz") # end # when 'bz2' # Dir.chdir('/app/src/') # unless Dir.exist?("/app/src/#{name}") # system("wget #{url}") # system("tar -jxvf #{name}.tar.bz2") # end # when 'mercurial' # Dir.chdir('/app/src') # unless Dir.exist?("/app/src/#{name}") # system("hg clone #{url}") # end # when 'bzr' # Dir.chdir('/app/src') # unless Dir.exist?("/app/src/#{name}") # system("bzr branch #{url}") # end # when 'zip' # Dir.chdir('/app/src') # unless Dir.exist?("/app/src/#{name}") # system("wget #{url}") # system("unzip #{name}.zip") # end # when 'svn' # Dir.chdir('/app/src') # unless Dir.exist?("/app/src/#{name}") # system("svn export #{url}") # end # when 'none' # Dir.chdir('/app/src') # unless Dir.exist?("/app/src/#{name}") # Dir.mkdir "#{name}" # p "No sources configured" # end # else # "You gave me #{type} -- I have no idea what to do with that." # end # $?.exitstatus # end # end diff --git a/tests/setup.sh b/tests/setup.sh index eff4c91..fe779e6 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -1,34 +1,35 @@ #!/bin/bash # # Copyright (C) 2016 Scarlett Clark # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) version 3, or any # later version accepted by the membership of KDE e.V. (or its # successor approved by the membership of KDE e.V.), which shall # act as a proxy defined in Section 6 of version 3 of the license. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License fo-r more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library. If not, see . -export PATH=/opt/usr/bin:/home/jenkins/.rbenv/bin:/home/jenkins/.rbenv/shims:$PATH +export HOME=/var/jenkins_home +export PATH=/opt/usr/bin:$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH export RBENV_VERSION="2.5.0" -export RBENV_ROOT=/home/jenkins/.rbenv +export RBENV_ROOT=$HOME/.rbenv rbenv rehash gem install --no-ri --no-rdoc bundler && rbenv rehash sudo chown -R jenkins.jenkins /in cd /in eval "$(rbenv init -)" bundle install bundle show rspec bundle list --paths bundle env bundle exec ruby tests/tooling.rb