Skip to content

update readme #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ git submodule update
./ide.sh run # 启动项目
```

### 修改默认配置

`backend/src/main/resources/application.properties` 包括用户、项目、数据库等配置,可以通过修改配置定制服务:

* **SPACE_HOME:** 存放 workspace 的目录,默认为 ${"user.home"}/.workspace
* **server.port:** 应用启动的端口
* **USERNAME:** 用户名,git 提交时会使用该值作为 user.name,默认为 coding。
* **EMAIL:** 用户邮箱,git 提交时会使用该值作为 user.email,默认为 coding@coding.net
* **AVATAR:** 用户头像
* **CODING_IDE_HOME:** 应用数据存放目录

修改配置后,需要重启应用。另外如果修改了 `USERNAME`、`EMAIL` 的值,会在创建新的 Workspace 时生效。

## docker 版

```
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ We provide a shell script `ide.sh` to ease the process for you.
```
Server runs on port 8080 by default, visit localhost:8080 to check it out.


### Configurations

`backend/src/main/resources/application.properties` contains configurations of user, project, database, etc., you can change these parameters to meet your need:

* **SPACE_HOME:** path to your workspace directory, default to `${"user.home"}/.workspace`
* **server.port:** backend server port
* **USERNAME:** username, used by git as its `user.name` config when commit, defaults to "coding"
* **EMAIL:** email, used by git as its `user.email` config when commit, defaults to "coding@coding.net"
* **AVATAR:** user's avatar
* **CODING_IDE_HOME:** path to store WebIDE application's data

If changed, restart the application to let your configurations take effect. Note that changes on `USERNAME`, `EMAIL` *WILL NOT* apply to workspaces that are already created.


## Docker Server

```
Expand Down
23 changes: 19 additions & 4 deletions ide.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ valid_last_cmd() {
}

sub_help(){
echo "Usage: $PROG_NAME [-e <subcommand>"
echo "Usage: $PROG_NAME <subcommand>"
echo ""
echo "Subcommands:"
echo " build"
echo " build [-t tag]"
echo " run [-p port]"
echo " docker [build|run|attach|stop|logs|exec]"
echo ""
Expand Down Expand Up @@ -151,6 +151,8 @@ create_dir_if_not_exist() {

sub_docker() {

local OPTIND opt

check_docker() {
if ! docker ps > /dev/null 2>&1; then
output=$(docker ps)
Expand All @@ -164,12 +166,25 @@ sub_docker() {

check_docker

# process options
while getopts ":t:" opt; do
case $opt in
t)
EXTRA_VARS="-t ${OPTARG}"
;;
\?)
docker_usage
exit 1
;;
esac
done

case $1 in
"-h" | "--help")
docker_usage
;;
"build")
docker build -t webide/webide .
docker build $EXTRA_VARS .
;;
"run")
RUNNING=$(docker inspect --format="{{ .State.Running }}" $CONTAINER 2> /dev/null)
Expand Down Expand Up @@ -238,7 +253,7 @@ sub_run() {
EXTRA_VARS=-Drun.arguments="--server.port=${OPTARG}"
;;
\?)
build_usage
run_usage
exit 1
;;
esac
Expand Down