Skip to content

Commit d3752bc

Browse files
authored
Merge pull request Azure#3791 from Visual-Studio-China/dev
Update appveyor.yml to use external script
2 parents 800a45c + 573e5d6 commit d3752bc

File tree

1 file changed

+15
-47
lines changed

1 file changed

+15
-47
lines changed

appveyor.yml

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,29 @@ branches:
22
only:
33
- master
44
environment:
5+
nodejs_version: "6"
56
github_access_token:
67
secure: VMFbecLLHzDq/09YDPbcM0VDDSwwgY57vr5GXK6cZZ4Ti/Xs5RZoylzV8MMr1350
78

8-
build_script:
9-
- ps: |
10-
$ErrorActionPreference = "Stop"
11-
$response = Invoke-WebRequest ("https://api.github.com/repos/" + $env:APPVEYOR_REPO_NAME + "/releases/latest") -Timeout 10
12-
if($response -ne $null -and $response.StatusCode -ne 200)
13-
{
14-
$host.SetShouldExit(1)
15-
}
16-
17-
$unzip_path = "C:\projects\release"
18-
$unzip_file = $unzip_path + "zip"
19-
Invoke-WebRequest ($response.Content | ConvertFrom-Json).zipball_url -OutFile $unzip_file
20-
7z x $unzip_file -o"$unzip_path"
21-
$src = Join-Path (ls $unzip_path -dir | select -First 1 | % { $_.FullName }) "src"
22-
$global:output = Join-Path $unzip_path "output"
23-
ni $global:output -type dir
24-
$pattern = "\d(.\d)*"
25-
26-
foreach($folder in (ls $src -dir))
27-
{
28-
foreach($module in (ls $folder.FullName -dir | % { $_.FullName }))
29-
{
30-
# find out docs in help folder and version in .psd1 file
31-
$help = ls $module -dir -Recurse | ? { $_.Name -eq "help" } | select -First 1 | % { $_.FullName }
32-
if($help -eq $null)
33-
{
34-
continue
35-
}
36-
$psd1= ls $module | ? { $_.extension -eq ".psd1" } | select -First 1 | % { $_.FullName }
37-
if($psd1 -eq $null)
38-
{
39-
continue
40-
}
41-
if((gc $psd1 | Out-String) -notmatch "ModuleVersion\s*=\s*'$pattern'")
42-
{
43-
continue
44-
}
45-
if($matches[0] -match $pattern)
46-
{
47-
robocopy $help "*.md" (Join-Path $global:output $folder | Join-Path -ChildPath (gi $psd1).BaseName | Join-Path -ChildPath ("v" + $matches[0]))
48-
}
49-
}
50-
}
51-
test: off
52-
shallow_clone: true
53-
on_success:
9+
before_build:
10+
- ps: Install-Product node $env:nodejs_version
5411
- git config --global credential.helper store
5512
- ps: ac "$env:USERPROFILE\.git-credentials" "https://$($env:github_access_token):[email protected]`n"
5613
- git config --global user.email %email%
5714
- git config --global user.name %name%
15+
- git clone -q https://github.com/MicrosoftDocs/azure-psdocs-ciscripts azpsci
16+
- cd azpsci
17+
- npm install
18+
- npm install typescript
19+
- node ./node_modules/typescript/bin/tsc
20+
- cd ..
21+
build_script:
22+
- node azpsci/out/ci0.js src c:\projects\_output
23+
24+
test: off
25+
on_success:
5826
- git clone -q --branch=%target_branch% %content_repo% %TEMP%\Azure
5927
- cd %TEMP%\Azure
60-
- ps: ls $global:output -dir | % { copy $_.FullName (ls -dir | select -First 1) -Recurse -Force }
28+
- ps: ls c:\projects\_output -dir | % { copy $_.FullName (ls -dir | select -First 1) -Recurse -Force }
6129
- git add -A
6230
- git diff --quiet --exit-code --cached || git commit -m "Sync docs from source code repo to content repo." && git push origin %target_branch% && appveyor AddMessage "Content Updated"

0 commit comments

Comments
 (0)