Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
76f54d13
Commit
76f54d13
authored
9 years ago
by
Gunnar Schaefer
Browse files
Options
Downloads
Patches
Plain Diff
Streamline env var names
parent
5efa6d28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/run.sh
+24
-24
24 additions, 24 deletions
bin/run.sh
sample.config
+5
-4
5 additions, 4 deletions
sample.config
with
29 additions
and
28 deletions
bin/run.sh
+
24
−
24
View file @
76f54d13
...
...
@@ -22,20 +22,20 @@ fi
# Default config values
if
[
-z
"
$SCITRAN_
SYSTEM
_HOST
"
]
;
then
SCITRAN_
SYSTEM
_HOST
=
"127.0.0.1"
if
[
-z
"
$SCITRAN_
RUNTIME
_HOST
"
]
;
then
SCITRAN_
RUNTIME
_HOST
=
"127.0.0.1"
fi
if
[
-z
"
$SCITRAN_
SYSTEM
_PORT
"
]
;
then
SCITRAN_
SYSTEM
_PORT
=
"8080"
if
[
-z
"
$SCITRAN_
RUNTIME
_PORT
"
]
;
then
SCITRAN_
RUNTIME
_PORT
=
"8080"
fi
if
[
-z
"
$SCITRAN_
SYSTEM_
RUNTIME
"
]
;
then
SCITRAN_
SYSTEM_
RUNTIME
=
"./runtime"
if
[
-z
"
$SCITRAN_RUNTIME
_PATH
"
]
;
then
SCITRAN_RUNTIME
_PATH
=
"./runtime"
fi
if
[
-z
"
$SCITRAN_
SYSTEM
_SSL_PEM
"
]
;
then
SCITRAN_
SYSTEM
_SSL_PEM
=
""
if
[
-z
"
$SCITRAN_
RUNTIME
_SSL_PEM
"
]
;
then
SCITRAN_
RUNTIME
_SSL_PEM
=
""
fi
if
[
-z
"
$SCITRAN_
SYSTEM
_BOOTSTRAP
"
]
;
then
SCITRAN_
SYSTEM
_BOOTSTRAP
=
"bootstrap.json"
if
[
-z
"
$SCITRAN_
RUNTIME
_BOOTSTRAP
"
]
;
then
SCITRAN_
RUNTIME
_BOOTSTRAP
=
"bootstrap.json"
fi
if
[
-z
"
$SCITRAN_PERSISTENT_PATH
"
]
;
then
SCITRAN_PERSISTENT_PATH
=
"./persistent"
...
...
@@ -61,8 +61,8 @@ if [ -f "$SCITRAN_PERSISTENT_DB_PATH/mongod.lock" ]; then
else
echo
"Creating database location at
$SCITRAN_PERSISTENT_DB_PATH
"
mkdir
-p
$SCITRAN_PERSISTENT_DB_PATH
if
!
[
-f
"
$SCITRAN_
SYSTEM
_BOOTSTRAP
"
]
;
then
echo
"Aborting. Please create
$SCITRAN_
SYSTEM
_BOOTSTRAP
from bootstrap.json.sample."
if
!
[
-f
"
$SCITRAN_
RUNTIME
_BOOTSTRAP
"
]
;
then
echo
"Aborting. Please create
$SCITRAN_
RUNTIME
_BOOTSTRAP
from bootstrap.json.sample."
exit
1
fi
BOOTSTRAP_USERS
=
1
...
...
@@ -101,25 +101,25 @@ else
echo
"Installed Virtualenv"
fi
if
[
-d
"
$SCITRAN_
SYSTEM_
RUNTIME
"
]
;
then
echo
"Virtualenv exists present at
$SCITRAN_
SYSTEM_
RUNTIME
"
if
[
-d
"
$SCITRAN_RUNTIME
_PATH
"
]
;
then
echo
"Virtualenv exists present at
$SCITRAN_RUNTIME
_PATH
"
else
echo
"Creating 'scitran' Virtualenv at
$SCITRAN_
SYSTEM_
RUNTIME
"
virtualenv
-p
`
brew
--prefix
`
/bin/python
--prompt
=
"(scitran)"
$SCITRAN_
SYSTEM_
RUNTIME
echo
"Created 'scitran' Virtualenv at
$SCITRAN_
SYSTEM_
RUNTIME
"
echo
"Creating 'scitran' Virtualenv at
$SCITRAN_RUNTIME
_PATH
"
virtualenv
-p
`
brew
--prefix
`
/bin/python
--prompt
=
"(scitran)"
$SCITRAN_RUNTIME
_PATH
echo
"Created 'scitran' Virtualenv at
$SCITRAN_RUNTIME
_PATH
"
fi
if
[
-f
"
$SCITRAN_
SYSTEM_
RUNTIME
/bin/mongod"
]
;
then
if
[
-f
"
$SCITRAN_RUNTIME
_PATH
/bin/mongod"
]
;
then
echo
"MongoDB is installed"
else
echo
"Installing MongoDB"
curl https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.0.7.tgz |
tar
xz
-C
$SCITRAN_
SYSTEM_
RUNTIME
--strip-components
1
curl https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.0.7.tgz |
tar
xz
-C
$SCITRAN_RUNTIME
_PATH
--strip-components
1
echo
"MongoDB installed"
fi
echo
"Activating Virtualenv"
source
$SCITRAN_
SYSTEM_
RUNTIME
/bin/activate
source
$SCITRAN_RUNTIME
_PATH
/bin/activate
echo
"Installing Python requirements"
pip
install
-U
-r
requirements.txt
...
...
@@ -135,7 +135,7 @@ export PYTHONPATH=.
# Boostrap users
if
[
$BOOTSTRAP_USERS
-eq
1
]
;
then
echo
"Bootstrapping users"
bin/bootstrap.py
users
"
$SCITRAN_
SYSTEM
_BOOTSTRAP
"
bin/bootstrap.py
users
"
$SCITRAN_
RUNTIME
_BOOTSTRAP
"
else
echo
"Database exists at
$SCITRAN_PERSISTENT_PATH
/db. Not bootstrapping users."
fi
...
...
@@ -171,9 +171,9 @@ TEMP_INI_FILE=$(mktemp -t scitran_api)
cat
<<
EOF
>
$TEMP_INI_FILE
[server:main]
use = egg:Paste#http
host =
$SCITRAN_
SYSTEM
_HOST
port =
$SCITRAN_
SYSTEM
_PORT
ssl_pem=
$SCITRAN_
SYSTEM
_SSL_PEM
host =
$SCITRAN_
RUNTIME
_HOST
port =
$SCITRAN_
RUNTIME
_PORT
ssl_pem=
$SCITRAN_
RUNTIME
_SSL_PEM
[app:main]
paste.app_factory = api.api:app_factory
...
...
This diff is collapsed.
Click to expand it.
sample.config
+
5
−
4
View file @
76f54d13
# vim: filetype=sh
#SCITRAN_SYSTEM_HOST="127.0.0.1"
#SCITRAN_SYSTEM_PORT="8080"
#SCITRAN_SYSTEM_RUNTIME="./runtime"
#SCITRAN_SYSTEM_SSL_PEM="*"
#SCITRAN_RUNTIME_HOST="127.0.0.1"
#SCITRAN_RUNTIME_PORT="8080"
#SCITRAN_RUNTIME_PATH="./runtime"
#SCITRAN_RUNTIME_SSL_PEM="*"
#SCITRAN_RUNTIME_BOOTSTRAP="bootstrap.json"
#SCITRAN_CORE_DEBUG=false # emit stack trace on error
#SCITRAN_CORE_INSECURE=false # accept user name as query param
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment