-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathappveyor.yml
134 lines (133 loc) · 5.01 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
version: 1.0.{build}
skip_tags: true
image: WMF 5
environment:
nodejs_version: 5.11.0
git_email:
secure: ZLfpxUrw1AeB4Hzmg9poFh3ehcghbjDXbGa1zdUAmb0=
git_name:
secure: bOGR0uSE/yW6nUd9i7fcJg==
gh_access_token:
secure: Es5XTlIJiCiCFJHGDOA09AGFVZQL0jIWtUuPp4+m7MBcfeoVGbWQP2jYU3oSL5bw
install:
- ps: |
Install-Product node $env:nodejs_version x64;
(Get-Content -Path "${env:APPVEYOR_BUILD_FOLDER}\package.json") | foreach { $_ -replace "`"version`": `"0.0.0`"", "`"version`": `"$ENV:APPVEYOR_BUILD_VERSION`"" } | Set-Content -Path "${env:APPVEYOR_BUILD_FOLDER}\package.json";
- ps: (Get-Content -Path "${env:APPVEYOR_BUILD_FOLDER}\package.json")
- cmd: npm install -g grunt-cli
- cmd: npm install -g grunt
- cmd: npm update -g npm
- cmd: npm install
- ps: |
$mvnVersion = '3.2.5'
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\maven\")) {
(new-object System.Net.WebClient).DownloadFile(
"http://www.us.apache.org/dist/maven/maven-3/${mvnVersion}/binaries/apache-maven-${mvnVersion}-bin.zip",
'c:\maven-bin.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
}
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET MAVEN_OPTS=-Xmx4g
- cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g
build_script:
- ps: |
$dist = "$env:APPVEYOR_BUILD_FOLDER\dist\";
if ( !(Test-Path -Path $dist) ) {
New-Item -Path $dist -ItemType Directory -Force;
}
- cmd: grunt
- ps: |
$webapp = "$env:APPVEYOR_BUILD_FOLDER\plugin\src\main\webapp";
if ( (Test-Path -Path $webapp) ) {
Remove-Item -Path $webapp | Out-Null;
}
New-Item -Path $webapp -ItemType Directory -Force | Out-Null;
Copy-Item -Path $dist\*.min.css -Destination $webapp -Force
Compress-Archive -Path "$dist\*.css" -DestinationPath "$dist\${env:APPVEYOR_PROJECT_NAME}-${env:APPVEYOR_BUILD_VERSION}.zip"
$plugin = "${env:APPVEYOR_BUILD_FOLDER}\plugin\";
$target = Join-Path -Path $plugin -ChildPath target;
if ( (Test-Path -Path $target) ) {
Remove-Item -Path $target | Out-Null;
}
New-Item -Path $target -ItemType Directory -Force | Out-Null;
Set-Location $plugin;
& mvn package -B;
"Sleeping..." | Write-Host;
Start-Sleep -s 15;
"Time to wake up..." | Write-Host;
"Copy hpi to /dist folder" | Write-Host;
Copy-Item -Path "$target\jenkins-dark-theme.hpi" -Destination "${env:APPVEYOR_BUILD_FOLDER}\dist\${env:APPVEYOR_PROJECT_NAME}-${env:APPVEYOR_BUILD_VERSION}.hpi"
artifacts:
- path: dist/jenkins-dark.css
name: css
- path: dist/*.zip
name: zip
- path: dist/*.hpi
name: hpi
cache:
- c:\maven
- c:\Users\appveyor\.m2
deploy:
- provider: GitHub
tag: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_BUILD_VERSION)
release: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_BUILD_VERSION)
auth_token:
secure: Es5XTlIJiCiCFJHGDOA09AGFVZQL0jIWtUuPp4+m7MBcfeoVGbWQP2jYU3oSL5bw
artifact: zip, hpi
draft: false
prerelease: false
force_update: true
on:
branch: master
- provider: GitHub
tag: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_BUILD_VERSION)-prerelease
release: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_BUILD_VERSION)-prerelease
auth_token:
secure: Es5XTlIJiCiCFJHGDOA09AGFVZQL0jIWtUuPp4+m7MBcfeoVGbWQP2jYU3oSL5bw
artifact: zip, hpi
prerelease: true
draft: false
force_update: true
on:
branch: develop
# - provider: GitHub
# tag: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_BUILD_VERSION)-snapshot
# release: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_BUILD_VERSION)-snapshot
# auth_token:
# secure: Es5XTlIJiCiCFJHGDOA09AGFVZQL0jIWtUuPp4+m7MBcfeoVGbWQP2jYU3oSL5bw
# artifact: zip, hpi
# draft: true
# prerelease: true
# force_update: true
# on:
# branch: /(?!develop|master)/
after_deploy:
- ps: |
try {
Set-Location $env:APPVEYOR_BUILD_FOLDER | Out-Null;
& git config --global credential.helper store;
Add-Content "$ENV:USERPROFILE\.git-credentials" "https://$($ENV:gh_access_token):[email protected]`n";
& git config --global user.email "$ENV:git_email"
& git config --global user.name "$ENV:git_user"
$temp = "c:\temp\jenkins-dark-stylish";
$VERSION = "$ENV:APPVEYOR_BUILD_VERSION";
if ( !(Test-Path -Path $temp )) {
New-Item -Path $temp -Force -ItemType Directory | Out-Null;
}
Copy-Item -Path "${env:APPVEYOR_BUILD_FOLDER}\dist\*.css" -Destination $temp -Force;
"Checkout branch gh-pages" | Write-Host;
& git checkout --force gh-pages;
"Copy temp files to path" | Write-Host;
Copy-Item -Path "$temp\*.*" -Destination ${env:APPVEYOR_BUILD_FOLDER} -Force;
"Add files ./*.css" | Write-Host;
& git add ./*.css
& git commit -m "version $VERSION";
if ( $ENV:APPVEYOR_PULL_REQUEST_NUMBER -eq $null -and $ENV:APPVEYOR_REPO_BRANCH -match 'master$' ) {
# only push for non-pull-requests and on master
& git push origin gh-pages;
}
} catch [Exception] {
"$_.Exception.GetType().FullName, $_.Exception.Message" | Write-Warning;
}