Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/bash
set -x -e
oc new-project helloworld-msa
oc project helloworld-msa
oc create -f https://raw.githubusercontent.com/jboss-openshift/application-templates/ose-v1.3.0-1/jboss-image-streams.json
sleep 30
oc new-app --name hello jboss-eap70-openshift:1.3-Beta~https://github.com/redhat-helloworld-msa/hello -l hystrix.enabled=true
@tnozicka
tnozicka / run_jenkins.sh
Last active June 9, 2016 15:09
Jenkins on oc cluster
#!/bin/bash
SOURCE_CMD='curl -sL' && \
SOURCE='https://github.com/projectatomic/adb-utils/raw/master/services/openshift/templates' && \
echo "" | oc login -u system:admin || oc login -u admin -p admin && \
oc delete is jenkins -n openshift && \
for t in adb/image-streams.json adb/jenkins-ephemeral-next-template.json common/jenkins-ephemeral-template.json adb/jenkins-persistent-next-template.json common/jenkins-persistent-template.json common/jenkins-slave-template.json; do \
echo "Importing ${SOURCE}/${t}" && \
${SOURCE_CMD} ${SOURCE}/${t} | oc create -n openshift -f -; \
done && \
oc process openshift//jenkins-slave-builder -v 'IMAGE_NAME=tnozicka/openshift-maven-builder,IMAGE_STREAM_NAME=maven' | oc create -n openshift -f - && \
#!/bin/bash
docker_target=${DOCKER_TAGET:-docker.io/redhatdistortion/}
echo "" | oc login -u system:admin || oc login -u admin -p admin 1>/dev/null && \
oc_registry_url="$(oc get svc docker-registry -n default -o go-template='{{.spec.clusterIP}}'):$(oc get svc docker-registry -n default -o go-template='{{index .spec.ports 0 "port"}}')" && \
oc login -u developer -p developer || oc login -u openshift-dev -p devel 1>/dev/null && \
oc_registry_token=$(oc whoami --token) && \
oc new-project jenkins-slaves 1>/dev/null && \
oc create -f https://github.com/openshift/origin/raw/master/examples/jenkins/master-slave/jenkins-slave-template.json && \
oc process jenkins-slave-builder -v 'IMAGE_NAME=docker.io/tnozicka/openshift-maven-builder,IMAGE_STREAM_NAME=maven,SLAVE_REPO_URL=https://github.com/openshift/origin.git,SLAVE_REPO_CONTEXTDIR=examples/jenkins/master-slave/slave/,SLAVE_REPO_REF=master' | oc create -f - && \
oc process jenkins-slave-builder -v 'IMAGE_NAME=docker.io/tnozicka/openshift-nodejs-builder,IMAGE_STREA
# -*- mode: ruby -*-
# vi: set ft=ruby :
# The Docker registry from where we pull the OpenShift Docker image
DOCKER_REGISTRY="docker.io"
# The name of the OpenShift image available on dockerhub.
IMAGE_NAME="openshift/origin"
# Tag of the OpenShift image available on dockerhub.
#IMAGE_TAG="v1.2.0"
apiVersion: v1
kind: Template
metadata:
annotations:
desrciption: "Template for generating binary builds."
tags: ""
parameters:
- name: "APP_NAME"
displayName: "Application name"
description: "Name of your application"
repo=openshift/origin && curl -H "Authorization: Bearer $(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq --raw-output .token)" "https://registry.hub.docker.com/v2/${repo}/manifests/latest"
# tnozicka/helloworld [sync-WIP]
oc delete bc helloworld-pipeline;
oc process -f https://github.com/tnozicka/jboss-eap-quickstarts/raw/sync-WIP/helloworld/.openshift-pipeline/pipeline-template.yaml -v 'GIT_URL=https://github.com/tnozicka/jboss-eap-quickstarts.git' -v 'GIT_REF=sync-WIP' | oc apply -f -
# tnozicka/helloworld [kontinu8]
oc delete bc helloworld-pipeline;
oc process -f https://github.com/tnozicka/jboss-eap-quickstarts/raw/kontinu8/helloworld/.openshift-ci_cd/pipeline-template.yaml -v 'GIT_URL=https://github.com/tnozicka/jboss-eap-quickstarts.git' -v 'GIT_REF=kontinu8' | oc apply -f -
# tnozicka/helloworld [kontinu8-next]
oc delete bc helloworld-pipeline;
#!/bin/bash
docker rmi -f $(docker images --format='{{.Repository}}\t{{.ID}}' | grep -e "docker\.io/openshift/origin.*" | cut -f2)
# Git repo
# https://github.com/tnozicka/gopipelines
# (optional) pre-pull images
docker pull openshift/origin-sti-builder:v1.4.1
docker pull openshift/origin-deployer:v1.4.1
docker pull openshift/origin-docker-registry:v1.4.1
docker pull openshift/origin-haproxy-router:v1.4.1
docker pull openshift/origin:v1.4.1
docker pull openshift/origin-pod:v1.4.1
@tnozicka
tnozicka / gist:e72480de8a1a3588927fb6184d1bdcb4
Created March 13, 2017 12:56
iptables-localhost-minikube
sysctl -w net.ipv4.conf.all.route_localnet=1
sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination `minikube ip`:80