Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tke-eos
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
tke-eos
Commits
f1e9e808
Commit
f1e9e808
authored
Dec 31, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
环境所有者
parent
56bfbb17
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
18 deletions
+4
-18
dailySyncDB.js
app/dailySyncDB.js
+1
-1
namespace.js
app/namespace.js
+0
-15
restartLatest.js
app/restartLatest.js
+2
-2
service.js
kubeService/service.js
+1
-0
No files found.
app/dailySyncDB.js
View file @
f1e9e808
...
...
@@ -66,7 +66,7 @@ const syncDB = async (cluster) => {
module
.
exports
=
()
=>
{
// schedule.scheduleJob('*/2 * * * *', async () => {
schedule
.
scheduleJob
(
'
0
1
* * *
'
,
async
()
=>
{
schedule
.
scheduleJob
(
'
0
23
* * *
'
,
async
()
=>
{
try
{
await
syncDB
(
'
qa
'
)
}
catch
(
e
)
{
...
...
app/namespace.js
View file @
f1e9e808
...
...
@@ -30,18 +30,3 @@ router.post('/create', async (ctx) => {
await
createNamespace
(
ctx
.
client
,
ctx
.
request
.
body
.
name
,
ctx
.
request
.
body
.
description
)
ctx
.
body
=
ctx
.
ok
()
})
// function generateUUID() {
// let d = new Date().getTime();
// const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
// const r = (d + Math.random() * 16) % 16 | 0;
// d = Math.floor(d / 16);
// return (c === 'x' ? r : ((r & 0x3) | 0x8)).toString(16);
// });
// return uuid;
// }
//
// router.get('/get_code', async (ctx) => {
// newNsKey = newNsKey === '' ? generateUUID() : newNsKey
// ctx.body = ctx.ok(newNsKey)
// })
app/restartLatest.js
View file @
f1e9e808
...
...
@@ -35,7 +35,7 @@ const deploy = async (cluster) => {
const
repoName
=
svc
.
image
.
split
(
'
:
'
)[
0
].
split
(
'
/
'
).
slice
(
1
).
join
(
'
/
'
)
const
latest
=
await
container
.
getTagByName
(
repoName
,
'
latest
'
)
const
latestImageID
=
_
.
get
(
latest
.
tagInfo
,
'
[0].tagId
'
,
''
)
if
(
svc
.
imageID
.
split
(
'
@
'
)[
1
]
!==
latestImageID
)
{
if
(
latestImageID
&&
latestImageID
!==
svc
.
imageID
.
split
(
'
@
'
)[
1
]
)
{
logger
.
info
(
'
latest不一致,部署项目
'
,
namespace
.
name
,
svc
.
podName
)
summary
[
namespace
.
name
].
latestArray
.
push
(
svc
.
serviceName
)
await
serviceRestart
(
client
.
clientInfo
,
namespace
.
name
,
svc
.
podName
)
...
...
@@ -86,7 +86,7 @@ const deploy = async (cluster) => {
module
.
exports
=
()
=>
{
// schedule.scheduleJob('*/2 * * * *', async () => {
schedule
.
scheduleJob
(
'
0
3
* * *
'
,
async
()
=>
{
schedule
.
scheduleJob
(
'
0
1
* * *
'
,
async
()
=>
{
try
{
await
deploy
(
'
qa
'
)
}
catch
(
e
)
{
...
...
kubeService/service.js
View file @
f1e9e808
...
...
@@ -17,6 +17,7 @@ const getAllNamespace = async (client) => {
data
.
namespaces
.
push
({
name
:
item
.
metadata
.
name
,
description
:
item
.
metadata
.
annotations
?
item
.
metadata
.
annotations
.
description
:
''
,
owner
:
item
.
metadata
.
annotations
?
item
.
metadata
.
annotations
.
owner
:
''
,
status
:
item
.
status
?
item
.
status
.
phase
:
''
,
createdAt
:
moment
(
item
.
metadata
.
creationTimestamp
)
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment