Skip to content

Instantly share code, notes, and snippets.

View nmasse-itix's full-sized avatar
🙂
At home

Nicolas Massé nmasse-itix

🙂
At home
View GitHub Profile
@nmasse-itix
nmasse-itix / Jenkinsfile
Created May 18, 2017 15:49
Complete Jenkinsfile to do blue/green deployment in OpenShift
#!groovy
// Define Maven Command. Make sure it points to the correct settings for our
// Nexus installation. The file nexus_openshift_settings.xml needs to be in the
// Source Code repository.
def mvn = "mvn -s ./nexus_openshift_settings.xml"
def sonarqube = "http://sonarqube-cicd.app.openshift.test/"
def nexusRepo = "openshift-task"
def nexusUrl = "http://nexus3-cicd.app.openshift.test/repository/${nexusRepo}/"
def credentialsId = "749214e0-4aa1-444b-8b17-599bfa084e3f"
@nmasse-itix
nmasse-itix / disk-stats
Created May 26, 2017 09:18
Script to monitor disk write times
#!/bin/bash
# Send stats to this file
exec 23>> stats.csv
while sleep 30; do
date="$(date -Iseconds)"
real=""
user=""
sys=""
@nmasse-itix
nmasse-itix / create-client.sh
Last active July 4, 2017 08:48
Create a client in Red Hat SSO
#!/bin/sh
# Your Initial Access Token
ACCESS_TOKEN=""
# The RH-SSO Realm
REALM="3scale"
# The Hostname of the Secure Route of RH-SSO
SSO_HOST=""
@nmasse-itix
nmasse-itix / PostmanCollection.json
Last active June 27, 2017 12:41
Postman Collection to test OAuth with 3scale
{
"variables": [],
"info": {
"name": "3scale - OAuth",
"_postman_id": "5cf7becf-4726-97b7-3f19-142c926ec3a3",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@nmasse-itix
nmasse-itix / get-oauth-access-token.sh
Created July 4, 2017 15:49
A script to get an OAuth Access Token from APIcast
#!/bin/bash
APICAST_HOSTNAME=""
CLIENT_ID=""
CLIENT_SECRET=""
SCOPE="test"
REDIRECT_URI="https://www.getpostman.com/oauth2/callback"
echo
@nmasse-itix
nmasse-itix / fetch.sh
Created April 27, 2018 06:03
Fetch Docker images with Skopeo
#!/bin/bash
IMAGES="jboss-eap-7/eap70-openshift openshift3/jenkins-2-rhel7 openshift3/jenkins-slave-maven-rhel7 openshift3/jenkins-slave-nodejs-rhel7 dotnet/dotnet-20-jenkins-slave-rhel7 openshift3/jenkins-slave-base-rhel7 rhscl/mongodb-34-rhel7 rhscl/mysql-57-rhel7 rhscl/mariadb-102-rhel7 rhscl/postgresql-96-rhel7 rhscl/nodejs-6-rhel7 rhscl/s2i-base-rhel7 openshift3/apb-base rhel7-atomic rhel7 rhscl/ruby-24-rhel7 rhscl/perl-524-rhel7 rhscl/python-27-rhel7 rhscl/python-36-rhel7 redhat-sso-7/sso71-openshift"
for i in $IMAGES; do
file="$(echo $i|tr '/' '_').tar"
if [ ! -f "$file" -a ! -f "$file.gz" ]; then
echo "Fetching $i... into $file..."
skopeo copy docker://registry.access.redhat.com/$i:latest docker-archive://$PWD/$file:$i:latest
fi
@nmasse-itix
nmasse-itix / README.md
Last active October 25, 2022 03:27
Dynamic documentation for the 3scale Developer Portal

Dynamic documentation for the 3scale Developer Portal

Goal

Generate a dynamic list of the exposed services on the 3scale Developer Portal.

How to install

Replace your built-in "Documentation" page (/docs) in the 3scale CMS with the attached content.

@nmasse-itix
nmasse-itix / download.yml
Created May 31, 2018 06:23
OpenShift Image Download
---
- name: Fetch OpenShift Images
hosts: localhost
become: yes
gather_facts: no
vars:
openshift_base_image: openshift3/ose
redhat_registry: registry.access.redhat.com
openshift_images:
- openshift3/ose-ansible
@nmasse-itix
nmasse-itix / DEBUG.md
Created July 5, 2018 17:08
How to debug issues in OpenShift

How to debug issues in OpenShift

Context

Lets say that you deployed an application in OpenShift and the application is not working. You would like to debug but the application does not embed any troubleshooting tool (for instance, an Alpine Linux or a scratch image)

Static tools

You could download one of the static tools available there

@nmasse-itix
nmasse-itix / README.md
Last active August 3, 2018 10:31
Troubleshooting certificates in OpenShift

Troubleshooting certificates in OpenShift

Context

When re-deploying certificates using the redeploy-certificates.yml, the OpenShift Service Signer CA is re-generated, thus invalidating all the previously generated certificates.

The first symptom is usually the Web Console not working anymore (502 HTTP Status Code).