Skip to content

Instantly share code, notes, and snippets.

View aidenkeating's full-sized avatar

Aiden Keating aidenkeating

  • Kargo
  • Ireland
View GitHub Profile
# A script for running a backup of Gitea inside an OpenShift Pod and storing it
# locally. Assumes Gitea is running in the 'gitea' namespace.
readonly NAMESPACE='gitea'
readonly POD_NAME=$(oc get pods -n $NAMESPACE --selector='app=gitea' -o jsonpath='{ .items[0].metadata.name }')
readonly OUTPUT_DIR=${1:-/tmp/gitea-backups}
echo "Creating Gitea backup"
oc exec -n $NAMESPACE $POD_NAME -- /home/gitea/gitea dump -c /home/gitea/conf/app.ini
public static AuthStateManager getInstance(final Context context) {
if (instance == null) {
instance = new AuthStateManager(context);
}
return instance;
}
public static AuthStateManager getInstance() {
if (instance == null) {
throw new IllegalStateException("Context has not previously been provided");
TASK [provision-3scale-apb : Get route] ****************************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "template error while templating string: unexpected '.'. String: oc get route/apicast --template=\"https://{{.spec.host}}\" -n {{ namespace }}"}
to retry, use: --limit @/opt/apb/actions/provision.retry
[{"type":"iwobNiiCBYEPqwDYCbct","x":["2017-10-25 11:21:03","2017-10-25 11:21:33"],"y":{"iwobNiiCBYEPqwDYCbct":[1,1]}},{"type":"LOGIN","x":["2017-10-25 11:21:03","2017-10-25 11:21:33"],"y":{"LOGIN":[1,1]}}]
apiVersion: v1
data:
displayName: TW9iaWxlIENJL0NE
name: ZmgtbW9iaWxlLWNpLWNk
statusMessage: Q29tcGxldGU=
statusPercentage: MTAw
type: ZmgtbW9iaWxlLWNpLWNk
uri: aHR0cHM6Ly9qZW5raW5zLWJiYi4xOTIuMTY4LjM3LjEubmlwLmlv
kind: Secret
metadata:
@aidenkeating
aidenkeating / kubernetes_plugin_cm_contents.xml
Created September 29, 2017 15:08
Contents of a ConfigMap that can do Android builds
<org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
<inheritFrom></inheritFrom>
<name>android</name>
<namespace></namespace>
<privileged>false</privileged>
<alwaysPullImage>false</alwaysPullImage>
<instanceCap>3</instanceCap>
<slaveConnectTimeout>100</slaveConnectTimeout>
<idleMinutes>3</idleMinutes>
<label>android</label>
<org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
<inheritFrom></inheritFrom>
<name>android</name>
<instanceCap>2147483647</instanceCap>
<idleMinutes>0</idleMinutes>
<label>android</label>
<serviceAccount>jenkins</serviceAccount>
<nodeSelector></nodeSelector>
<volumes/>
<containers>
╰─$ oc logs apb-3870c59c-33ab-4eef-920b-8f0ee40e0461
+ [[ provision --extra-vars {"ADMIN_NAME":"admin","ADMIN_PASSWORD":"admin","_apb_plan_id":"default","namespace":"project1"} == *\s\2\i\/\a\s\s\e\m\b\l\e* ]]
+ ACTION=provision
+ shift
+ playbooks=/opt/apb/actions
+ CREDS=/var/tmp/bind-creds
+ whoami
+ '[' -w /etc/passwd ']'
++ id -u
+ echo 'apb:x:1000090000:0:apb user:/opt/apb:/sbin/nologin'
readonly DOCKERHUB_USER="${1}"
readonly DOCKERHUB_PASS="${2}"
readonly DOCKERHUB_ORG="${3}"
readonly LAUNCH_APB_ON_BIND="${4}"
curl -s https://raw.githubusercontent.com/openshift/ansible-service-broker/18e8c5d80b84110b98a10684c05785f71db0e0fa/templates/deploy-ansible-service-broker.template.yaml > /tmp/deploy-ansible-service-broker.template.yaml
oc login -u system:admin
oc new-project ansible-service-broker
oc process -f /tmp/deploy-ansible-service-broker.template.yaml \
@aidenkeating
aidenkeating / README.md
Last active August 2, 2017 14:14
Provision OpenShift Template Service Broker

Provision OpenShift Template Service Broker (POTSB)

Small script to provision the Template Service Broker in OpenShift and add any templates you might want there. Template URLs or local paths can be specified as a list of arguments to the script.

Prerequisites

Have an OpenShift cluster >= 3.6 with the Service Catalog enabled.

The most simple way to do this is by running oc cluster up --service-catalog.