update azure pipelines
This commit is contained in:
parent
b14e6ce255
commit
a1dd024714
5 changed files with 50 additions and 55 deletions
|
@ -6,40 +6,34 @@ trigger:
|
|||
pr: none
|
||||
|
||||
pool:
|
||||
vmImage: 'windows-latest'
|
||||
|
||||
variables:
|
||||
pushChanges: 'No'
|
||||
vmImage: "windows-latest"
|
||||
|
||||
steps:
|
||||
- task: PowerShell@2
|
||||
displayName: 'Update archives'
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: './update_archives.azure.ps1'
|
||||
failOnStderr: true
|
||||
workingDirectory: '.'
|
||||
- task: PowerShell@2
|
||||
displayName: 'Commit changes'
|
||||
condition: and(succeeded(), eq(variables.pushChanges, 'Yes'))
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: '$ErrorActionPreference = "Stop";
|
||||
git config --local user.name "BotPatty";
|
||||
git config --local user.email "ci@zint.ch";
|
||||
git add ./files/GCMCodes.zip;
|
||||
git add ./files/DolphinCodes.zip;
|
||||
git commit -m "update archives [skip ci]";'
|
||||
failOnStderr: true
|
||||
workingDirectory: '.'
|
||||
- task: PowerShell@2
|
||||
displayName: 'Push Changes'
|
||||
condition: and(succeeded(), eq(variables.pushChanges, 'Yes'))
|
||||
env:
|
||||
GitHub_PAT: $(GitHub_PAT)
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: '$ErrorActionPreference = "Stop";
|
||||
git push -q $(GitHub_PAT) HEAD:master;'
|
||||
failOnStderr: true
|
||||
workingDirectory: '.'
|
||||
- task: PowerShell@2
|
||||
displayName: "Update archives"
|
||||
inputs:
|
||||
targetType: "filePath"
|
||||
filePath: "./update_archives.azure.ps1"
|
||||
failOnStderr: true
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
- task: NodeTool@0
|
||||
displayName: "Setup node 12.x"
|
||||
inputs:
|
||||
versionSpec: "12.x"
|
||||
- task: PowerShell@2
|
||||
displayName: "Create Build"
|
||||
inputs:
|
||||
targetType: "filePath"
|
||||
filePath: "./build.azure.ps1"
|
||||
failOnStderr: true
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
- task: PowerShell@2
|
||||
displayName: "Push Changes"
|
||||
condition: succeeded()
|
||||
env:
|
||||
GitHub_PAT: $(GitHub_PAT)
|
||||
inputs:
|
||||
targetType: "inline"
|
||||
script: "git push -uqf $(GitHub_PAT) HEAD:gh-pages;"
|
||||
failOnStderr: true
|
||||
workingDirectory: $(Build.SourcesDirectory)/docs/.vuepress/dist
|
||||
|
|
20
build.azure.ps1
Normal file
20
build.azure.ps1
Normal file
|
@ -0,0 +1,20 @@
|
|||
$ErrorActionPreference = "Stop";
|
||||
|
||||
Write-Host -ForegroundColor Blue "Ensuring yarn is installed..";
|
||||
npm i -g yarn;
|
||||
|
||||
Write-Host -ForegroundColor Blue "Installing dependencies..";
|
||||
yarn;
|
||||
|
||||
Write-Host -ForegroundColor Blue "Creating new build..";
|
||||
yarn build;
|
||||
|
||||
Write-Host -ForegroundColor Blue "Initializing git repository";
|
||||
git config --local user.name "BotPatty";
|
||||
git config --local user.email "ci@zint.ch";
|
||||
$Remote = (git remote get-url origin);
|
||||
Set-Location "./docs/.vuepress/dist";
|
||||
git init;
|
||||
git remote add origin $Remote;
|
||||
git add .;
|
||||
git commit -m "auto-deployment";
|
16
dna.js
16
dna.js
|
@ -1,16 +0,0 @@
|
|||
var _paq = window._paq || [];
|
||||
_paq.push(["disableCookies"]),
|
||||
_paq.push(["trackPageView"]),
|
||||
_paq.push(["enableLinkTracking"]),
|
||||
(function() {
|
||||
var e = "//dna.zint.ch/";
|
||||
_paq.push(["setTrackerUrl", e + "pdna"]), _paq.push(["setSiteId", "2"]);
|
||||
var a = document,
|
||||
t = a.createElement("script"),
|
||||
p = a.getElementsByTagName("script")[0];
|
||||
(t.type = "text/javascript"),
|
||||
(t.async = !0),
|
||||
(t.defer = !0),
|
||||
(t.src = e + "jdna"),
|
||||
p.parentNode.insertBefore(t, p);
|
||||
})();
|
|
@ -94,6 +94,3 @@ Write-Host "Cleaning up..";
|
|||
Set-Location ..;
|
||||
Remove-Item "./.build" -Recurse;
|
||||
Write-Host -ForegroundColor Green "Done";
|
||||
|
||||
# Set Azure variable to commit and push changes
|
||||
Write-Host "##vso[task.setvariable variable=pushChanges;]Yes"
|
Loading…
Reference in a new issue