File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- pat
1+ pat
2+ * .js
Original file line number Diff line number Diff line change 1+ /*---------------------------------------------------------------------------------------------
2+ * Copyright (c) Microsoft Corporation. All rights reserved.
3+ * Licensed under the MIT License. See License.txt in the project root for license information.
4+ *--------------------------------------------------------------------------------------------*/
5+
6+ 'use strict' ;
7+
8+ import { DocumentClient } from 'documentdb' ;
9+
10+ interface Config {
11+ id : string ;
12+ frozen : boolean ;
13+ }
14+
15+ function createDefaultConfig ( quality : string ) : Config {
16+ return {
17+ id : quality ,
18+ frozen : false
19+ } ;
20+ }
21+
22+ function getConfig ( quality : string ) : Promise < Config > {
23+ const client = new DocumentClient ( process . env [ 'AZURE_DOCUMENTDB_ENDPOINT' ] , { masterKey : process . env [ 'AZURE_DOCUMENTDB_MASTERKEY' ] } ) ;
24+ const collection = 'dbs/builds/colls/config' ;
25+ const query = {
26+ query : `SELECT TOP 1 * FROM c WHERE c.id = @quality` ,
27+ parameters : [
28+ { name : '@quality' , value : quality }
29+ ]
30+ } ;
31+
32+ return new Promise < Config > ( ( c , e ) => {
33+ client . queryDocuments ( collection , query ) . toArray ( ( err , results ) => {
34+ if ( err && err . code !== 409 ) { return e ( err ) ; }
35+
36+ c ( ! results || results . length === 0 ? createDefaultConfig ( quality ) : results [ 0 ] as any as Config ) ;
37+ } ) ;
38+ } ) ;
39+ }
40+
41+ getConfig ( process . argv [ 2 ] )
42+ . then ( c => console . log ( c . frozen ) , e => console . error ( e ) ) ;
Original file line number Diff line number Diff line change @@ -55,8 +55,12 @@ step "Publish RPM package" \
5555# SNAP_FILENAME="$(ls $REPO/.build/linux/snap/$ARCH/ | grep .snap)"
5656# SNAP_PATH="$REPO/.build/linux/snap/$ARCH/$SNAP_FILENAME"
5757
58+ IS_FROZEN=" $( node build/tfs/linux/frozen-check.js $VSCODE_QUALITY ) "
59+
5860if [ -z " $VSCODE_QUALITY " ]; then
5961 echo " VSCODE_QUALITY is not set, skipping repo package publish"
62+ elif [ " $IS_FROZEN " = " true" ]; then
63+ echo " $VSCODE_QUALITY is frozen, skipping repo package publish"
6064else
6165 if [ " $BUILD_SOURCEBRANCH " = " master" ] || [ " $BUILD_SOURCEBRANCH " = " refs/heads/master" ]; then
6266 if [[ $BUILD_QUEUEDBY = * " Project Collection Service Accounts" * || $BUILD_QUEUEDBY = * " Microsoft.VisualStudio.Services.TFS" * ]]; then
You can’t perform that action at this time.
0 commit comments