@@ -2,61 +2,29 @@ branches:
2
2
only :
3
3
- master
4
4
environment :
5
+ nodejs_version : " 6"
5
6
github_access_token :
6
7
secure : VMFbecLLHzDq/09YDPbcM0VDDSwwgY57vr5GXK6cZZ4Ti/Xs5RZoylzV8MMr1350
7
8
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
54
11
- git config --global credential.helper store
55
12
-
ps :
ac "$env:USERPROFILE\.git-credentials" "https://$($env:github_access_token):[email protected] `n"
56
13
- git config --global user.email %email%
57
14
- 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 :
58
26
- git clone -q --branch=%target_branch% %content_repo% %TEMP%\Azure
59
27
- 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 }
61
29
- git add -A
62
30
- 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