-
Notifications
You must be signed in to change notification settings - Fork 0
/
.onedev-buildspec.yml
64 lines (64 loc) · 1.86 KB
/
.onedev-buildspec.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: 15
jobs:
- name: SyncGithub
steps:
- !CheckoutStep
name: check out
cloneCredential: !DefaultCredential {}
withLfs: false
withSubmodules: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: Sync To Github
runInContainer: true
image: alpine/git:v2.30.2
interpreter: !DefaultInterpreter
commands:
- git push -f https://oauth2:@secret:githubAccessToken@@@github.com/LainNetWork/psyche
HEAD:master
useTTY: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers:
- !BranchUpdateTrigger
branches: master
retryCondition: never
maxRetries: 3
retryDelay: 30
cpuRequirement: 250
memoryRequirement: 128
timeout: 3600
- name: build server
steps:
- !CheckoutStep
name: check out
cloneCredential: !DefaultCredential {}
withLfs: false
withSubmodules: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: exec build
runInContainer: true
image: docker:19.03.5
interpreter: !DefaultInterpreter
commands:
- echo "start build @project_name@ image"
- if [ $(docker ps -a | grep -c "@project_name@") -gt 0 ]
- 'then '
- "\tdocker stop @project_name@;"
- ' docker rm @project_name@;'
- ' docker rmi lain/@project_name@;'
- fi;
- cd server
- docker build -t lain/@project_name@ .
- docker run -d -p 9966:7899 --net lainnet --name @project_name@ --restart=always
lain/@project_name@ --token @secret:gitRepoToken@ --url @secret:gitRepoUrl@
--branch @secret:gitRepoBranch@ --refreshDuration @secret:gitRepoRefreshDuration@
- echo "end build @project_name@ image"
useTTY: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
retryCondition: never
maxRetries: 3
retryDelay: 30
cpuRequirement: 250
memoryRequirement: 128
timeout: 3600