-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish the script for deploying in docker
In this commit, we finish the script for deploying in docker. We found that `systemd` can not be used in docker, so we use `Sys V Init` to start a service in docker. This commit is related with #8. Those below are not finished yet: * Create database automatically.
- Loading branch information
1 parent
6ed74c4
commit 4ae8e63
Showing
6 changed files
with
290 additions
and
113 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,38 @@ | ||
# gcs-back-end | ||
`git`中央仓库服务的后端实现。 | ||
`git` 中央仓库服务的后端实现。 | ||
|
||
# 部署设置说明 | ||
| 变量 | 类型 | 默认值 | 说明 | | ||
| - | - | - | - | | ||
| `deploy` | `bool` | `true` | 是否进行部署,当为`false`只进行打包操作。 | | ||
| `deploy` | `bool` | `true` | 是否进行部署,当为 `false` 只进行打包操作。 | | ||
| `debug` | `bool` | `false` | 是否启用调试模式。 | | ||
| `skipTest` | `bool` | `true` | 是否跳过测试。 | | ||
| `createGitUser` | `bool` | `true` | 是否创建`git`用户。 | | ||
| `deployWithDocker` | `bool` | `true` | 是否使用`Docker`进行部署。 | | ||
| `repositoryDirectory` | `string` | `"/home/git/repositories"` | `git`仓库存放目录。 | | ||
| `postgresPassword` | `string` | `null` | `Postgres`数据库密码。 | | ||
| `serviceEnable` | `bool` | `true` | 是否启用`systemd`服务。 | | ||
| `serviceName` | `string` | `"gcs"` | `systemd`服务名称。 | | ||
| `serviceSuffix` | `string` | `"service"` | `systemd`服务文件后缀。 | | ||
| `serviceDescription` | `string` | `"Git server center back-end service"` | `systemd`服务描述。 | | ||
| `servicePIDFile` | `string` | `"/var/run/gcs.pid"` | `systemd`服务`PID`文件。 | | ||
| `serviceUser` | `string` | `gcs` | `systemd`服务运行用户。 | | ||
| `serviceUserPassword` | `string` | `null` | `systemd`服务运行用户密码。 | | ||
| `serviceWorkingDirectory` | `string` | `"/opt/gcs"` | `systemd`服务工作目录。 | | ||
| `serviceRestartPolicy` | `string` | `"always"` | `systemd`服务重启策略。 | | ||
| `serviceRestartDelaySeconds` | `int` | `5` | `systemd`服务重启延迟时间。 | | ||
| `serviceStartJavaCommand` | `string` | `"/usr/bin/java"` | `systemd`服务启动`Java`命令。 | | ||
| `serviceStartJavaArgs` | `list` | `["-jar"]` | `systemd`服务启动`Java`参数。 | | ||
| `serviceStartJarFile` | `string` | `"/opt/gcs/gcs.jar"` | `systemd`服务启动`Jar`文件。脚本会将`maven`打包出来的文件拷贝到该位置。 | | ||
| `serviceAfter` | `list` | `["network.target"]` | `systemd`服务会在这些服务启动后启动。 | | ||
| `serviceWantedBy` | `list` | `"multi-user.target"` | `systemd`服务会被这些服务依赖。 | | ||
| `createGitUser` | `bool` | `true` | 是否创建 `git` 用户。 | | ||
| `deployWithDocker` | `bool` | `true` | 是否使用 `Docker` 进行部署。 | | ||
| `dockerName` | `string` | `"gcs-backend"` | `Docker` 容器名称。 | | ||
| `dockerImage` | `string` | `"ubuntu:latest"` | `Docker` 镜像。 | | ||
| `dockerPortMapping` | `list` | `["8080:8080"]` | `Docker` 端口映射。 | | ||
| `dockerWithGpu` | `bool` | `false` | `Docker` 是否使用 `GPU`。 | | ||
| `dockerSrcPath` | `string` | `"/opt/gcs-back-end-src"` | `Docker` 中源码路径。源码会被拷贝到该路径进行编译。 | | ||
| `repositoryDirectory` | `string` | `"/home/git/repositories"` | `git` 仓库存放目录。 | | ||
| `postgresPassword` | `string` | `null` | `Postgres` 数据库密码。 | | ||
| `serviceEnable` | `bool` | `true` | 是否启用 `systemd` 服务。 | | ||
| `serviceName` | `string` | `"gcs"` | 服务名称。 | | ||
| `serviceDescription` | `string` | `"Git server center back-end service"` | 服务描述。 | | ||
| `servicePIDFile` | `string` | `"/var/run/gcs.pid"` | 服务 `PID` 文件。 | | ||
| `serviceUser` | `string` | `gcs` | 服务运行用户。 | | ||
| `serviceUserPassword` | `string` | `null` | 服务运行用户密码。 | | ||
| `serviceStartJavaCommand` | `string` | `"/usr/bin/java"` | 服务启动的 `Java` 命令。 | | ||
| `serviceStartJavaArgs` | `list` | `["-jar"]` | 服务启动的 `Java` 参数。 | | ||
| `serviceStartJarFile` | `string` | `"/opt/gcs/gcs.jar"` | 服务启动的 `Jar` 文件。脚本会将 `maven` 打包出来的文件拷贝到该位置。 | | ||
| `serviceSuffix` | `string` | `"service"` | `systemd` 服务文件后缀。 | | ||
| `serviceWorkingDirectory` | `string` | `"/opt/gcs"` | `systemd` 服务工作目录。 | | ||
| `serviceRestartPolicy` | `string` | `"always"` | `systemd` 服务重启策略。 | | ||
| `serviceRestartDelaySeconds` | `int` | `5` | `systemd` 服务重启延迟时间。 | | ||
| `serviceAfter` | `list` | `["network.target"]` | `systemd` 服务会在这些服务启动后启动。 | | ||
| `serviceWantedBy` | `list` | `"multi-user.target"` | `systemd` 服务会被这些服务依赖。 | | ||
| `serviceSystemdDirectory` | `string` | `"/etc/systemd/system"` | `systemd` 服务文件存放目录。 | | ||
| `serviceSysVInitDirectory` | `string` | `"/etc/init.d"` | `Sys-Init-V` 服务文件存放目录。 | | ||
| `serviceStartWithBoot` | `bool` | `true` | `Sys-Init-V` 服务是否随系统启动。 | | ||
| `serviceLogFile` | `string` | `"/tmp/log/gcs.log"` | `Sys-Init-V` 服务日志文件。 | | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"createGitUser": false, | ||
"repositoryDirectory": "~/.local/gcs/repository", | ||
"debug": true, | ||
"skipTest": false | ||
} |
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
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
Oops, something went wrong.