Skip to content

Commit

Permalink
Merge pull request #31 from gerald1248/add_linux_x64
Browse files Browse the repository at this point in the history
Added Linux x64 cross-compile task
  • Loading branch information
gerald1248 authored Feb 8, 2017
2 parents cf07ef7 + df9a01f commit 74d932a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,7 @@ To cross-compile Windows binaries on Linux or Mac, enter:
$ GOOS=windows GOARCH=amd64 go install
$ gulp build-win32
```
To create Linux binaries, enter:
```
$ gulp build-linux-x64
```
8 changes: 4 additions & 4 deletions bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ gulp.task('build-go-win32', function(callback) {
});
});

gulp.task('build-go-linux-x64', function(callback) {
platform = "linux"
arch = "x64"
exec('GOOS=linux GOARCH=amd64 go build' + raceSwitch, function(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
callback(err);
});
});

gulp.task('package-binary', function() {
return gulp.src(['./openshift-linter', './openshift-linter.exe'], { base: '.' })
.pipe(gulp.dest('package'))
Expand Down Expand Up @@ -170,6 +180,24 @@ gulp.task('build-win32', function(callback) {
callback);
});

gulp.task('build-linux', function(callback) {
runSequence(
//skip clean-build to retain dist
'fmt',
'vet',
'build-js',
'build-css',
'build-html',
'build-bindata',
'build-go-linux-x64',
'package-binary',
'package-snakeoil',
'dist',
'clean-home',
//skip tests as binary won't run
callback);
});

gulp.task('watch', function() {
gulp.watch(['./*.go', './src/**'], [
'build'
Expand Down
2 changes: 1 addition & 1 deletion makelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func makeList(a *[]byte) error {
switch obj.Kind {
case "List":
return nil
case "DeploymentConfig", "BuildConfig", "Pod":
case "BuildConfig", "DeploymentConfig", "Pod", "Route":
slices := [][]byte{[]byte(`{"kind":"List","items":[`), *a, []byte(`]}`)}
b := bytes.Join(slices, []byte{})
*a = b
Expand Down

0 comments on commit 74d932a

Please sign in to comment.