Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch 'master' into rest-foo-bak
Browse files Browse the repository at this point in the history
 Conflicts:
	console/src/main/scripts/bower.json
	console/src/main/scripts/package.json
	dist/pom.xml
	dist/src/main/resources/wildfly/patches/standalone.xsl
	pom.xml
  • Loading branch information
jkremser committed Dec 10, 2015
2 parents b4b23fc + 5e713f0 commit 72c4214
Show file tree
Hide file tree
Showing 105 changed files with 1,470 additions and 23,876 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ before_cache:
- df -h
- du -sh $HOME/.m2/repository
after_success:
- PROJECT_VERSION=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['`
- echo ${PROJECT_VERSION} == ${TRAVIS_BRANCH} == ${TRAVIS_PULL_REQUEST}
- PROJECT_VERSION=`mvn --batch-mode org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['`
- if [[ "${PROJECT_VERSION}" =~ .*SNAPSHOT ]] && [[ "${TRAVIS_BRANCH}" = "master" ]] && [[ "${TRAVIS_PULL_REQUEST}" = "false" ]];
then
curl -X GET http://${DEPLOYMENT_JENKINS}/job/Build-Hawkular-Image/build?token=${DEPLOYMENT_JENKINS_TOKEN} ;
Expand Down
6 changes: 3 additions & 3 deletions console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
<version>2.0.12.Final</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.1_spec</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright 2015 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed 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.
*/
package org.hawkular.console.configuration;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* @author Juraci Paixão Kröhling
*/
@WebServlet("/keycloak.json")
public class KeycloakConfigurationServlet extends HttpServlet {
private static final Pattern PROPERTY_REPLACEMENT_PATTERN = Pattern.compile("\\$\\{([^}]*)\\}");

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("application/json");
PrintWriter writer = resp.getWriter();
writer.println(getKeycloakJson());
writer.close();
}

private String getKeycloakJson() throws IOException {
String rawKeycloakJson = getRawKeycloakJson();
Matcher matcher = PROPERTY_REPLACEMENT_PATTERN.matcher(rawKeycloakJson);
while(matcher.find()) {
String propertyNotation = matcher.group();
String propertyName = matcher.group(1);
String value = System.getProperty(propertyName);
if (null == value || value.isEmpty()) {
value = propertyNotation;
}
rawKeycloakJson = rawKeycloakJson.replaceFirst(
Pattern.quote(propertyNotation),
Matcher.quoteReplacement(value)
);
}

return rawKeycloakJson;
}

private String getRawKeycloakJson() throws IOException {
InputStream keycloakJson = getClass().getResourceAsStream("/keycloak.json");
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(keycloakJson))) {
return buffer.lines().collect(Collectors.joining("\n"));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"realm": "hawkular",
"auth-server-url": "http://localhost:8080/auth",
"auth-server-url": "${keycloak.server.url}",
"ssl-required": "none",
"resource": "hawkular-ui",
"public-client": true
Expand Down
8 changes: 3 additions & 5 deletions console/src/main/scripts/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"animate.css": "3.0.0",
"ngInfiniteScroll": "1.2.1",
"bootstrap-select": "1.6",
"hawkular-charts": "hawkular/hawkular-charts#master",
"hawkular-ui-services": "hawkular/hawkular-ui-services#master",
"hawkular-charts": "hawkular/hawkular-charts#0b73da1",
"hawkular-ui-services": "hawkular/hawkular-ui-services#8ffdbe6",
"hawtio-core-navigation": "2.0.51",
"hawtio-core": "2.0.18",
"hawtio-template-cache": "2.0.4",
Expand All @@ -35,8 +35,6 @@
"moment": "2.10.3",
"patternfly": "2.5.0",
"keycloak": "1.3.1",
"angular-truncate": "sparkalow/angular-truncate#master",
"angular-smart-truncate": "1.0.2",
"angular-wizard": "0.5.5",
"ng-clip": "0.2.6",
"zeroclipboard": "2.2.0"
Expand All @@ -46,7 +44,7 @@
},
"resolutions": {
"lodash": "~3.2.0",
"angular": "~1.4.4",
"angular": "~1.4.8",
"keycloak": "1.3.1"
}
}
25 changes: 19 additions & 6 deletions console/src/main/scripts/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ var gulp = require('gulp'),
argv = require('yargs').argv,
jsString;

var inProgress = false;

// CONSTANTS

var POM_MAIN_PATH = '../../../pom.xml';
Expand Down Expand Up @@ -260,17 +262,27 @@ gulp.task('watch-server', ['build-live', 'copy-kettle-js', 'copy-kettle-css'], f
});
});

gulp.task('copy-sources', function(done) {
gulp.task('clean-sources', function(done) {
if (!inProgress) {
inProgress = true;
del(['./plugins/**/*.ts', './plugins/**/*.less', './plugins/**/*.html'], done);
}
else {
done();
}
});

gulp.task('copy-sources', ['clean-sources'], function(done) {
var src = [config.srcPrefix + 'plugins/**/*'];

del(['./plugins/**/*.ts', './plugins/**/*.less', './plugins/**/*.html'], function () {
gulp.src(src)
.pipe(gulp.dest('./plugins')).on('end', function() {
done();
})});
gulp.src(src)
.pipe(gulp.dest('./plugins')).on('end', function() {
done();
});
});

gulp.task('copy-kettle-js', ['build-live','set-server-path'] , function() {
inProgress = false;
gulp.src(['dist/hawkular-console.js'])
.pipe(gulp.dest(config.serverPath));
});
Expand Down Expand Up @@ -303,6 +315,7 @@ gulp.task('copy-vendor-css', function(done) {
});

gulp.task('copy-kettle-css', ['less-live','set-server-path'] , function() {
inProgress = false;
gulp.src(['dist/hawkular-console.css'])
.pipe(gulp.dest(config.serverPath));
});
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions console/src/main/scripts/plugins/accessPortal/includes.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 72c4214

Please sign in to comment.