Created
October 17, 2018 16:23
-
-
Save BolaNasr/949c9022dae42e939cdbca3613e5b8ac to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
set -ex | |
# make output directory | |
ARCHIVE=/tmp/archives | |
FLIST=/tmp/flist | |
mkdir -p $ARCHIVE | |
# install system deps (done) | |
apt-get update | |
apt-get install -y locales git sudo python3-pip libffi-dev python3-dev libssl-dev libpython3-dev libssh-dev libsnappy-dev build-essential pkg-config libvirt-dev libsqlite3-dev -y | |
# setting up locales | |
if ! grep -q ^en_US /etc/locale.gen; then | |
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen | |
locale-gen | |
fi | |
for target in /usr/local $HOME/opt $HOME/opt/cfg $HOME/opt/code $HOME/opt/code/github $HOME/opt/code/github/threefoldtech $HOME/opt/var/capnp $HOME/opt/var/log $HOME/jumpscale/cfg; do | |
mkdir -p $target | |
sudo chown -R $USER:$USER $target | |
done | |
for target in /usr/local $HOME/opt $HOME/opt/cfg $HOME/opt/code $HOME/opt/code/github $HOME/opt/code/github/threefoldtech $HOME/opt/var/capnp $HOME/opt/var/log $HOME/jumpscale/cfg; do | |
mkdir -p $target | |
sudo chown -R $USER:$USER $target | |
done | |
pushd $HOME/opt/code/github/threefoldtech | |
# cloning source code | |
export JUMPSCALEBRANCH="development_simple" | |
curl https://raw.githubusercontent.com/threefoldtech/jumpscale_core/$JUMPSCALEBRANCH/install.sh?$RANDOM > /tmp/install_jumpscale.sh;bash /tmp/install_jumpscale.sh | |
# install jumpscale | |
for target in jumpscale_core jumpscale_lib jumpscale_prefab digital_me ; do | |
cd $HOME/opt/code/github/threefoldtech/${target} | |
pip3 install -e . | |
done | |
service redis-server start | |
js_shell "j.servers.zdb.build()" | |
js_shell "j.clients.zdb.testdb_server_start_client_get() " | |
js_shell "j.tools.tmux.execute('js_shell \'j.servers.digitalme.start()\'')" | |
echo "Waiting digitame to launch on 8000..." | |
while ! nc -z localhost 8000; do | |
sleep 1 # wait for 1 second before check again | |
done | |
tar -cpzf "/tmp/archives/jumpscale_simple.tar.gz" --exclude tmp --exclude dev --exclude sys --exclude proc / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment