├── spinner.sh ├── README.md ├── LICENSE └── .travis.yml /spinner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Small spinner script, that returns exit code of CMD and keeps colored output 3 | # Usage: ./spinner.sh CMD 4 | 5 | spinner() { 6 | local PID=$1 7 | local SPIN="/-\|" 8 | local i=0 9 | while kill -0 "$PID" >/dev/null 2>&1; do 10 | printf "\r%s" "${SPIN:$i:1}" 11 | i=$((i + 1)) 12 | [[ $i -eq 4 ]] && i=0 13 | sleep 0.5; 14 | done 15 | } 16 | 17 | cat /tmp/update 2>/dev/null 18 | $(script -q -e /dev/null -c "${*} 2>&1" >/tmp/output) & 19 | PID=$! 20 | spinner "${PID}" & 21 | wait ${PID} 22 | RC=$? 23 | sleep 0.75 24 | printf "\r" 25 | cat /tmp/output 26 | exit $RC 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | repoman-travis 2 | ============== 3 | 4 | .travis.yml to run repoman continuously for your overlay. 5 | 6 | Repoman is a tool to enforce a minimal level of quality assurance in packages added to Gentoo's main repository and overlays. 7 | 8 | This tool will run in an instance of [Travis CI](https://travis-ci.org) and download a current snapshot of Gentoo's main tree and a recent portage release. 9 | It will check your overlay with repoman and report this log to your travis build report. 10 | 11 | ## Installation 12 | 13 | * Add .travis.yml to your overlay (should be hosted on github) 14 | * Log in to [Travis CI](https://travis-ci.org) with your github account 15 | * Activate travis runs for your overlay repository 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Manuel Rüger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Run repoman via travis 3 | # See https://github.com/mrueg/repoman-travis 4 | # 5 | language: python 6 | python: 7 | - "3.8" 8 | env: 9 | - PORTAGE_VER="3.0.13" 10 | before_install: 11 | - sudo apt-get -qq update 12 | - pip install lxml pyyaml 13 | before_script: 14 | - sudo chmod a+rwX /etc/passwd /etc/group /etc /var /var/cache 15 | - mkdir -p travis-overlay /etc/portage /var/cache/distfiles /var/db/repos/gentoo 16 | - mv !(travis-overlay) travis-overlay/ 17 | - mv .git travis-overlay/ 18 | - wget "https://raw.githubusercontent.com/mrueg/repoman-travis/master/.travis.yml" -O .travis.yml.upstream 19 | - wget "https://raw.githubusercontent.com/mrueg/repoman-travis/master/spinner.sh" 20 | - wget -qO - "https://github.com/gentoo/portage/archive/portage-${PORTAGE_VER}.tar.gz" | tar xz 21 | - wget -qO - "https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz" | tar xz -C /var/db/repos/gentoo --strip-components=1 22 | - chmod a+rwx spinner.sh 23 | - echo "portage:x:250:250:portage:/var/tmp/portage:/bin/false" >> /etc/passwd 24 | - echo "portage::250:portage,travis" >> /etc/group 25 | - wget "https://www.gentoo.org/dtd/metadata.dtd" -O /var/cache/distfiles/metadata.dtd 26 | - ln -s $TRAVIS_BUILD_DIR/portage-portage-${PORTAGE_VER}/cnf/repos.conf /etc/portage/repos.conf 27 | - ln -s /var/db/repos/gentoo/profiles/default/linux/amd64/17.0 /etc/portage/make.profile 28 | - SIZE=$(stat -c %s .travis.yml.upstream) 29 | - if ! cmp -n $SIZE -s .travis.yml .travis.yml.upstream; then echo -e "\e[31m !!! .travis.yml outdated! Update available https://github.com/mrueg/repoman-travis \e[0m" > /tmp/update ; fi 30 | - cd travis-overlay 31 | script: 32 | - ./../spinner.sh "python ../portage-portage-${PORTAGE_VER}/repoman/bin/repoman full -d" 33 | # You can append own scripts after this line 34 | --------------------------------------------------------------------------------