Commit a3762368 authored by Ophélie Gagnard's avatar Ophélie Gagnard

Initial commit.

The scripts do everything until the first run of buildout (actual run, not just bootstraping).
parent a5ee30e5
all: build_tree template_stage bootstrap_buildout
clean: clean_build_tree clean_template_stage clean_bootstrap_buildout
build_tree:
./build_tree.sh
clean_build_tree:
./clean_build_tree.sh
template_stage:
./template_stage.sh
clean_template_stage:
./clean_template_stage.sh
bootstrap_buildout:
./bootstrap_buildout.sh
clean_bootstrap_buildout:
./clean_bootstrap_buildout.sh
.PHONY: all clean build_tree clean_build_tree template_stage clean_template_stage bootstrap_buildout clean_bootstrap_buildout
#!/bin/bash
set -e
source configuration_information.sh
cd $INITIAL_DIR
# Download the bootstrap script
cd $PARTS_DIR/tmp-networkcached
wget https://bootstrap.pypa.io/bootstrap-buildout.py
cd $INITIAL_DIR
# Create a build/tmp-networkcached/bin/buildout
# Also create a lot of things in build/tmp-networkcached/eggs/
# it uses software_release/ at some point
cd $PARTS_DIR/tmp-networkcached
cp $TEMPLATE_DIR/tmp/networkcached.cfg buildout.cfg
(python2.7 -S bootstrap-buildout.py --buildout-version 2.7.1+slapos016 --setuptools-version 44.1.1 --setuptools-to-dir eggs -f http://www.nexedi.org/static/packages/source/slapos.buildout/ && ./bin/buildout -v)
#!/bin/bash
set -e
source configuration_information.sh
cd $INITIAL_DIR
mkdir -p tarball/$SOFTWARE/
# Re-downloading the software release to pack
cd tarball/$SOFTWARE/
git clone https://lab.nexedi.com/Francois/slapos
mv slapos software_release
cd software_release
git checkout fluent-bit
cd $INITIAL_DIR
# Peparing the build directories
mkdir -p $PARTS_DIR/{eggs,extends-cache,download-cache/dist,tmp-networkcached/eggs}
#!/bin/bash
set -e
source configuration_information.sh
cd $INITIAL_DIR
# Run bulidout locally to fill download-cache and extends-cache
cd $PARTS_DIR
cp $TEMPLATE_DIR/tmp/buildout_with_gcc.cfg buildout.cfg
# bootstrap again, run buildout if succeeds
# TODO: test if it works in two different lines
(./tmp-networkcached/bin/buildout bootstrap --buildout-version 2.7.1+slapos016 --setuptools-to-dir eggs -f http://www.nexedi.org/static/packages/source/slapos.buildout/ && ./bin/buildout && ./bin/buildout -v)
#!/bin/bash
set -e
source configuration_information.sh
cd $INITIAL_DIR
# Remove the bootstrap script and associated files
if [[ -d $PARTS_DIR/tmp-networkcached ]]; then
cd $PARTS_DIR/tmp-networkcached
rm -f bootstrap.py # LEGACY
rm -f bootstrap-buildout.py*
rm -f buildout.cfg
fi
cd $INITIAL_DIR
# Clean the material created by the bootstrap script
if [[ -d $PARTS_DIR/tmp-networkcached ]]; then
cd $PARTS_DIR/tmp-networkcached
rm -rf bin/
rm -rf eggs/
fi
#!/bin/bash
set -e
source configuration_information.sh
cd $INITIAL_DIR
# Clean the software release to pack
cd tarball/$SOFTWARE/
rm -rf slapos slapos_repository # LEGACY
rm -rf software_release
cd $INITIAL_DIR
# Clean the build tree
rm -rf $PARTS_DIR/{eggs,extends-cache,download-cache,tmp-networkcached}
#!/bin/bash
set -e
source configuration_information.sh
cd $INITIAL_DIR
# Clean the ouput of the cache creation
cd $PARTS_DIR
rm -f buildout.cfg
rm -rf bin/ develop-eggs/ download-cache/ eggs/* parts/
# TODO:
# + clean the output of the bootstraping
# + clean the output of the cache creation
# (+ clean the files removed for OBS ?)
#!/bin/bash
set -e
source configuration_information.sh
cd $INITIAL_DIR
# Clean temporary directory for templates
cd $TEMPLATE_DIR
rm -rf tmp/
####################################################
# Use on script as source release_configuration.sh
####################################################
INITIAL_DIR="$(pwd)"
# Modify the following variables accordingly
# RELEASE INFORMATION
VERSION=1
RECIPE_VERSION=1
RELEASE=1
SOFTWARE=lunzip
# INSTALL INFORMATION
TARGET_DIR=/opt/${SOFTWARE}_software_release
# BUILD INFORMATION
TEMPLATE_DIR=$INITIAL_DIR/template
BUILD_DIR=$INITIAL_DIR/tarball/$SOFTWARE/build/ # former BUILD_ROOT_DIRECTORY
PARTS_DIR=$BUILD_DIR/$TARGET_DIR # former BUILD_DIRECTORY
# OBS INFORMATION
OBS_DIR=$INITIAL_DIR/home:fg.nxd/$SOFTWARE/
# Path normalization
INITIAL_DIR=`realpath -m $INITIAL_DIR`
TARGET_DIR=`realpath -m $TARGET_DIR`
TEMPLATE_DIR=`realpath -m $TEMPLATE_DIR`
BUILD_DIR=`realpath -m $BUILD_DIR`
PARTS_DIR=`realpath -m $PARTS_DIR`
# Regular expressions for templates
VERSION_REGEX="s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g;s/\%RELEASE\%/$RELEASE/g"
# Note: %PATCHES_DIRECTORY% not supported yet
# supporting legacy macros
DIR_REGEX="s|\%TARGET_DIRECTORY\%|$TARGET_DIR|g;s|\%BUILD_ROOT_DIRECTORY\%|$BUILD_DIR|g;s|\%BUILD_DIRECTORY\%|$PARTS_DIR|g"
# supporting new macros
#DIR_REGEX="s|\%TARGET_DIR\%|$TARGET_DIR|g;s|\%BUILD_DIR\%|$BUILD_DIR|g;s|\%PARTS_DIR\%|$PARTS_DIR|g"
[buildout]
rootdir = %TARGET_DIRECTORY%
destdir = %BUILD_ROOT_DIRECTORY%
builddir = %BUILD_DIRECTORY%
extends =
%BUILD_ROOT_DIRECTORY%/../software_release/component/slapos/obs.cfg
versions = versions
[gcc]
# force usage of gcc from slapos to have it in the cache
max_version = 0
[versions]
setuptools = 44.1.1
# Use SlapOS patched zc.buildout
zc.buildout = 2.7.1+slapos016
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 2.0.3+slapos003
[buildout]
rootdir = %TARGET_DIRECTORY%
destdir = %BUILD_ROOT_DIRECTORY%
builddir = %BUILD_DIRECTORY%
extends =
%BUILD_ROOT_DIRECTORY%/../software_release/component/slapos/obs.cfg
versions = versions
[versions]
setuptools = 44.1.1
# Use SlapOS patched zc.buildout
zc.buildout = 2.7.1+slapos016
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 2.0.3+slapos003
[buildout]
rootdir = %TARGET_DIRECTORY%
destdir = %BUILD_ROOT_DIRECTORY%
builddir = %BUILD_DIRECTORY%
extends =
%BUILD_ROOT_DIRECTORY%/../software_release/component/slapos/obs.cfg
extensions =
parts =
networkcached
versions = versions
[networkcached]
recipe = zc.recipe.egg
eggs =
slapos.libnetworkcache
zc.buildout
[versions]
setuptools = 44.1.1
# Use SlapOS patched zc.buildout
zc.buildout = 2.7.1+slapos016
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 2.0.3+slapos003
#!/bin/bash
set -e
source configuration_information.sh
cd $INITIAL_DIR
# Prepare the templates in $TEMPLATE_DIR/tmp/
cd $TEMPLATE_DIR
mkdir -p tmp/
sed $VERSION_REGEX";"$DIR_REGEX networkcached.cfg.in > tmp/networkcached.cfg
sed $VERSION_REGEX";"$DIR_REGEX buildout_with_gcc.cfg.in > tmp/buildout_with_gcc.cfg
sed $VERSION_REGEX";"$DIR_REGEX buildout_without_gcc.cfg.in > tmp/buildout_without_gcc.cfg
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment