Created
May 8, 2016 17:16
-
-
Save smasty/deb06fb0b39c0ee443ae497e6e021805 to your computer and use it in GitHub Desktop.
LunaCI bootstrap script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
REPO=`dirname "$(cd ${0%/*} && echo $PWD/${0##*/})"` | |
LUADIST_BOOTSTRAP="$REPO/luadist-bootstrap" | |
INSTALLATION="$REPO/_install" | |
DATA_DIR="data" | |
# Get LuaDist bootstrap | |
git clone "https://github.com/LuaDist-core/bootstrap.git" "$LUADIST_BOOTSTRAP" | |
# Install base LuaDist installation | |
cd "$LUADIST_BOOTSTRAP" && ./bootstrap "lua 5.2.4-1" && cd "$REPO" | |
mv "$LUADIST_BOOTSTRAP/_install" "$INSTALLATION" | |
# Install LunaCI | |
cd "$INSTALLATION" && \ | |
"bin/lua" "lib/lua/luadist.lua" install lunaci -DLUNACI_DATA_DIR="$DATA_DIR" && \ | |
cd "$REPO" | |
# Prepare LunaCI deploy dirs | |
DEPLOY_DIR="$INSTALLATION/$DATA_DIR/deploy-dirs" | |
mkdir -p "$DEPLOY_DIR" | |
mkdir -p "$DEPLOY_DIR/lua-5.1" | |
mkdir -p "$DEPLOY_DIR/lua-5.2" | |
mkdir -p "$DEPLOY_DIR/lua-5.3" | |
# Install Lua versions in deploy dirs | |
cd "$INSTALLATION" | |
"bin/lua" "lib/lua/luadist.lua" "$DEPLOY_DIR/lua-5.1" install "lua 5.1.5-1" luadist2 | |
"bin/lua" "lib/lua/luadist.lua" "$DEPLOY_DIR/lua-5.2" install "lua 5.2.4-1" luadist2 | |
"bin/lua" "lib/lua/luadist" "$DEPLOY_DIR/lua-5.3" install "lua 5.3.2-1" luadist2 | |
# Return back | |
cd "$REPO" | |
# Print success messages. | |
echo "## LunaCI is now built and configured inside $INSTALLATION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment