-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit
executable file
·37 lines (31 loc) · 881 Bytes
/
init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh
set -e
# Install dependencies
virtualenv venv
. venv/bin/activate
pip install -r requirements.txt
deactivate
# Create empty build script
if [ ! -f build.sh ]; then
echo "#!/bin/bash\n\n### This is your build script that will run at every gated checkin ###\n\ncd repository" > build.sh
fi
chmod +x build.sh
# Create empty deploy script
if [ ! -f deploy.sh ]; then
echo "#!/bin/bash\n\n### This is the script for deploying your application ###\n\ncd repository" > deploy.sh
fi
chmod +x deploy.sh
# Prepare work repository
rm -rf repository 2> /dev/null
mkdir -p repository
cd repository
git init
if [ -z "$1" ]; then
echo "Remote repository not provided. Run the following commands to setup manually:"
echo "cd repository"
echo "git remote add origin git@<repo-url>:<reponame>.git"
else
git remote add origin $1
fi
# Prepare mongodb
mkdir db