Skip to content

Commit

Permalink
Edit .onedev-buildspec.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LainNetWork committed Apr 27, 2022
1 parent 708992f commit dc87273
Showing 1 changed file with 35 additions and 22 deletions.
57 changes: 35 additions & 22 deletions .onedev-buildspec.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,64 @@
version: 8
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
commands:
- git push -f https://oauth2:@secret:githubAccessToken@@@github.com/LainNetWork/psyche
HEAD:master
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: 250m
memoryRequirement: 128m
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
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"
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: 250m
memoryRequirement: 128m
cpuRequirement: 250
memoryRequirement: 128
timeout: 3600

0 comments on commit dc87273

Please sign in to comment.