Commit 8af7dd71 authored by chickahoona's avatar chickahoona

added minify to gulp process

parent fb88c122
......@@ -11,7 +11,7 @@ stages:
unittests:
stage: test
script:
- sh build.sh
- sh build-ubuntu.sh
- karma start ./unittests/karma-phantom.conf.js
docker-image:
......@@ -21,6 +21,10 @@ docker-image:
- docker:dind
script:
- docker info
- apk update && apk add nodejs
- npm install
- npm install gulp -g
- gulp
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" registry.gitlab.com
- docker build -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
......@@ -28,7 +32,7 @@ docker-image:
firefox-extension:
stage: build
script:
- sh build.sh
- sh build-ubuntu.sh
- cd build/firefox/ && jpm xpi && cd ../../ && cp /builds/psono/psono-client/build/firefox/psonopw.xpi "$CI_BUILD_REF_NAME.psono.PW.firefox.xpi"
artifacts:
paths:
......@@ -37,7 +41,7 @@ firefox-extension:
chrome-extension:
stage: build
script:
- sh build.sh
- sh build-ubuntu.sh
artifacts:
paths:
- build/chrome/
......@@ -62,7 +66,7 @@ job-release-docker:
# services:
# - docker:dind
# script:
# - sh build.sh
# - sh build-ubuntu.sh
# - gulp xpiunsigned
# only:
# - master
......
FROM nginx:alpine
MAINTAINER Sascha Pfeiffer <saschapfeiffer@psono.com>
COPY ./src/common/data /usr/share/nginx/html/
COPY ./build/webserver /usr/share/nginx/html/
WORKDIR /root
\ No newline at end of file
'use strict';
var gulp = require('gulp');
var htmlmin = require('gulp-htmlmin');
var cleanCSS = require('gulp-clean-css');
var minify = require('gulp-minify');
var sass = require('gulp-sass');
var remove_code = require('gulp-remove-code');
var template_cache = require('gulp-angular-templatecache');
......@@ -21,8 +24,47 @@ gulp.task('sass', function () {
.pipe(gulp.dest('src/common/data/css'));
});
/**
* Creates the Webserver build folder
*/
gulp.task('build-webserver', function() {
gulp.src(['src/common/data/css/**/*'])
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest('build/webserver/css'));
gulp.src(['src/common/data/fonts/**/*'])
.pipe(gulp.dest('build/webserver/fonts'));
gulp.src(['src/common/data/img/**/*'])
.pipe(gulp.dest('build/webserver/img'));
gulp.src(['src/common/data/js/**/*'])
.pipe(minify({
ext:{
min:'.js'
},
ignoreFiles: ['.min.js'],
noSource: true,
preserveComments: 'some'
}))
.pipe(gulp.dest('build/webserver/js'));
gulp.src('src/common/data/view/**/*.html')
.pipe(template_cache('templates.js', { module:'passwordManagerApp', root: 'view/' }))
.pipe(gulp.dest('build/webserver/view'));
gulp.src([
'src/common/data/*',
'!src/common/data/sass'
])
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(gulp.dest('build/webserver'));
});
/**
* Creates the build Firefox build folder
* Creates the Firefox build folder
*/
gulp.task('build-firefox', function() {
gulp.src([
......@@ -51,7 +93,7 @@ gulp.task('build-firefox', function() {
});
/**
* Creates the build Chrome build folder
* Creates the Chrome build folder
*/
gulp.task('build-chrome', function() {
gulp.src([
......@@ -70,7 +112,7 @@ gulp.task('build-chrome', function() {
.pipe(gulp.dest('build/chrome'));
});
gulp.task('default', ['sass', 'build-chrome', 'build-firefox']);
gulp.task('default', ['sass', 'build-chrome', 'build-firefox', 'build-webserver']);
/**
* Watcher to compile the project again once something changes
......@@ -79,11 +121,12 @@ gulp.task('default', ['sass', 'build-chrome', 'build-firefox']);
* - initiates the task for the creation of the firefox build folder
* - initiates the task for the creation of the chrome build folder
*/
gulp.task('watch', ['sass', 'build-chrome', 'build-firefox'], function() {
gulp.watch(['src/common/data/**/*', '!src/common/data/sass/**/*.scss'], ['build-firefox', 'build-chrome']);
gulp.task('watch', ['sass', 'build-chrome', 'build-firefox', 'build-webserver'], function() {
gulp.watch(['src/common/data/**/*', '!src/common/data/sass/**/*.scss'], ['build-webserver', 'build-firefox', 'build-chrome']);
gulp.watch('src/chrome/**/*', ['build-chrome']);
gulp.watch('src/firefox/**/*', ['build-firefox']);
gulp.watch('src/common/data/sass/**/*.scss', ['sass', 'build-chrome', 'build-firefox']);
gulp.watch('src/webserver/**/*', ['build-webserver']);
gulp.watch('src/common/data/sass/**/*.scss', ['sass', 'build-chrome', 'build-firefox', 'build-webserver']);
});
/**
......
......@@ -78,7 +78,7 @@
<h2>More</h2>
<ul class="navigations">
<!--<li><a href="https://www.psono.pw/help" target="_blank">Help</a></li>-->
<li><a href="https://www.psono.pw" target="_blank">About Us</a></li>
<li><a href="https://www.psono.com" target="_blank">About Us</a></li>
</ul>
<div class="footer version">
PSONO: {{ version }}
......
......@@ -3,7 +3,8 @@
var app = angular.module('passwordManagerApp');
app.controller('HomeDashboardController', ['$scope', 'localStorageService', function ($scope, localStorageService) {
app.controller('HomeDashboardController', ['$scope', 'localStorageService',
function ($scope, localStorageService) {
var model = localStorageService.get('widgetHomeDashboard');
if (!model) {
model = {
......@@ -30,7 +31,8 @@
});
}]);
app.controller('ShareusersDashboardController', ['$scope', 'localStorageService', function ($scope, localStorageService) {
app.controller('ShareusersDashboardController', ['$scope', 'localStorageService',
function ($scope, localStorageService) {
var model = localStorageService.get('widgetShareusersDashboard');
if (!model) {
model = {
......@@ -57,7 +59,8 @@
});
}]);
app.controller('AcceptshareDashboardController', ['$scope', 'localStorageService', function ($scope, localStorageService) {
app.controller('AcceptshareDashboardController', ['$scope', 'localStorageService',
function ($scope, localStorageService) {
var model = localStorageService.get('widgetAcceptshareDashboard');
if (!model) {
......
......@@ -9,7 +9,7 @@
/**
* Config for the acceptshare widget
*/
module.config(function(dashboardProvider){
module.config(['dashboardProvider', function(dashboardProvider){
dashboardProvider
.widget('acceptshare', {
title: 'Accept Share',
......@@ -21,7 +21,7 @@
templateUrl: 'view/accept-share-edit.html'
}
});
});
}]);
/**
* Main Controller for the acceptshare widget
......
......@@ -10,7 +10,7 @@
/**
* Config for the datastore widget
*/
module.config(function(dashboardProvider){
module.config(['dashboardProvider', function(dashboardProvider){
dashboardProvider
.widget('datastore', {
title: 'Datastore',
......@@ -22,7 +22,7 @@
templateUrl: 'view/datastore-edit.html'
}
});
});
}]);
/**
......
......@@ -9,7 +9,7 @@
/**
* Config for the shareusers widget
*/
module.config(function(dashboardProvider){
module.config(['dashboardProvider', function(dashboardProvider){
dashboardProvider
.widget('shareusers', {
title: 'Trusted Users',
......@@ -21,7 +21,7 @@
templateUrl: 'view/shareusers-edit.html'
}
});
});
}]);
/**
* Main Controller for the shareusers widget
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment