Skip to content

Instantly share code, notes, and snippets.

View hferentschik's full-sized avatar

Hardy Ferentschik hferentschik

View GitHub Profile
Installing GolangCI-Lint
golangci/golangci-lint info checking GitHub for tag 'v1.20.0'
golangci/golangci-lint info found version: 1.20.0 for v1.20.0/linux/amd64
golangci/golangci-lint info installed /workspace/go/bin/golangci-lint
Flag --deadline has been deprecated, flag will be removed soon, please, use .golangci.yml config
level=info msg="[lintersdb] Active 9 linters: [deadcode gofmt goimports gosec interfacer misspell structcheck typecheck unconvert]"
level=info msg="[loader] Go packages loading at mode 575 (exports_file|files|imports|name|compiled_files|deps|types_sizes) took 4m4.659229827s"
level=error msg="Running error: context loading failed: failed to load program with go/packages: -: go: finding github.com/Comcast/kuberhealthy v1.0.2\ngo: finding github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae\ngo: finding github.com/go-openapi/loads v0.19.4\ngo: finding github.com/andygrunwald/go-jira v1.5.0\ngo: finding github.com/ghodss/yaml v1.0.0\ngo: finding github.com/gfleury/go-bitbucket-v1 v0
? github.com/jenkins-x/jx/cmd/codegen [no test files]
? github.com/jenkins-x/jx/cmd/codegen/app [no test files]
? github.com/jenkins-x/jx/cmd/codegen/generator [no test files]
ok github.com/jenkins-x/jx/cmd/codegen/util 35.027s coverage: 43.1% of statements
? github.com/jenkins-x/jx/cmd/ip [no test files]
? github.com/jenkins-x/jx/cmd/jx [no test files]
? github.com/jenkins-x/jx/cmd/jx/app [no test files]
? github.com/jenkins-x/jx/pkg/addon [no test files]
? github.com/jenkins-x/jx/pkg/apis/jenkins.io [no test files]
? github.com/jenkins-x/jx/pkg/apis/jenkins.io/v1 [no test files]
#!/usr/bin/env bash
#
# Used to run Proxy locally.
#
# In your shell (from the root of fabric8-jenkins-proxy):
#
# export OPENSHIFT_API_TOKEN=<your OpenShift API token>
# export JC_AUTH_TOKEN=<auth token>
# make build
# eval $(runLocal.sh)
@hferentschik
hferentschik / login.go
Created January 19, 2018 21:00
OpenShift.io login
jar, _ := cookiejar.New(nil)
var token string
client := &http.Client{
Jar: jar,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
//fmt.Println(fmt.Sprintf("%v",req.URL))
m, _ := url.ParseQuery(req.URL.RawQuery)
if val, ok := m["token_json"]; ok {
token = val[0]
}
@hferentschik
hferentschik / login.sh
Last active January 19, 2018 14:27
Auth
#!/bin/bash
USERNAME=$1
PASSWORD=$2
REQUEST=https://auth.prod-preview.openshift.io/api/login?redirect=https%3A%2F%2Fjenkins.prod-preview.openshift.io%2F
RESPONSE=response.html
COOKIES=cookies.txt
TMP_HTML=login.html
api := libmachine.NewClient(constants.MachineName, constants.Minipath))
defer api.Close()
host, _ := api.NewHost("xhyve", []byte("{}"))
fmt.Println(host.Driver)
Scenario: User has the choice of some basic templates
Given Minishift has state "Running"
When executing "oc --as system:admin get imagestream -n openshift"
Then stdout should contain
"""
nodejs
"""
And stdout should contain
"""
ruby
* Planning
* Trello has no value
* No use for dev
* What we need to plan for is in GuitHub/JIRA
* We have no active customer
* All other teams have already moved away
* Our team has bigger problems than getting getting Trello to work
* Not enough “energy” to make Trello work
* We need to get better in planning, tracking and evaluating what we do day to day
* We need to plan milestones
config.vm.synced_folder '.', '/vagrant', disabled: true
if Vagrant::Util::Platform.windows?
target_path = ENV['USERPROFILE'].gsub(/\\/,'/').gsub(/[[:alpha:]]{1}:/){|s|'/' + s.downcase.sub(':', '')}
config.vm.synced_folder ENV['USERPROFILE'], target_path, type: 'sshfs', sshfs_opts_append: '-o umask=000 -o uid=1000 -o gid=1000'
else
config.vm.synced_folder ENV['HOME'], ENV['HOME'], type: 'sshfs', sshfs_opts_append: '-o umask=000 -o uid=1000 -o gid=1000'
end
task :test, [:provider] => [:download_provider] do |t,args|
puts "Now running test against provider '#{args[:provider]}'"
end
class DownloadTask < Rake::Task
def needed?
puts "\n#{self.class}.#{__callee__} - Don't know which file to check, " \
"since I don't know which argument was passed to test task.\n\n"
true
end