Skip to content

Instantly share code, notes, and snippets.

View psturc's full-sized avatar
🎸

Pavel Sturc psturc

🎸
  • Red Hat
  • Brno, Czech Republic
  • 01:49 (UTC +02:00)
View GitHub Profile
@psturc
psturc / build.sh
Last active July 2, 2016 10:38
fh-npm & s2i building script for Travis CI
#!/bin/bash
# Find out Node version => choose appropriate docker build-image
nodev=`node -v`
if [[ $nodev == "v4"* ]]
then
buildimage="registry.access.redhat.com/rhscl/nodejs-4-rhel7"
else
buildimage="registry.access.redhat.com/openshift3/nodejs-010-rhel7"
fi
@psturc
psturc / clean_pvs.sh
Last active May 4, 2018 11:50
Recreate PVs on NFS server
#!/bin/bash
# Login as admin user
oc login -u admin -p <password> > /dev/null
# List all Released pv names
for pv in `oc get pv | grep Released | awk '{print $1}'` ;
do
# Delete content of PV folders on NFS server
ssh 172.16.72.57 "echo ${pv} ; sudo rm -rf /exports/${pv}/*"
# Delete PV object
@psturc
psturc / gist:355aba33949e54487d604732e93685b2
Created February 28, 2018 09:06
metrics api - make_build error
psturc@Pavels-MacBook-Pro ~/gocode/src/github.com/aerogear/aerogear-metrics-api [9:56:06]
> $make build_linux ⬡ 6.11.3 [±db-fix ✓]
dep ensure
env GOOS=linux GOARCH=amd64 go build -o ./dist/linux_amd64/aerogear-app-metrics ./cmd/metrics-api/metrics-api.go
# command-line-arguments
cmd/metrics-api/metrics-api.go:19:26: not enough arguments in call to dbHandler.Connect
cmd/metrics-api/metrics-api.go:19:33: config.DBConnectionString undefined (type map[string]string has no field or method DBConnectionString)
cmd/metrics-api/metrics-api.go:19:60: config.DBMaxConnections undefined (type map[string]string has no field or method DBMaxConnections)
cmd/metrics-api/metrics-api.go:45:68: config.ListenAddress undefined (type map[string]string has no field or method ListenAddress)
cmd/metrics-api/metrics-api.go:
@psturc
psturc / aerogear-app-metrics.yml
Created March 5, 2018 08:40
OpenShift template for deployment of app-metrics connected to postgresql
---
# PV configuration commented out (see below)
apiVersion: v1
kind: Template
metadata:
name: test
objects:
- apiVersion: v1
kind: Service
psturc@Pavels-MacBook-Pro ~/gocode/src/github.com/aerogear/aerogear-app-metrics [13:21:49]
> $ docker ps -a | grep sql ⬡ 6.11.3 [±fix-responses ✓]
psturc@Pavels-MacBook-Pro ~/gocode/src/github.com/aerogear/aerogear-app-metrics [13:22:02]
> $ make test-integration ⬡ 6.11.3 [±fix-responses ✓]
Running tests:
go test -v -race -cover -tags=integration \
github.c
error: bundling failed: Error: While trying to resolve module `@aerogearservices/core` from file `/Users/psturc/work/aerogear/aerogear-js-sdk/example/react-native/src/components/StartScreen.js`, the package `/Users/psturc/work/aerogear/aerogear-js-sdk/example/react-native/node_modules/@aerogearservices/core/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/psturc/work/aerogear/aerogear-js-sdk/example/react-native/node_modules/@aerogearservices/core/dist/index.js`. Indeed, none of these files exist:
* `/Users/psturc/work/aerogear/aerogear-js-sdk/example/react-native/node_modules/@aerogearservices/core/dist/index.js(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
* `/Users/psturc/work/aerogear/aerogear-js-sdk/example/react-native/node_modules/@aerogearservices/core/dist/index.js/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
at PackageResolutionError (/Users/psturc/w
@psturc
psturc / mobile-services.json
Last active April 6, 2018 12:21
curl to metrics app
curl -X POST \
https://aerogear-app-metrics-test-android-sdk-8-1523001311096.ci.feedhenry.org/metrics \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: 76a14738-976f-f0ea-4039-12efeebf4f1e' \
-d '{
"clientId": "123456",
"data": {
"app": {
"id": "com.example.someApp",
@psturc
psturc / MetricsIntegrationTest.swift
Last active April 10, 2018 08:10
metrics integration testing
/*
To run those tests from commandline:
xcodebuild \
-workspace example/AeroGearSdkExample.xcworkspace \
-scheme AeroGearSdkExampleTests -sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 7' \
'-only-testing:AeroGearSdkExampleTests/MetricsIntegrationTests/_testPublishingDefaultMetricsShouldNotReturnError' \
'-only-testing:AeroGearSdkExampleTests/MetricsIntegrationTests/_testPublishingInvalidMetricsShouldReturnError' \
Using config file mounted to /etc/ansible-service-broker/config.yaml
============================================================
== Starting Ansible Service Broker... ==
============================================================
[2018-04-10T13:27:54.757Z] [NOTICE] - Initializing clients...
[2018-04-10T13:27:54.757Z] [DEBUG] - Trying to connect to etcd
[2018-04-10T13:27:54.757Z] [DEBUG] - Unable to get dao.etcd_ca_file from config
[2018-04-10T13:27:54.757Z] [DEBUG] - Unable to get dao.etcd_client_key from config
[2018-04-10T13:27:54.757Z] [DEBUG] - Unable to get dao.etcd_client_cert from config
[2018-04-10T13:27:54.757Z] [INFO] - == ETCD CX ==
@psturc
psturc / install_asb.sh
Last active May 23, 2018 09:35
Install ASB on OpenShift
#!/bin/bash
# This script will delete remains of previous instance of Ansible Service Broker
# and installs a new one into project ansible-service-broker
#
# INSTRUCTIONS
# Login as admin via oc
# Delete projects containing previous instance of ASB if any
# Replace variables' values containing <REPLACE_ME>, also consider changing the version of ASB template (change value of TEMPLATE_VERSION variable)
# or ASB image (BROKER_IMAGE variable)
# Run this with 'bash install_asb.sh'