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
@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
#!/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
- apiVersion: hive.openshift.io/v1
kind: ClusterDeployment
metadata:
creationTimestamp: null
labels:
hive.openshift.io/hiveutil-created: "true"
name: test
spec:
baseDomain: new-installer.openshift.com
certificateBundles:
#!/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
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
oc login -u system:admin
oc adm policy add-cluster-role-to-user cluster-admin developer
oc login -u developer
@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
@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
@csrwng
csrwng / inline-jenkinsfile.yaml
Last active May 22, 2021 19:41
Inline Jenkinsfile
apiVersion: v1
kind: Template
labels:
template: inline-jenkinsfile
metadata:
name: inline-jenkinsfile
parameters:
- name: NAME
description: The name of the build to create
displayName: Build Name
apiVersion: v1
kind: Template
metadata:
name: oc-cli
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cli-store
spec: