added ci-build and serial execution of tasks
Project: http://git-wip-us.apache.org/repos/asf/ode-console/repo Commit: http://git-wip-us.apache.org/repos/asf/ode-console/commit/36e187ad Tree: http://git-wip-us.apache.org/repos/asf/ode-console/tree/36e187ad Diff: http://git-wip-us.apache.org/repos/asf/ode-console/diff/36e187ad Branch: refs/heads/master Commit: 36e187ad804d44d0d025b9230d858b5577841a9e Parents: 42a97c4 Author: sathwik <[email protected]> Authored: Thu Sep 8 23:14:57 2016 +0530 Committer: sathwik <[email protected]> Committed: Thu Sep 8 23:14:57 2016 +0530 ---------------------------------------------------------------------- ci-build.sh | 38 ++++++++++++++++++++++++++++++++++++++ e2e/main.po.js | 19 +++++++++++++++++++ e2e/main.spec.js | 19 +++++++++++++++++++ gulp/build.js | 12 ++++++++---- gulp/maven.js | 9 +++++---- gulpfile.js | 7 ++++--- maven-config.json | 4 ++-- package.json | 3 ++- 8 files changed, 97 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ode-console/blob/36e187ad/ci-build.sh ---------------------------------------------------------------------- diff --git a/ci-build.sh b/ci-build.sh new file mode 100755 index 0000000..af35db9 --- /dev/null +++ b/ci-build.sh @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#!/bin/sh + +docker pull sathwik/docker-maven-gulp:latest + +export JAVA_OPTS="-Xmx1024M -XX:MaxPermSize=512M" +GULP_ARGS="$@" +CONTAINER_USERNAME="dummy" +CONTAINER_GROUPNAME="dummy" +HOMEDIR="/home/$CONTAINER_USERNAME" +GROUP_ID=$(id -g) +USER_ID=$( id -u) + +CREATE_USER_COMMAND="groupadd -f -g $GROUP_ID $CONTAINER_GROUPNAME && useradd -u $USER_ID -g $CONTAINER_GROUPNAME $CONTAINER_USERNAME && mkdir --parent $HOMEDIR && chown -R $CONTAINER_USERNAME:$CONTAINER_GROUPNAME $HOMEDIR" + +SU_USER="su $CONTAINER_USERNAME -c " + +NPM_COMMAND="$SU_USER 'npm install'" + +GULP_COMMAND="$SU_USER 'gulp $GULP_ARGS'" + +FINAL_COMMAND="$CREATE_USER_COMMAND && $NPM_COMMAND && $GULP_COMMAND" + +docker run --rm -e JAVA_OPTS -v `pwd`:/workspace -v $HOME/.m2:/home/dummy/.m2 -v /tmp:/tmp --entrypoint bash sathwik/maven_gulp:3.9_4.5 -c "$FINAL_COMMAND" http://git-wip-us.apache.org/repos/asf/ode-console/blob/36e187ad/e2e/main.po.js ---------------------------------------------------------------------- diff --git a/e2e/main.po.js b/e2e/main.po.js index 2ae8e2c..11afcbc 100644 --- a/e2e/main.po.js +++ b/e2e/main.po.js @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /** * This file uses the Page Object pattern to define the main page for tests * https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ http://git-wip-us.apache.org/repos/asf/ode-console/blob/36e187ad/e2e/main.spec.js ---------------------------------------------------------------------- diff --git a/e2e/main.spec.js b/e2e/main.spec.js index da89d22..71648a6 100644 --- a/e2e/main.spec.js +++ b/e2e/main.spec.js @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + 'use strict'; describe('The main view', function () { http://git-wip-us.apache.org/repos/asf/ode-console/blob/36e187ad/gulp/build.js ---------------------------------------------------------------------- diff --git a/gulp/build.js b/gulp/build.js index def575c..5c5c957 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -18,7 +18,8 @@ */ 'use strict'; -var gulp = require('gulp'); +var gulp = require('gulp'), + runSequence = require('run-sequence'); var $ = require('gulp-load-plugins')({ pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del'] @@ -154,8 +155,11 @@ gulp.task('misc', function () { .pipe(gulp.dest('dist/')); }); -gulp.task('clean', function (done) { - $.del.sync(['dist/', '.tmp/'], done); +gulp.task('clean', function () { + return $.del.sync(['dist/', '.tmp/']); +}); + +gulp.task('build', function(done){ + runSequence('clean', 'html', 'images', 'fonts', 'misc',done); }); -gulp.task('build', ['html', 'images', 'fonts', 'misc']); http://git-wip-us.apache.org/repos/asf/ode-console/blob/36e187ad/gulp/maven.js ---------------------------------------------------------------------- diff --git a/gulp/maven.js b/gulp/maven.js index 1083f3e..3c32b86 100644 --- a/gulp/maven.js +++ b/gulp/maven.js @@ -21,22 +21,23 @@ var gulp = require('gulp'), maven = require('maven-deploy'), - config = require('../maven-config.json'); + config = require('../maven-config.json'), + runSequence = require('run-sequence'); //install on local maven repo -gulp.task('install', function() { +gulp.task('install', ['build'], function() { maven.config(config); return maven.install(); }); //Snapshot release to Apache, used by CI server -gulp.task('snapshot', function() { +gulp.task('snapshot', ['build'], function() { maven.config(config); return maven.deploy('apache-snapshot-repo',true); }); //Actual release to Apache repo -gulp.task('release', function() { +gulp.task('release', ['build'], function() { maven.config(config); return maven.deploy('apache-release-repo'); }); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode-console/blob/36e187ad/gulpfile.js ---------------------------------------------------------------------- diff --git a/gulpfile.js b/gulpfile.js index 397c8a7..4c825d3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -18,10 +18,11 @@ */ 'use strict'; -var gulp = require('gulp'); +var gulp = require('gulp'), + runSequence = require('run-sequence'); require('require-dir')('./gulp'); -gulp.task('default', ['clean'], function () { - gulp.start('build'); +gulp.task('default', function (callback) { + runSequence('clean', callback); }); http://git-wip-us.apache.org/repos/asf/ode-console/blob/36e187ad/maven-config.json ---------------------------------------------------------------------- diff --git a/maven-config.json b/maven-config.json index 97fd649..79b1565 100644 --- a/maven-config.json +++ b/maven-config.json @@ -8,11 +8,11 @@ "repositories" : [ { "id": "apache-snapshot-repo", - "url": "https://repository.apache.org/content/repositories/snapshots" + "url": "http://192.168.0.101:8080/repository/snapshots/" }, { "id": "apache-release-repo", - "url": "https://repository.apache.org/service/local/staging/deploy/maven2" + "url": "http://192.168.0.101:8080/repository/internal/" } ] } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode-console/blob/36e187ad/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index c75755e..a765068 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,8 @@ "uglify-save-license": "~0.4.1", "jshint": "~2.9.3", "gulp-zip": "~3.2.0", - "maven-deploy": "~1.5.0" + "maven-deploy": "~1.5.0", + "run-sequence": "~1.2.2" }, "engines": { "node": ">=0.10.0"
