Skip to content

Instantly share code, notes, and snippets.

View tqvarnst's full-sized avatar

Thomas Qvarnström tqvarnst

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tqvarnst on github.
  • I am millstream (https://keybase.io/millstream) on keybase.
  • I have a public key ASAjpSUOhnRGldDJX5ogYbHSUNZcIJOycSUOH4FImZCSRAo

To claim this, I am signing this object:

@tqvarnst
tqvarnst / .init.sh
Last active January 15, 2018 05:15
Initi script for AMM workshop
echo "Running init commands" | tee ${HOME}/.init.log
if [ "$(oc whoami)" == "system:admin" ]; then
echo "User is system:admin" | tee -a ${HOME}/.init.log
oc adm policy add-role-to-user system:image-puller system:anonymous
oc adm policy add-cluster-role-to-user cluster-admin admin
oc import-image jenkins:v3.7 --from='registry.access.redhat.com/openshift3/jenkins-2-rhel7:v3.7' --confirm -n openshift
oc export template jenkins-persistent -n openshift -o json | sed 's/jenkins:latest/jenkins:v3.7/g' | oc replace -f - -n openshift
oc export template jenkins-ephemeral -n openshift -o json | sed 's/jenkins:latest/jenkins:v3.7/g' | oc replace -f - -n openshift
@tqvarnst
tqvarnst / openshift_instructions.md
Created December 6, 2017 08:28 — forked from bbrowning/openshift_instructions.md
Running Apache OpenWhisk on OpenShift

Running Apache OpenWhisk on OpenShift

Prerequisites

These instructions assume you are using Minishift 1.0.1 or newer as your OpenShift installation.

You'll also need a wsk binary in your $PATH to interact with OpenWhisk after it's deployed. Download the latest version for your OS

@tqvarnst
tqvarnst / pom.xml
Last active July 13, 2017 11:42
Lab 1 pom.xml suggestions
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
node('maven') {
stage('Build App') {
git url: "https://github.com/modernize-legacy-apps/monolith.git"
sh "mvn clean package -Popenshift"
}
stage('Integration Test') {
sh "mvn verify"
}
stage('Build Image') {
sh "oc start-build cart --from-file=deployments/ROOT.war --follow"
{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "coolstore",
"labels": {
"application": "coolstore"
}
},
"spec": {
@tqvarnst
tqvarnst / setup.sh
Last active March 28, 2017 08:31
RH Summit image setup
#!/bin/sh
##
set -e
machine=L103736
subscription_pool_id=8a85f9815691b057015693f571f11cde # Update this to correctly reflect the pool id of your subscription (subscription-manager list --available --all)
read -s -p 'RHN password?' rhn_password
mysha=$(cat ~/.ssh/id_rsa.pub)
# Customize and start the virtual machine
{
"kind":"ImageStream",
"apiVersion":"v1",
"metadata":{
"name":"redhat-openjdk18-openshift"
},
"spec":{
"dockerImageRepository":"registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift",
"tags":[
{
@tqvarnst
tqvarnst / LocalDateTimeTest.java
Last active March 8, 2016 13:41
Arquillian test for LocalDateTime in Hibernate 5 and JBoss EAP 7
@RunWith(Arquillian.class)
public class LocalDateTimeTest {
@EJB
PersonService personService;
@Deployment
public static Archive<?> createDeployment() {
JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
.addAsResource("META-INF/persistence.xml","META-INF/persistence.xml")
@tqvarnst
tqvarnst / AttributeConverterTest.java
Last active March 8, 2016 13:40
Arquillian test case for AttributeConverter
@RunWith(Arquillian.class)
public class AttributeConverterTest {
@EJB
PersonService personService;
@Deployment
public static Archive<?> createDeployment() {
JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
.addAsResource("META-INF/persistence.xml","META-INF/persistence.xml")