Skip to content

Instantly share code, notes, and snippets.

View chmouel's full-sized avatar
🤨
Kuberneting

Chmouel Boudjnah chmouel

🤨
Kuberneting
View GitHub Profile
@chmouel
chmouel / jenkins-build-output-2.sh
Last active August 17, 2018 13:24
start/Get jenkins-build-output by openshift/sync/etc.
#!/bin/bash
set -e
bc=${1}
[[ -z ${bc} ]] && {
echo "need a bc"
echo "$(oc get bc)"
exit 1
}
[[ -n ${T} ]] && targetnamespace="-n $T"
pushd /usr/local/bin >/dev/null && \
curl -s -L $(curl -L -s "https://api.github.com/repos/openshift/origin/releases/latest"|python -c "import sys, json;x=json.load(sys.stdin);print([ r['browser_download_url'] for r in x['assets'] if 'openshift-origin-client-tools' in r['name'] and 'linux-64bit' in r['name']][0])") -o /tmp/oc.tgz && \
tar xz -f/tmp/oc.tgz --wildcards "*/oc" --strip-components=1 && \
popd >/dev/null
#!/bin/bash
PATH=$PATH:/usr/local/bin
set -ex
DOMAIN=openshift3.chmouel.com
VERSION=3.10.0
OC_VERSION=oc-v${VERSION}
INSTALLPATH=/etc/origin
# -*- coding: utf-8 -*-
# Author: Chmouel Boudjnah <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
import subprocess
from elasticsearch import Elasticsearch, Transport
def execute(command):
return subprocess.run(
['/bin/sh', '-c', f"{command}"],
stdout=subprocess.PIPE)
#/bin/bash
set -x
set -e
LISTFILE=/tmp/list-of-repo-to-blank-archive.txt
base=/tmp/security
for i in $(cat ${LISTFILE});do
b=$(basename $i)
if [[ -e ${base}/${b} ]];then
#!/usr/bin/env zsh
# using zsh cause quoting sucks on bash
AUTH_URL=http://auth-fabric8-build.devtools-dev.ext.devshift.net
ENV_URL=http://f8env-fabric8-build.devtools-dev.ext.devshift.net
TOKEN=$(curl -s -L ${AUTH_URL}/api/token/generate -H 'content-type: application/json' | jq -r '.[0].token.access_token')
SPACE_ID=$(uuidgen)
function createENV() {
package main // -*- mode:go;mode:go-playground -*-
// snippet of code @ 2018-11-09 14:01:15
// === Go Playground ===
// Execute the snippet with Ctl-Return
// Remove the snippet completely with its dir and all files M-x `go-playground-rm`
import (
"fmt"
"log"
#!/usr/bin/env zsh
set -e
set -x
# URL
WIT_SERVICE=f8wit-fabric8-build.devtools-dev.ext.devshift.net
AUTH_SERVICE=auth-fabric8-build.devtools-dev.ext.devshift.net
# BUILD_SERVICE="f8build-fabric8-build.devtools-dev.ext.devshift.net"
BUILD_SERVICE="localhost:8080"