Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
旅途_2012
vscode
提交
32336018
V
vscode
项目概览
旅途_2012
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
32336018
编写于
6月 21, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build: release only iff all builds succeed, introduce VSCODE_RELEASE env
上级
9ff8ae03
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
147 addition
and
20 deletion
+147
-20
build/azure-pipelines/common/publish.ts
build/azure-pipelines/common/publish.ts
+1
-14
build/azure-pipelines/common/release.ts
build/azure-pipelines/common/release.ts
+109
-0
build/azure-pipelines/common/sync-mooncake.ts
build/azure-pipelines/common/sync-mooncake.ts
+0
-5
build/azure-pipelines/product-build.yml
build/azure-pipelines/product-build.yml
+15
-1
build/azure-pipelines/release.yml
build/azure-pipelines/release.yml
+22
-0
未找到文件。
build/azure-pipelines/common/publish.ts
浏览文件 @
32336018
...
...
@@ -151,13 +151,6 @@ async function publish(commit: string, quality: string, platform: string, type:
const
queuedBy
=
process
.
env
[
'
BUILD_QUEUEDBY
'
]
!
;
const
sourceBranch
=
process
.
env
[
'
BUILD_SOURCEBRANCH
'
]
!
;
const
isReleased
=
(
// Insiders: nightly build from master
(
quality
===
'
insider
'
&&
/^master$|^refs
\/
heads
\/
master$/
.
test
(
sourceBranch
)
&&
/Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/
.
test
(
queuedBy
))
||
// Exploration: any build from electron-4.0.x branch
(
quality
===
'
exploration
'
&&
/^electron-4.0.x$|^refs
\/
heads
\/
electron-4.0.x$/
.
test
(
sourceBranch
))
);
console
.
log
(
'
Publishing...
'
);
console
.
log
(
'
Quality:
'
,
quality
);
...
...
@@ -167,7 +160,6 @@ async function publish(commit: string, quality: string, platform: string, type:
console
.
log
(
'
Version:
'
,
version
);
console
.
log
(
'
Commit:
'
,
commit
);
console
.
log
(
'
Is Update:
'
,
isUpdate
);
console
.
log
(
'
Is Released:
'
,
isReleased
);
console
.
log
(
'
File:
'
,
file
);
const
stat
=
await
new
Promise
<
fs
.
Stats
>
((
c
,
e
)
=>
fs
.
stat
(
file
,
(
err
,
stat
)
=>
err
?
e
(
err
)
:
c
(
stat
)));
...
...
@@ -226,7 +218,7 @@ async function publish(commit: string, quality: string, platform: string, type:
id
:
commit
,
timestamp
:
(
new
Date
()).
getTime
(),
version
,
isReleased
:
config
.
frozen
?
false
:
isReleased
,
isReleased
:
false
,
sourceBranch
,
queuedBy
,
assets
:
[]
as
Array
<
Asset
>
,
...
...
@@ -245,11 +237,6 @@ async function publish(commit: string, quality: string, platform: string, type:
}
function
main
():
void
{
if
(
process
.
env
[
'
VSCODE_BUILD_SKIP_PUBLISH
'
])
{
console
.
warn
(
'
Skipping publish due to VSCODE_BUILD_SKIP_PUBLISH
'
);
return
;
}
const
commit
=
process
.
env
[
'
BUILD_SOURCEVERSION
'
];
if
(
!
commit
)
{
...
...
build/azure-pipelines/common/release.ts
0 → 100644
浏览文件 @
32336018
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
DocumentClient
}
from
'
documentdb
'
;
interface
Config
{
id
:
string
;
frozen
:
boolean
;
}
function
createDefaultConfig
(
quality
:
string
):
Config
{
return
{
id
:
quality
,
frozen
:
false
};
}
function
getConfig
(
quality
:
string
):
Promise
<
Config
>
{
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
]
!
,
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
collection
=
'
dbs/builds/colls/config
'
;
const
query
=
{
query
:
`SELECT TOP 1 * FROM c WHERE c.id = @quality`
,
parameters
:
[
{
name
:
'
@quality
'
,
value
:
quality
}
]
};
return
new
Promise
<
Config
>
((
c
,
e
)
=>
{
client
.
queryDocuments
(
collection
,
query
).
toArray
((
err
,
results
)
=>
{
if
(
err
&&
err
.
code
!==
409
)
{
return
e
(
err
);
}
c
(
!
results
||
results
.
length
===
0
?
createDefaultConfig
(
quality
)
:
results
[
0
]
as
any
as
Config
);
});
});
}
function
doRelease
(
commit
:
string
,
quality
:
string
):
Promise
<
void
>
{
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
]
!
,
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
collection
=
'
dbs/builds/colls/
'
+
quality
;
const
query
=
{
query
:
'
SELECT TOP 1 * FROM c WHERE c.id = @id
'
,
parameters
:
[{
name
:
'
@id
'
,
value
:
commit
}]
};
let
updateTries
=
0
;
function
update
():
Promise
<
void
>
{
updateTries
++
;
return
new
Promise
<
void
>
((
c
,
e
)
=>
{
client
.
queryDocuments
(
collection
,
query
).
toArray
((
err
,
results
)
=>
{
if
(
err
)
{
return
e
(
err
);
}
if
(
results
.
length
!==
1
)
{
return
e
(
new
Error
(
'
No documents
'
));
}
const
release
=
results
[
0
];
release
.
isReleased
=
true
;
client
.
replaceDocument
(
release
.
_self
,
release
,
err
=>
{
if
(
err
&&
err
.
code
===
409
&&
updateTries
<
5
)
{
return
c
(
update
());
}
if
(
err
)
{
return
e
(
err
);
}
console
.
log
(
'
Build successfully updated.
'
);
c
();
});
});
});
}
return
update
();
}
async
function
release
(
commit
:
string
,
quality
:
string
):
Promise
<
void
>
{
const
config
=
await
getConfig
(
quality
);
console
.
log
(
'
Quality config:
'
,
config
);
if
(
config
.
frozen
)
{
console
.
log
(
`Skipping release because quality
${
quality
}
is frozen.`
);
return
;
}
await
doRelease
(
commit
,
quality
);
}
function
env
(
name
:
string
):
string
{
const
result
=
process
.
env
[
name
];
if
(
!
result
)
{
throw
new
Error
(
`Skipping release due to missing env:
${
name
}
`
);
}
return
result
;
}
async
function
main
():
Promise
<
void
>
{
const
commit
=
env
(
'
BUILD_SOURCEVERSION
'
);
const
quality
=
env
(
'
VSCODE_QUALITY
'
);
await
release
(
commit
,
quality
);
}
main
().
catch
(
err
=>
{
console
.
error
(
err
);
process
.
exit
(
1
);
});
build/azure-pipelines/common/sync-mooncake.ts
浏览文件 @
32336018
...
...
@@ -153,11 +153,6 @@ async function sync(commit: string, quality: string): Promise<void> {
}
function
main
():
void
{
if
(
process
.
env
[
'
VSCODE_BUILD_SKIP_PUBLISH
'
])
{
error
(
'
Skipping publish due to VSCODE_BUILD_SKIP_PUBLISH
'
);
return
;
}
const
commit
=
process
.
env
[
'
BUILD_SOURCEVERSION
'
];
if
(
!
commit
)
{
...
...
build/azure-pipelines/product-build.yml
浏览文件 @
32336018
...
...
@@ -78,8 +78,22 @@ jobs:
steps
:
-
template
:
darwin/product-build-darwin.yml
-
job
:
Release
condition
:
and(succeeded(), or(eq(variables['VSCODE_RELEASE'], 'true'), and(eq(variables['VSCODE_QUALITY'], 'insider'), eq(variables['Build.Reason'], 'Schedule')), and(eq(variables['VSCODE_QUALITY'], 'exploration'), eq(variables['Build.SourceBranch'], 'refs/heads/electron-4.0.x'))))
pool
:
vmImage
:
'
Ubuntu-16.04'
dependsOn
:
-
Windows
-
Windows32
-
Linux
-
LinuxSnap
-
LinuxArmhf
-
LinuxAlpine
-
macOS
steps
:
-
template
:
release.yml
-
job
:
Mooncake
timeoutInMinutes
:
120
pool
:
vmImage
:
'
Ubuntu-16.04'
condition
:
true
...
...
build/azure-pipelines/release.yml
0 → 100644
浏览文件 @
32336018
steps
:
-
task
:
NodeTool@0
inputs
:
versionSpec
:
"
10.x"
-
task
:
geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs
:
versionSpec
:
"
1.x"
-
task
:
AzureKeyVault@1
displayName
:
'
Azure
Key
Vault:
Get
Secrets'
inputs
:
azureSubscription
:
'
vscode-builds-subscription'
KeyVaultName
:
vscode
-
script
:
|
set -e
(cd build ; yarn)
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
node build/azure-pipelines/common/release.js
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录