@atomservice/gitea 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/gitea.compose.ts +8 -3
- package/src/gitea.options.ts +3 -10
- package/src/gitea.service.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomservice/gitea",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Gitea 原子服务",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "openorson",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
".": "./src/index.ts"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atomservice/gateway": "0.1.
|
|
31
|
+
"@atomservice/gateway": "0.1.19"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@atomservice/core": "0.1.
|
|
34
|
+
"@atomservice/core": "0.1.19"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/gitea.compose.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ServiceResourcesOptions, ServiceRestartPolicy } from "@atomservice/core"
|
|
2
|
+
import { composeResourcesBlock, tmpl } from "@atomservice/core"
|
|
2
3
|
import { GITEA_IMAGE } from "./gitea.consts.ts"
|
|
3
4
|
|
|
4
5
|
export interface GiteaComposeOptions {
|
|
@@ -6,10 +7,14 @@ export interface GiteaComposeOptions {
|
|
|
6
7
|
environment?: Record<string, string>
|
|
7
8
|
hostPort?: number
|
|
8
9
|
sshHostPort?: number
|
|
10
|
+
resources?: ServiceResourcesOptions
|
|
11
|
+
restart?: ServiceRestartPolicy
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export function giteaCompose(id: string, version: string, dataDir: string, opts: GiteaComposeOptions): string {
|
|
12
|
-
const { rootless, environment, hostPort, sshHostPort } = opts
|
|
15
|
+
const { rootless, environment, hostPort, sshHostPort, resources, restart: restartOpt } = opts
|
|
16
|
+
const resourcesBlock = composeResourcesBlock(resources)
|
|
17
|
+
const restart = restartOpt ?? "unless-stopped"
|
|
13
18
|
const port = 3000
|
|
14
19
|
const uid = 1000
|
|
15
20
|
const gid = 1000
|
|
@@ -44,7 +49,7 @@ services:
|
|
|
44
49
|
- ${dataDir}:${volumeTarget}
|
|
45
50
|
networks:
|
|
46
51
|
- atomservice
|
|
47
|
-
restart:
|
|
52
|
+
restart: ${restart}${resourcesBlock}
|
|
48
53
|
healthcheck:
|
|
49
54
|
test: ["CMD", "curl", "-sf", "http://localhost:${port}/api/healthz"]
|
|
50
55
|
interval: 10s
|
package/src/gitea.options.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import type { CallableService } from "@atomservice/core"
|
|
1
|
+
import type { BaseServiceOptions, CallableService } from "@atomservice/core"
|
|
2
2
|
import type { GatewayInstance } from "@atomservice/gateway"
|
|
3
3
|
|
|
4
|
-
export interface GiteaOptions {
|
|
5
|
-
/**
|
|
6
|
-
* 实例标识
|
|
7
|
-
*
|
|
8
|
-
* - 用于区分不同实例
|
|
9
|
-
*
|
|
10
|
-
* @default "default"
|
|
11
|
-
*/
|
|
12
|
-
id?: string
|
|
4
|
+
export interface GiteaOptions extends BaseServiceOptions {
|
|
13
5
|
/**
|
|
6
|
+
|
|
14
7
|
* 镜像版本
|
|
15
8
|
*
|
|
16
9
|
* @default "1"
|
package/src/gitea.service.ts
CHANGED