Skip to content

Instantly share code, notes, and snippets.

View csrwng's full-sized avatar

Cesar Wong csrwng

  • Red Hat
  • Raleigh, NC
View GitHub Profile
apiVersion: v1
kind: Template
labels:
template: application-template-sample-pipeline
message: A Jenkins server will be automatically instantiated in this project to manage
the Pipeline BuildConfig created by this template. You will be able to log in to
it using your OpenShift user credentials.
metadata:
annotations:
description: This example showcases the new Jenkins Pipeline integration in OpenShift,
apiVersion: v1
kind: Template
metadata:
name: oc-cli
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cli-store
spec:
@csrwng
csrwng / build-client.sh
Last active March 8, 2017 15:01
Build oc client using an OpenShift Cluster
#/bin/bash
# NOTE: Create a separate project for each platform/branch you're building
# For a Mac client (substitute SOURCE_URL and SOURCE_REF to build a specific PR or fork):
oc new-app -f https://raw.githubusercontent.com/csrwng/build-origin/master/origin-builder.yaml \
-p SOURCE_URL=https://github.com/openshift/origin.git \
-p SOURCE_REF=master \
-p PLATFORM=darwin/amd64
#!/bin/bash
oc cluster down
docker rm -f bindmountproxy
@csrwng
csrwng / jenkins-sync-plugin.yaml
Created September 14, 2017 15:54
jenkins sync plugin builder
apiVersion: v1
kind: Template
metadata:
name: jenkins-sync-plugin
parameters:
- name: SOURCE_URL
required: true
value: https://github.com/openshift/jenkins-sync-plugin.git
- name: SOURCE_REF
required: true
#!/bin/bash
oc login -u system:admin
oc adm policy add-cluster-role-to-user cluster-admin developer
oc login -u developer
#!/bin/bash
decode="-d"
if [ "$(uname)" == "Darwin" ]; then
decode="-D"
fi
curl --cacert <(kubectl config view --flatten -o jsonpath='{ .clusters[0].cluster.certificate-authority-data }' | base64 ${decode}) \
--cert <(kubectl config view --flatten -o jsonpath='{ .users[0].user.client-certificate-data }' | base64 ${decode}) \
--key <(kubectl config view --flatten -o jsonpath='{ .users[0].user.client-key-data }' | base64 ${decode}) "$@"
#!/bin/bash
export GCP_SHARED_CREDENTIALS_FILE=/tmp/cluster/gce.json
export CLUSTER_TYPE=gcp
export HOME=/tmp/home
export ARTIFACT_DIR=/tmp/artifacts
export GCP_PROJECT=openshift-dev-installer
export ENABLE_FIPS=false
set -euo pipefail
#!/bin/bash
set -e
CLUSTER_ID="${CLUSTER_ID:-}"
if [[ -z "${CLUSTER_ID}" ]]; then
CLUSTER_ID="$(cat ~/data/install/current/metadata.json | jq -r '.aws.identifier[] | select(keys[]|contains("kubernetes.io")) | keys[0]')"
fi
echo "CLUSTER_ID=${CLUSTER_ID}"
echo "Instances for current cluster"
aws ec2 describe-instances --filters "Name=tag-key,Values=${CLUSTER_ID}" | \
jq -r '.Reservations[].Instances[] | "\(.InstanceId) \(.State.Name) \(.Tags[] | select(.Key == "Name") | .Value)"' | sort -k2
@csrwng
csrwng / Dockerfile.pull190
Last active July 2, 2020 20:29
elasticsearch-plugin-dockerfiles
FROM fedora
RUN dnf -y update && dnf clean all
RUN dnf -y install java java-devel maven git && dnf clean all
RUN mkdir /src && cd /src && \
git clone https://github.com/fabric8io/openshift-elasticsearch-plugin
RUN cd /src/openshift-elasticsearch-plugin && \
git fetch origin pull/190/head:testbranch && \
git checkout testbranch
RUN cd /src/openshift-elasticsearch-plugin && \
mvn clean verify