Skip to content

Instantly share code, notes, and snippets.

View shvasude's full-sized avatar

Shobith Vasudevan shvasude

View GitHub Profile
@shvasude
shvasude / mirror.sh
Last active December 10, 2020 15:31
build-and-mirror-catalog-image
$#!/bin/bash -xe
CATALOG_IMAGE=$CATALOG_IMAGE
CATALOG_USER='redhat'
CATALOG_IMAGE_NAME='redhat-operator-index'
CATALOG_IMAGE_TAG='v4.6'
OUTPUT_IMAGE=$MIRROR_REGISTRY
PRODUCT_NAME=${1:-binding}
CATALOG_SOURCE_NAME='sb-operator-test'
@shvasude
shvasude / install-sbo-stage-catalog-for-upshift-registry
Created September 21, 2020 05:48
install-sbo-stage-catalog-for-upshift-registry
#!/bin/bash -xe
CATALOG_IMAGE=${1:-registry-proxy.engineering.redhat.com/rh-osbs/iib-pub-pending:v4.5}
MIRROR_REGISTRY_HOST_NAME='ec2-18-218-9-177.us-east-2.compute.amazonaws.com:5000'
OUTPUT_IMAGE=$MIRROR_REGISTRY_HOST_NAME'/olm/redhat-developer'
docker pull $CATALOG_IMAGE
docker tag $CATALOG_IMAGE $MIRROR_REGISTRY_HOST_NAME
@shvasude
shvasude / mirror-using-podman.sh
Created September 28, 2020 11:56
mirror using podman
#!/bin/bash -xe
ORGANIZATION='community-operators'
OPERATOR_NAME='service-binding-operator'
CATALOG_IMAGE='registry-proxy.engineering.redhat.com/rh-osbs/iib:12906'
MIRROR_REGISTRY='ec2-52-15-216-90.us-east-2.compute.amazonaws.com:5000/'$ORGANIZATION/$OPERATOR_NAME:v1
USER_NAME='dummy'
PASSWORD='dummy'
podman pull $CATALOG_IMAGE
@shvasude
shvasude / mirror-using-skopeo.sh
Created September 28, 2020 12:03
mirror using skopeo
#!/bin/bash -xe
ORGANIZATION='community-operators'
OPERATOR_NAME='db-operator'
# CATALOG_IMAGE='registry-proxy.engineering.redhat.com/rh-osbs/iib:12906'
CATALOG_IMAGE='quay.io/redhat-developer/sample-db-operators-olm:v1'
MIRROR_REGISTRY='ec2-52-15-216-90.us-east-2.compute.amazonaws.com:5000/'$ORGANIZATION/$OPERATOR_NAME:v1
USER_NAME='dummy'
PASSWORD='dummy'
# docker login -u $USER_NAME -p $PASSWORD $MIRROR_REGISTRY
@shvasude
shvasude / jenkins_test.py
Last active December 18, 2020 11:00
Triggers or clean jenkins flexy job for provisioning disconnected cluster
#!/usr/bin/python
# Provision OpenShift disconnected Cluster
# For this script to work, set the following environment variables
# export CLUSTER_TYPE_TEMPLATE='private-templates/functionality-testing/aos-4_6/upi-on-aws/versioned-installer-disconnected'
# export OCP_RELEASE='registry.svc.ci.openshift.org/ocp/release:4.6.6'
# export JENKINS_USER='<<username>>'
# export JENKINS_USER_TOKEN='<<This(API Token) can be generated from jenkins portal configuration>>'
# A sample test execution command for triggering a jenkins job
@shvasude
shvasude / subscription_test.sh
Created December 10, 2020 15:20
subcsribes to the catalog source
#!/bin/bash -xe
NAME='rh-service-binding-operator'
OPSRC_NAME='redhat-operators'
CHANNEL='beta'
CATALOG_SOURCE_NAME=$CATALOG_SOURCE_NAME
CURRENT_CSV="$(oc get packagemanifests -o json | jq --arg NAME1 "$NAME" --arg CATALOG_SOURCE_NAME1 "$CATALOG_SOURCE_NAME" --arg CHANNEL1 "$CHANNEL" -r '.items[] | select(.metadata.name==$NAME1) | select(.status.catalogSource==$CATALOG_SOURCE_NAME1).status.channels[] | select(.name==$CHANNEL1).currentCSV')"
kubectl apply -f - << EOD
[
{"date" : "20190101", "security" : "ABC Corporation", "quantity" : 980, "portfolio" : "Growth"},
{"date" : "20190101", "security" : "Apples and Oranges", "quantity" : 336, "portfolio" : "Balanced"},
{"date" : "20190102", "security" : "Apples and Oranges", "quantity" : 886, "portfolio" : "Growth"},
{"date" : "20190102", "security" : "ABC Corporation", "quantity" : 439, "portfolio" : "Technology"},
{"date" : "20190102", "security" : "Apples and Oranges", "quantity" : 78, "portfolio" : "Balanced"},
{"date" : "20190102", "security" : "ABC Corporation", "quantity" : 364, "portfolio" : "Balanced"},
{"date" : "20190103", "security" : "Apples and Oranges", "quantity" : 948, "portfolio" : "Balanced"},
{"date" : "20190103", "security" : "Apples and Oranges", "quantity" : 979, "portfolio" : "Equity"},
{"date" : "20190103", "security" : "Apples and Oranges", "quantity" : 698, "portfolio" : "Balanced"},
[
{"date" : "20190101", "security" : "ABC Corporation", "price" : 666.63},
{"date" : "20190101", "security" : "Arcesium LLC", "price" : 430.9},
{"date" : "20190101", "security" : "XYZ Private Limited", "price" : 492.57},
{"date" : "20190101", "security" : "Apples and Oranges", "price" : 472.36},
{"date" : "20190102", "security" : "ABC Corporation", "price" : 20.26},
{"date" : "20190102", "security" : "Arcesium LLC", "price" : 203.25},
{"date" : "20190102", "security" : "XYZ Private Limited", "price" : 369.54},
{"date" : "20190102", "security" : "Apples and Oranges", "price" : 153.28},
{"date" : "20190103", "security" : "ABC Corporation", "price" : 833.38},