Skip to content

Commit 715db55

Browse files
authored
Merge pull request #70 from glennsarti/add-travis-appveyor
(GH-12) Add appveyor configuration file
2 parents 4fdca52 + 665f556 commit 715db55

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

appveyor.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
version: 0.0.4-appv.{build}
2+
branches:
3+
only:
4+
- add-travis-appveyor
5+
- language-server-feature
6+
clone_depth: 10
7+
init:
8+
- SET
9+
10+
environment:
11+
matrix:
12+
# Language Server testing
13+
# LTS Agent
14+
- PUPPET_GEM_VERSION: "~> 4.7.0"
15+
RUBY_VER: 21-x64
16+
RAKE_TASK: test
17+
# Latest 4.x branch
18+
- PUPPET_GEM_VERSION: "~> 4.0"
19+
RUBY_VER: 21-x64
20+
RAKE_TASK: test
21+
# Latest Puppet
22+
- PUPPET_GEM_VERSION: "> 4.0.0"
23+
RUBY_VER: 23-x64
24+
RAKE_TASK: test
25+
# Ruby style
26+
- PUPPET_GEM_VERSION: "> 4.0.0"
27+
RUBY_VER: 23-x64
28+
RAKE_TASK: rubocop
29+
30+
# Extension testing
31+
# Package it up to a VSIX
32+
- nodejs_version: "7.4.0"
33+
nodejs_arch: "x64"
34+
GULP_BUILD_TASK: build
35+
36+
matrix:
37+
fast_finish: true
38+
allow_failures:
39+
# Ruby style
40+
- PUPPET_GEM_VERSION: "> 4.0.0"
41+
RUBY_VER: 23-x64
42+
RAKE_TASK: rubocop
43+
44+
install:
45+
- ps: |
46+
Write-Host "Setting build version..."
47+
$ENV:APPVEYOR_BUILD_VERSION | Out-File -FilePath 'server\lib\puppet-languageserver\VERSION' -Encoding ASCII -Confirm:$false -Force
48+
49+
if ($ENV:RUBY_VER -ne $null) {
50+
Set-Location -Path ".\server"
51+
$ENV:Path = 'C:\Ruby' + $ENV:RUBY_VER + '\bin;' + $ENV:Path
52+
53+
Write-Host "Ruby Version..."
54+
& ruby -v
55+
Write-Host "Gem Version..."
56+
& gem -v
57+
Write-Host "Bundle Version..."
58+
& bundle -v
59+
& bundle install
60+
61+
type Gemfile.lock
62+
}
63+
64+
if ($ENV:nodejs_version -ne $null) {
65+
Install-Product node $env:nodejs_version $env:nodejs_arch
66+
Set-Location -Path ".\client"
67+
68+
Write-Host "Node Version..."
69+
& node --version
70+
71+
Write-Host "Updating npm..."
72+
& npm install -g npm@4 --silent
73+
74+
Write-Host "npm Version..."
75+
& npm --version
76+
77+
Write-Host "Installing modules..."
78+
& npm install --silent
79+
80+
Write-Host "Set the package.json version..."
81+
& node node_modules\gulp\bin\gulp.js bump --version $ENV:APPVEYOR_BUILD_VERSION
82+
}
83+
84+
build_script:
85+
- cmd: IF NOT [%GULP_BUILD_TASK%] == [] node node_modules\gulp\bin\gulp.js %GULP_BUILD_TASK%
86+
87+
test_script:
88+
- cmd: IF NOT [%RAKE_TASK%] == [] bundle exec rake %RAKE_TASK%
89+
- cmd: IF NOT [%NPM_TASK%] == [] npm run %NPM_TASK%
90+
- cmd: IF NOT [%GULP_TASK%] == [] node node_modules\gulp\bin\gulp.js %GULP_TASK%
91+
92+
artifacts:
93+
- path: client/*.vsix

client/gulpfile.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ var gulp = require('gulp');
33
var del = require('del');
44
var runSequence = require('run-sequence');
55
var exec = require('child_process').exec;
6+
var bump = require('gulp-bump');
7+
var args = require('yargs').argv;
68

79
// The default task (called when you run `gulp` from cli)
810
gulp.task('default', ['build']);
@@ -33,3 +35,31 @@ gulp.task('build', function (callback) {
3335
runSequence('clean','copy_language_server','build_extension',callback);
3436
})
3537

38+
gulp.task('bump', function () {
39+
/// <summary>
40+
/// It bumps revisions
41+
/// Usage:
42+
/// 1. gulp bump : bumps the package.json and bower.json to the next minor revision.
43+
/// i.e. from 0.1.1 to 0.1.2
44+
/// 2. gulp bump --version 1.1.1 : bumps/sets the package.json and bower.json to the
45+
/// specified revision.
46+
/// 3. gulp bump --type major : bumps 1.0.0
47+
/// gulp bump --type minor : bumps 0.1.0
48+
/// gulp bump --type patch : bumps 0.0.2
49+
/// gulp bump --type prerelease : bumps 0.0.1-2
50+
/// </summary>
51+
52+
var type = args.type;
53+
var version = args.version;
54+
var options = {};
55+
if (version) {
56+
options.version = version;
57+
} else {
58+
options.type = type;
59+
}
60+
61+
return gulp
62+
.src(['package.json'])
63+
.pipe(bump(options))
64+
.pipe(gulp.dest('.'));
65+
});

client/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@
126126
"vsce": "^1.18.0",
127127
"mocha": "^2.3.3",
128128
"gulp": "^3.9.1",
129+
"gulp-bump": "^2.7.0",
130+
"yargs":"^8.0.1",
129131
"del": "^2.2.2",
130132
"run-sequence":"^1.2.2",
131133
"@types/node": "^6.0.40",

0 commit comments

Comments
 (0)