Skip to content

Instantly share code, notes, and snippets.

View christian-posta's full-sized avatar

Christian Posta christian-posta

View GitHub Profile
apiVersion: v1
kind: Template
metadata:
name: maven-pipeline
parameters:
- name: APP_NAME
description: The name assigned to all of the application objects defined in this template.
displayName: Application Name
required: true
value: openshift-jee-sample
mvn clean install
mkdir -p target/openshift/deployments
mv target/ticket-monster.war target/openshift/deployments/ROOT.war
cd target/openshift
oc new-build --binary=true --strategy=source --image-stream=wildfly:10.0 --name=ticket-monster-full 
oc start-build ticket-monster-full --from-dir=.
@christian-posta
christian-posta / FetchLimitedPreparedStatementStrategy.java
Created December 13, 2016 22:00
How to limit prepared statement in camel-sql
package org.apache.camel.component.sql;
public class FetchLimitedPreparedStatementStrategy extends DefaultSqlPrepareStatementStrategy {
public FetchLimitedPreparedStatementStrategy() {
}
@Override
public void populateStatement(PreparedStatement ps, Iterator<?> iterator, int expectedParams) throws SQLException {
ps.setFetchSize(1000);
super.populateStatement(ps, iterator, expectedParams);
#!/usr/bin/env bash
if [ ! -d .git ]; then
git init
cp ~/dev/.gitignore .
git add .
git commit -m 'initial commit'
else
cp ~/dev/.gitignore .
git add .
#!/usr/bin/env bash
if [ ! -d .git ]; then
git init
cp ~/dev/.gitignore .
git add .
git commit -m 'initial commit'
else
cp ~/dev/.gitignore .
git add .
#!/usr/bin/env bash
if [ ! -d .git ]; then
git init
cp ~/dev/.gitignore .
git add .
git commit -m 'initial commit'
else
cp ~/dev/.gitignore .
git add .
#!/bin/bash
MINIKUBE_VERSION=0.8.0
KUBECTL_VERSION=1.3.4
GOFABRIC8_VERSION=0.4.45
MAVEN_VERTSION=3.3.9
QUICKSTART_VERSION=2.2.164
function getMinikube {
if [[ "$OSTYPE" == "linux-gnu" ]]; then
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v$MINIKUBE_VERSION/minikube-linux-amd64
@christian-posta
christian-posta / demo-config-jbds.sh
Last active August 29, 2016 21:56
ipservice from jbds with jboss forge and fabric8
#!/usr/bin/env bash
if [ ! -d .git ]; then
git init
cp ~/dev/.gitignore .
git add .
git commit -m 'initial commit'
else
cp ~/dev/.gitignore .
git add .
@christian-posta
christian-posta / wipe-clean.sh
Last active March 14, 2017 20:52
Wipe fabric8 projects for CI/CD demos
#!/bin/sh
echo "cleaning default-testing namespace"
oc delete dc $(oc get dc --namespace=default-testing | grep ^[a-z] | awk '{print $1}') --namespace=default-testing
oc delete svc $(oc get svc --namespace=default-testing | grep ^[a-z] | awk '{print $1}') --namespace=default-testing
oc delete rc $(oc get rc --namespace=default-testing | grep ^[a-z] | awk '{print $1}') --namespace=default-testing
oc delete configmap $(oc get configmap --namespace=default-testing | grep ^[a-z] | awk '{print $1}') --namespace=default-testing
echo "cleaning default-staging namespace"
oc delete dc $(oc get dc --namespace=default-staging| grep ^[a-z] | awk '{print $1}') --namespace=default-staging
oc delete svc $(oc get svc --namespace=default-staging | grep ^[a-z] | awk '{print $1}') --namespace=default-staging
---
apiVersion: "v1"
items:
- apiVersion: "v1"
imagePullSecrets: []
kind: "ServiceAccount"
metadata:
annotations: {}
labels: {}
name: "fabric8"