Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
🇮🇪 🇺🇸

Evan Shortiss evanshortiss

:octocat:
🇮🇪 🇺🇸
View GitHub Profile
View bc.webapp-nginx-runtime.yaml
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
labels:
build: webapp-nginx-runtime
name: webapp-nginx-runtime
namespace: node-s2i-nginx
spec:
failedBuildsHistoryLimit: 5
successfulBuildsHistoryLimit: 5
View bc.webapp-npm-build.yaml
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
labels:
build: webapp-npm-build
name: webapp-npm-build
namespace: node-s2i-nginx
spec:
failedBuildsHistoryLimit: 5
successfulBuildsHistoryLimit: 5
View install-integreatly-pds.sh
# Note you must have golang installled and configured to do this!
# Login as a cluster admin
oc login $CLUSTER_URL
# install moq
# (make sure $GOPATH/bin/ is on your $PATH so moq can be found)
go get github.com/matryer/moq
# setup the operator repo
View order-api.json
{
"openapi": "3.0.2",
"info": {
"title": "orders-internal",
"description": "This is an internal API that exposes order entries contained in the system.",
"version": "1.0.0"
},
"paths": {
"/orders": {
"description": "Used to interact with orders stored in the backing data store.",
View orders-api.yaml
---
openapi: 3.0.2
info:
title: orders-internal
version: 1.0.0
description: This is an internal API that exposes order entries contained in the
system.
paths:
/orders:
description: Used to interact with orders stored in the backing data store.
@evanshortiss
evanshortiss / mqtt.service.yml
Last active Jul 16, 2019
#2- create MQTT service for AeroGear Showcase deployed using the aerogear/mobile-services-installer setup script
View mqtt.service.yml
apiVersion: v1
kind: Service
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewApp
creationTimestamp: null
labels:
app: sync-app-showcase-server
name: mosquitto-mqtt-broker
spec:
@evanshortiss
evanshortiss / mqtt.dc.yml
Created Jul 11, 2019
#1 - create MQTT deployment for AeroGear Showcase deployed using the aerogear/mobile-services-installer setup script
View mqtt.dc.yml
kind: DeploymentConfig
apiVersion: v1
name: mosquitto-mqtt-broker
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewApp
creationTimestamp: null
labels:
app: sync-app-showcase-server
name: mosquitto-mqtt-broker
@evanshortiss
evanshortiss / without-env-var.example.js
Last active Jan 28, 2021
Example code running without env-var. This is how you might implement env.get(MAX_BATCH_SIZE).required().asIntPositive()
View without-env-var.example.js
/**
* All the assertion code below the line could be replaced with
* this single line by using env-var
*/
env.get(MAX_BATCH_SIZE).required().asIntPositive()
// -----------------------------------------------
const assert = require('assert');
@evanshortiss
evanshortiss / with-env-var.example.js
Created Jun 11, 2019
Example of Code Using env-var
View with-env-var.example.js
const env = require('env-var');
const MAX_BATCH_SIZE = env.get('MAX_BATCH_SIZE').required().asIntPositive();
@evanshortiss
evanshortiss / openshift-quarkus-deploy.sh
Last active May 29, 2019
Deploy a Quarkus Application on OpenShift
View openshift-quarkus-deploy.sh
oc new-project quarkus-project --display-name="Quarkus Project"
oc new-build quay.io/redhat/ubi-quarkus-native-runner --binary --name=quarkus-quickstart -l app=quarkus-quickstart
# Replace filename with whatever your file is called, e.g quarkus-quickstart-1.0-SNAPSHOT-runner
# This command might report a file copy error - my build still worked despite this 👍
oc start-build quarkus-quickstart --from-file=target/$FILENAME-runner --follow
oc new-app quarkus-quickstart
oc expose service quarkus-quickstart