Skip to content

Commit

Permalink
Merge pull request #201 from devcurmudgeon/write-a-result
Browse files Browse the repository at this point in the history
Tidyup install.sh and write cache_key result to ybd.result
  • Loading branch information
devcurmudgeon committed Mar 25, 2016
2 parents c9fbf5d + 72799e1 commit c4f4a77
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ check_pep8:

check_installation:
stage: installation
script: "python setup.py install ; ./ybd.py"
script: "./ybd.py"

check_cache_keys:
stage: cache_keys
script: "echo 'mode: keys-only' > ./ybd.conf && ../ybd/ybd.py ci x86_64"
script: "export YBD_mode=keys-only > && ../ybd/ybd.py ci x86_64"
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
before_install:
- sudo pip install pep8
- pep8
- sudo apt-get update -qq
- sudo apt-get install -qq build-essential gawk git m4
- sudo pip install fs pyyaml sandboxlib requests jsonschema
- sudo pip install bottle cherrypy riemann-client
- ./install.sh

install:
- sudo python setup.py install
Expand Down
6 changes: 1 addition & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ Vagrant.configure(2) do |config|
end

config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y build-essential gawk git m4
sudo wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py; rm get-pip.py
sudo pip install fs pyyaml sandboxlib jsonschema requests bottle
cd /src
./ybd/install.sh
git clone git://git.baserock.org/baserock/baserock/definitions
echo "base: /src" > ybd/ybd.conf
SHELL
Expand Down
49 changes: 44 additions & 5 deletions install.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
pip install fs pep8
# Copyright (C) 2016 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# =*= License: GPL-2 =*=

cd ..
#
# This is a bash script which attempts to do a full install of ybd
# and default definitions from git.baserock.org.
# it's mainly intended for ci and automated test setups...
#

if [ ! -d definitions ] ; then
git clone http://git.baserock.org/git/baserock/baserock/definitions.git

# install dependencies for debian, ubuntu
which apt-get 2>&1 > /dev/null
if [ $? -eq 0 ]; then
sudo apt-get -qq update
sudo apt-get -qq install build-essential gawk git m4 wget
fi

# install for fedora
which dnf 2>&1 > /dev/null
if [ $? -eq 0 ]; then
sudo dnf install -y which make automake gcc gcc-c++ gawk git m4 wget
fi

# FIXME: check the above installs worked?

pip --version 2>&1 > /dev/null
if [ $? -ne 0 ]; then
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo rm get-pip.py
fi
cd definitions

sudo pip install fs pyyaml sandboxlib requests
sudo pip install jsonschema bottle cherrypy riemann-client
sudo pip install pep8
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Github: [![Build Status](https://travis-ci.org/devcurmudgeon/ybd.svg?branch=master)](https://travis-ci.org/devcurmudgeon/ybd) Gitlab: [![Build Status](https://gitlab.com/devcurmudgeon/ybd/badges/master/build.svg)](https://gitlab.com/devcurmudgeon/ybd/badges/master/build.svg)
Github: [![Build Status](https://travis-ci.org/devcurmudgeon/ybd.svg?branch=master)](https://travis-ci.org/devcurmudgeon/ybd) GitLab: [![Build Status](https://gitlab.com/devcurmudgeon/ybd/badges/master/build.svg)](https://gitlab.com/devcurmudgeon/ybd/badges/master/build.svg)

## ybd

Expand All @@ -13,7 +13,7 @@ currently ybd understands the semantics of yaml
[definitions](http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/)
from the [Baserock](http://wiki.baserock.org) project.

the total codebase for ybd is only ~ 2100 lines of Python. even so ybd can
the total codebase for ybd is only ~ 2200 lines of Python. even so ybd can
repeatably build all systems in Baserock's definitions.git, i.e. all of the
FOSS components required for Linux appliances up to and including, for example

Expand Down
3 changes: 2 additions & 1 deletion ybd/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@

defs.save_trees()
if app.config.get('mode', 'normal') == 'keys-only':
print target['cache']
with open('./ybd.result', 'w') as f:
f.write(target['cache'] +'\n')
os._exit(0)

sandbox.executor = sandboxlib.executor_for_platform()
Expand Down

0 comments on commit c4f4a77

Please sign in to comment.