Skip to content

Instantly share code, notes, and snippets.

@smasty
Created May 8, 2016 17:16
Show Gist options
  • Save smasty/deb06fb0b39c0ee443ae497e6e021805 to your computer and use it in GitHub Desktop.
Save smasty/deb06fb0b39c0ee443ae497e6e021805 to your computer and use it in GitHub Desktop.
LunaCI bootstrap script
#!/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