mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
@@ -52,20 +52,20 @@ function isBuildSigned(quality: string, commit: string): Promise<boolean> {
|
||||
});
|
||||
}
|
||||
|
||||
async function waitForSignedBuild(quality: string, commit: string): Promise<void> {
|
||||
let retries = 0;
|
||||
// async function waitForSignedBuild(quality: string, commit: string): Promise<void> {
|
||||
// let retries = 0;
|
||||
|
||||
while (retries < 180) {
|
||||
if (await isBuildSigned(quality, commit)) {
|
||||
return;
|
||||
}
|
||||
// while (retries < 180) {
|
||||
// if (await isBuildSigned(quality, commit)) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
await new Promise<void>(c => setTimeout(c, 10000));
|
||||
retries++;
|
||||
}
|
||||
// await new Promise<void>(c => setTimeout(c, 10000));
|
||||
// retries++;
|
||||
// }
|
||||
|
||||
throw new Error('Timed out waiting for signed build');
|
||||
}
|
||||
// throw new Error('Timed out waiting for signed build');
|
||||
// }
|
||||
|
||||
async function main(quality: string): Promise<void> {
|
||||
const commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
|
||||
@@ -73,10 +73,10 @@ async function main(quality: string): Promise<void> {
|
||||
console.log(`Queueing signing request for '${quality}/${commit}'...`);
|
||||
await queueSigningRequest(quality, commit);
|
||||
|
||||
console.log('Waiting on signed build...');
|
||||
await waitForSignedBuild(quality, commit);
|
||||
// console.log('Waiting on signed build...');
|
||||
// await waitForSignedBuild(quality, commit);
|
||||
|
||||
console.log('Found signed build!');
|
||||
// console.log('Found signed build!');
|
||||
}
|
||||
|
||||
main(process.argv[2]).catch(err => {
|
||||
|
||||
@@ -68,6 +68,7 @@ interface Asset {
|
||||
mooncakeUrl: string;
|
||||
hash: string;
|
||||
sha256hash: string;
|
||||
size: number;
|
||||
}
|
||||
|
||||
function createOrUpdate(commit: string, quality: string, platform: string, type: string, release: NewDocument, asset: Asset, isUpdate: boolean): Promise<void> {
|
||||
@@ -156,7 +157,7 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
|
||||
console.log('Publishing...');
|
||||
console.log('Quality:', quality);
|
||||
console.log('Platforn:', platform);
|
||||
console.log('Platform:', platform);
|
||||
console.log('Type:', type);
|
||||
console.log('Name:', name);
|
||||
console.log('Version:', version);
|
||||
@@ -165,6 +166,11 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
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)));
|
||||
const size = stat.size;
|
||||
|
||||
console.log('Size:', size);
|
||||
|
||||
const stream = fs.createReadStream(file);
|
||||
const [sha1hash, sha256hash] = await Promise.all([hashStream('sha1', stream), hashStream('sha256', stream)]);
|
||||
|
||||
@@ -224,7 +230,8 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
||||
mooncakeUrl: `${process.env['MOONCAKE_CDN_URL']}/${quality}/${blobName}`,
|
||||
hash: sha1hash,
|
||||
sha256hash
|
||||
sha256hash,
|
||||
size
|
||||
};
|
||||
|
||||
const release = {
|
||||
|
||||
@@ -37,5 +37,19 @@ step "Run unit tests" \
|
||||
step "Run integration tests" \
|
||||
./scripts/test-integration.sh
|
||||
|
||||
# function smoketest {
|
||||
# ARTIFACTS="$AGENT_BUILDDIRECTORY/smoketest-artifacts"
|
||||
# rm -rf $ARTIFACTS
|
||||
|
||||
# [[ "$VSCODE_QUALITY" == "insider" ]] && VSCODE_APPNAME="Visual Studio Code - Insiders" || VSCODE_APPNAME="Visual Studio Code"
|
||||
# npm run smoketest -- --build "$AGENT_BUILDDIRECTORY/VSCode-darwin/$VSCODE_APPNAME.app" --log $ARTIFACTS
|
||||
# }
|
||||
|
||||
# step "Run smoke test" \
|
||||
# smoketest
|
||||
|
||||
step "Publish release" \
|
||||
./build/tfs/darwin/release.sh
|
||||
|
||||
step "Generate and upload configuration.json" \
|
||||
npm run gulp -- upload-vscode-configuration
|
||||
|
||||
@@ -20,7 +20,7 @@ rm -rf $UNSIGNEDZIP
|
||||
zip -r -X -y $UNSIGNEDZIP *)
|
||||
|
||||
step "Upload unsigned archive" \
|
||||
node build/tfs/common/publish.js --upload-only $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP
|
||||
node build/tfs/common/publish.js $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP
|
||||
|
||||
step "Sign build" \
|
||||
node build/tfs/common/enqueue.js $VSCODE_QUALITY
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./build/tfs/common/node.sh
|
||||
. ./scripts/env.sh
|
||||
. ./build/tfs/common/common.sh
|
||||
|
||||
export VSCODE_MIXIN_PASSWORD="$1"
|
||||
VSO_PAT="$2"
|
||||
|
||||
echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc
|
||||
|
||||
step "Install dependencies" \
|
||||
npm install
|
||||
|
||||
step "Mix in repository from vscode-distro" \
|
||||
npm run gulp -- mixin
|
||||
|
||||
step "Install distro dependencies" \
|
||||
node build/tfs/common/installDistro.js
|
||||
|
||||
step "Build minified & upload source maps" \
|
||||
npm run gulp -- vscode-darwin-min
|
||||
|
||||
step "Run smoke test" \
|
||||
pushd test/smoke
|
||||
npm install
|
||||
npm test -- --latest "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron"
|
||||
popd
|
||||
@@ -39,5 +39,22 @@ step "Build minified" \
|
||||
step "Run unit tests" \
|
||||
./scripts/test.sh --build --reporter dot
|
||||
|
||||
# function smoketest {
|
||||
# id -u testuser &>/dev/null || (useradd -m testuser; chpasswd <<< testuser:testpassword)
|
||||
# sudo -i -u testuser -- sh -c 'git config --global user.name "VS Code Agent" && git config --global user.email "monacotools@microsoft.com"'
|
||||
|
||||
# ARTIFACTS="$AGENT_BUILDDIRECTORY/smoketest-artifacts"
|
||||
# rm -rf $ARTIFACTS
|
||||
# mkdir -p $ARTIFACTS
|
||||
# chown -R testuser $ARTIFACTS
|
||||
|
||||
# ps -o pid= -u testuser | xargs sudo kill -9
|
||||
# DISPLAY=:10 sudo -i -u testuser -- sh -c "cd $BUILD_SOURCESDIRECTORY/test/smoke && ./node_modules/.bin/mocha --build $AGENT_BUILDDIRECTORY/VSCode-linux-$ARCH --log $ARTIFACTS"
|
||||
# # DISPLAY=:10 sudo -i -u testuser -- sh -c "cd /vso/work/1/s/test/smoke && ./node_modules/.bin/mocha --build /vso/work/1/VSCode-linux-ia32"
|
||||
# }
|
||||
|
||||
# step "Run smoke test" \
|
||||
# smoketest
|
||||
|
||||
step "Publish release" \
|
||||
./build/tfs/linux/release.sh
|
||||
|
||||
@@ -40,6 +40,9 @@ ADD xvfb.init /etc/init.d/xvfb
|
||||
RUN chmod +x /etc/init.d/xvfb
|
||||
RUN update-rc.d xvfb defaults
|
||||
|
||||
# dbus
|
||||
RUN ln -sf /bin/dbus-daemon /usr/bin/dbus-daemon
|
||||
|
||||
# nvm
|
||||
ENV NVM_DIR /usr/local/nvm
|
||||
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
|
||||
@@ -47,4 +50,4 @@ RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | b
|
||||
# for libsecret
|
||||
ENV PKG_CONFIG_PATH /usr/lib/i386-linux-gnu/pkgconfig
|
||||
|
||||
CMD (service xvfb start; export DISPLAY=:10; ./start.sh)
|
||||
CMD (service xvfb start; service dbus start; export DISPLAY=:10; ./start.sh)
|
||||
@@ -9,6 +9,9 @@ step "Build Debian package" \
|
||||
step "Build RPM package" \
|
||||
npm run gulp -- "vscode-linux-$ARCH-build-rpm"
|
||||
|
||||
# step "Build snap package" \
|
||||
# npm run gulp -- "vscode-linux-$ARCH-build-snap"
|
||||
|
||||
(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \
|
||||
step "Install build dependencies" \
|
||||
npm install --unsafe-perm)
|
||||
@@ -49,6 +52,9 @@ RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
||||
step "Publish RPM package" \
|
||||
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_RPM package $RPM_FILENAME $VERSION true $RPM_PATH
|
||||
|
||||
# SNAP_FILENAME="$(ls $REPO/.build/linux/snap/$ARCH/ | grep .snap)"
|
||||
# SNAP_PATH="$REPO/.build/linux/snap/$ARCH/$SNAP_FILENAME"
|
||||
|
||||
if [ -z "$VSCODE_QUALITY" ]; then
|
||||
echo "VSCODE_QUALITY is not set, skipping repo package publish"
|
||||
else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
# This is a VERY basic script for Create/Delete operations on repos and packages
|
||||
#
|
||||
#
|
||||
cmd=$1
|
||||
urls=urls.txt
|
||||
defaultPackageFile=new_package.json
|
||||
@@ -53,7 +53,7 @@ function ParseConfigFile {
|
||||
fi
|
||||
BailIfFileMissing "$configFile"
|
||||
secretContents=$(cat "$configFile")
|
||||
|
||||
|
||||
server=$(ParseFromJson .server)
|
||||
protocol=$(ParseFromJson .protocol)
|
||||
port=$(ParseFromJson .port)
|
||||
@@ -135,14 +135,14 @@ function AddPackageByUrl
|
||||
rm -f $tmpFile $tmpOut
|
||||
Bail "File is not a valid deb/rpm package $url"
|
||||
fi
|
||||
|
||||
|
||||
rm -f $tmpFile $tmpOut
|
||||
if [ -z "$pkgName" ]; then
|
||||
Bail "Unable to parse package name for $url"
|
||||
elif [ -z "$pkgVer" ]; then
|
||||
Bail "Unable to parse package version number for $url"
|
||||
fi
|
||||
|
||||
|
||||
# Create Package .json file
|
||||
escapedUrl=$(echo "$url" | sed 's/\//\\\//g' | sed 's/\&/\\\&/g')
|
||||
cp $defaultPackageFile.template $defaultPackageFile
|
||||
@@ -153,7 +153,7 @@ function AddPackageByUrl
|
||||
# Perform Upload
|
||||
AddPackage $defaultPackageFile
|
||||
# Cleanup
|
||||
rm -f $defaultPackageFile
|
||||
rm -f $defaultPackageFile
|
||||
}
|
||||
|
||||
# Upload multiple packages by reading urls line-by-line from the specified file
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
. ./build/tfs/common/node.sh
|
||||
. ./scripts/env.sh
|
||||
. ./build/tfs/common/common.sh
|
||||
|
||||
export ARCH="$1"
|
||||
export VSCODE_MIXIN_PASSWORD="$2"
|
||||
VSO_PAT="$3"
|
||||
|
||||
echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc
|
||||
|
||||
step "Install dependencies" \
|
||||
npm install --arch=$ARCH --unsafe-perm
|
||||
|
||||
step "Mix in repository from vscode-distro" \
|
||||
npm run gulp -- mixin
|
||||
|
||||
step "Get Electron" \
|
||||
npm run gulp -- "electron-$ARCH"
|
||||
|
||||
step "Install distro dependencies" \
|
||||
node build/tfs/common/installDistro.js --arch=$ARCH
|
||||
|
||||
step "Build minified" \
|
||||
npm run gulp -- "vscode-linux-$ARCH-min"
|
||||
|
||||
function configureEnvironment {
|
||||
id -u testuser &>/dev/null || (useradd -m testuser; chpasswd <<< testuser:testpassword)
|
||||
sudo -i -u testuser git config --global user.name "VS Code Agent"
|
||||
sudo -i -u testuser git config --global user.email "monacotools@microsoft.com"
|
||||
chown -R testuser $AGENT_BUILDDIRECTORY
|
||||
}
|
||||
|
||||
function runTest {
|
||||
pushd test/smoke
|
||||
npm install
|
||||
sudo -u testuser -H xvfb-run -a -s "-screen 0 1024x768x8" npm test -- --latest "$AGENT_BUILDDIRECTORY/VSCode-linux-ia32/code-insiders"
|
||||
popd
|
||||
}
|
||||
|
||||
step "Configure environment" configureEnvironment
|
||||
|
||||
step "Run smoke test" runTest
|
||||
|
||||
@@ -36,8 +36,11 @@ ADD xvfb.init /etc/init.d/xvfb
|
||||
RUN chmod +x /etc/init.d/xvfb
|
||||
RUN update-rc.d xvfb defaults
|
||||
|
||||
# dbus
|
||||
RUN ln -sf /bin/dbus-daemon /usr/bin/dbus-daemon
|
||||
|
||||
# nvm
|
||||
ENV NVM_DIR /usr/local/nvm
|
||||
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
|
||||
|
||||
CMD (service xvfb start; export DISPLAY=:10; ./start.sh)
|
||||
CMD (service xvfb start; service dbus start; export DISPLAY=:10; ./start.sh)
|
||||
@@ -52,4 +52,11 @@ step "Run unit tests" {
|
||||
# exec { & .\scripts\test-integration.bat }
|
||||
# }
|
||||
|
||||
# step "Run smoke test" {
|
||||
# $Artifacts = "$env:AGENT_BUILDDIRECTORY\smoketest-artifacts"
|
||||
# Remove-Item -Recurse -Force -ErrorAction Ignore $Artifacts
|
||||
|
||||
# exec { & npm run smoketest -- --build "$env:AGENT_BUILDDIRECTORY\VSCode-win32-$global:arch" --log "$Artifacts" }
|
||||
# }
|
||||
|
||||
done
|
||||
|
||||
85
build/tfs/win32/build_unsigned.ps1
Normal file
85
build/tfs/win32/build_unsigned.ps1
Normal file
@@ -0,0 +1,85 @@
|
||||
Param(
|
||||
[string]$arch,
|
||||
[string]$mixinPassword,
|
||||
[string]$vsoPAT,
|
||||
[string]$storageKey,
|
||||
[string]$mooncakeStorageKey,
|
||||
[string]$documentDbKey
|
||||
)
|
||||
|
||||
. .\build\tfs\win32\node.ps1
|
||||
. .\scripts\env.ps1
|
||||
. .\build\tfs\win32\lib.ps1
|
||||
|
||||
# Create a _netrc file to download distro dependencies
|
||||
# In order to get _netrc to work, we need a HOME variable setup
|
||||
"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:HOME\_netrc" -Encoding ASCII
|
||||
|
||||
# Set the right architecture
|
||||
$env:npm_config_arch="$arch"
|
||||
|
||||
step "Install dependencies" {
|
||||
exec { & npm install }
|
||||
}
|
||||
|
||||
step "Hygiene" {
|
||||
exec { & npm run gulp -- hygiene }
|
||||
}
|
||||
|
||||
$env:VSCODE_MIXIN_PASSWORD = $mixinPassword
|
||||
step "Mix in repository from vscode-distro" {
|
||||
exec { & npm run gulp -- mixin }
|
||||
}
|
||||
|
||||
step "Get Electron" {
|
||||
exec { & npm run gulp -- "electron-$global:arch" }
|
||||
}
|
||||
|
||||
step "Install distro dependencies" {
|
||||
exec { & node build\tfs\common\installDistro.js }
|
||||
}
|
||||
|
||||
step "Build minified" {
|
||||
exec { & npm run gulp -- "vscode-win32-$global:arch-min" }
|
||||
}
|
||||
|
||||
step "Run unit tests" {
|
||||
exec { & .\scripts\test.bat --build --reporter dot }
|
||||
}
|
||||
|
||||
step "Run smoke test" {
|
||||
$Artifacts = "$env:AGENT_BUILDDIRECTORY\smoketest-artifacts"
|
||||
Remove-Item -Recurse -Force -ErrorAction Ignore $Artifacts
|
||||
|
||||
exec { & npm run smoketest -- --build "$env:AGENT_BUILDDIRECTORY\VSCode-win32-$global:arch" --log "$Artifacts" }
|
||||
}
|
||||
|
||||
step "Create archive and setup package" {
|
||||
exec { & npm run gulp -- "vscode-win32-$global:arch-archive" "vscode-win32-$global:arch-setup" }
|
||||
}
|
||||
|
||||
$Repo = "$(pwd)"
|
||||
$Root = "$Repo\.."
|
||||
$Exe = "$Repo\.build\win32-$arch\setup\VSCodeSetup.exe"
|
||||
$Zip = "$Repo\.build\win32-$arch\archive\VSCode-win32-$arch.zip"
|
||||
$Build = "$Root\VSCode-win32-$arch"
|
||||
|
||||
# get version
|
||||
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
|
||||
$Version = $PackageJson.version
|
||||
$Quality = "$env:VSCODE_QUALITY"
|
||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = $storageKey
|
||||
$env:MOONCAKE_STORAGE_ACCESS_KEY = $mooncakeStorageKey
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = $documentDbKey
|
||||
|
||||
$assetPlatform = if ($arch -eq "ia32") { "win32" } else { "win32-x64" }
|
||||
|
||||
step "Publish UNSIGNED archive" {
|
||||
exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform-archive" archive-unsigned "VSCode-win32-$global:arch-$Version-unsigned.zip" $Version false $Zip }
|
||||
}
|
||||
|
||||
step "Publish UNSIGNED setup package" {
|
||||
exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup-unsigned "VSCodeSetup-$global:arch-$Version-unsigned.exe" $Version false $Exe }
|
||||
}
|
||||
|
||||
done
|
||||
@@ -1,47 +0,0 @@
|
||||
Param(
|
||||
[string]$arch,
|
||||
[string]$mixinPassword,
|
||||
[string]$vsoPAT
|
||||
)
|
||||
|
||||
. .\build\tfs\win32\node.ps1
|
||||
. .\scripts\env.ps1
|
||||
. .\build\tfs\win32\lib.ps1
|
||||
|
||||
# Create a _netrc file to download distro dependencies
|
||||
# In order to get _netrc to work, we need a HOME variable setup
|
||||
$env:HOME = $env:USERPROFILE
|
||||
"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
||||
|
||||
# Set the right architecture
|
||||
$env:npm_config_arch = "$arch"
|
||||
|
||||
step "Install dependencies" {
|
||||
exec { & npm install }
|
||||
}
|
||||
|
||||
$env:VSCODE_MIXIN_PASSWORD = $mixinPassword
|
||||
step "Mix in repository from vscode-distro" {
|
||||
exec { & npm run gulp -- mixin }
|
||||
}
|
||||
|
||||
step "Get Electron" {
|
||||
exec { & npm run gulp -- "electron-$global:arch" }
|
||||
}
|
||||
|
||||
step "Install distro dependencies" {
|
||||
exec { & node build\tfs\common\installDistro.js }
|
||||
}
|
||||
|
||||
step "Build minified" {
|
||||
exec { & npm run gulp -- "vscode-win32-$global:arch-min" }
|
||||
}
|
||||
|
||||
step "Run smoke test" {
|
||||
exec { & Push-Location test\smoke }
|
||||
exec { & npm install }
|
||||
exec { & npm test -- --latest "$env:AGENT_BUILDDIRECTORY\VSCode-win32-$global:arch\Code - Insiders.exe" }
|
||||
exec { & Pop-Location }
|
||||
}
|
||||
|
||||
done
|
||||
Reference in New Issue
Block a user