Skip to content

Instantly share code, notes, and snippets.

Avatar

Viktor Benei viktorbenei

  • Bitrise Ltd (CTO & Cofounder)
  • Hungary
View GitHub Profile
@viktorbenei
viktorbenei / kill_ssh_agent.sh
Created Nov 7, 2014
kill ssh agent and load a new one
View kill_ssh_agent.sh
#!/bin/bash
echo "----------------"
echo "Removing existing keys"
ssh-add -K
echo "----------------"
echo "List of keys:"
ssh-add -l
echo "----------------"
ssh-agent -k
@viktorbenei
viktorbenei / main.go
Last active Dec 9, 2021
sha1 hmac hexdigest signature
View main.go
package main
import (
"crypto/hmac"
"crypto/sha1"
"crypto/subtle"
"encoding/hex"
"fmt"
"os"
)
@viktorbenei
viktorbenei / script_content.sh
Last active Oct 13, 2021
List available shared Schemes in an Xcode Project/Workspace file
View script_content.sh
#!/bin/bash
echo "=== List of available, **shared** Schemes ==="
set -x
# if you use a Workspace (.xcworkspace) file
xcodebuild -workspace $BITRISE_PROJECT_PATH -list
# or if you use a Project file (.xcodeproj) instead
xcodebuild -project $BITRISE_PROJECT_PATH -list
set +x
echo "============================================="
View version_bump.sh
#!/bin/bash
set -e
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${THIS_SCRIPT_DIR}/.."
# Check if there's something uncommitted (don't release if there are files
# not yet committed)
set +e
@viktorbenei
viktorbenei / Dockerfile
Last active Jul 21, 2020
docker-compose.yml (v3) example
View Dockerfile
FROM ubuntu:16.04
RUN apt-get update -qq
RUN apt-get install -y postgresql-client
View install-lokalise.sh
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# create a temp dir for the "install"
mkdir /tmp/lokalise
# change the "working directory" into that directory
cd /tmp/lokalise
@viktorbenei
viktorbenei / install-bitrise-cli.sh
Last active Jul 13, 2019
install-bitrise-cli.sh
View install-bitrise-cli.sh
#!/usr/bin/env bash
set -e
function main {
bitrise_cli_ver="$1"
if [ -z "${bitrise_cli_ver}" ] ; then
echo " [!] No version specified, required! Run this script as: $ bash install-bitrise-cli.sh x.x.x"
exit 1
fi
echo "Installing Bitrise CLI v${bitrise_cli_ver} ..."
@viktorbenei
viktorbenei / create-gke-k8s-knative-cluster.sh
Created May 12, 2019
Create a GKE Kubernetes cluster (with Istio addon enabled) and install Knative on top of it
View create-gke-k8s-knative-cluster.sh
#!/usr/bin/env bash
set -ex
if [ -z "$GCP_PROJECT_ID" ] ; then
echo '[!] GCP_PROJECT_ID is not set - required'
exit 1
fi
gcloud config set project "$GCP_PROJECT_ID"
function create_gke_cluster_with_istio {
View heroku_db_maintenance.sh
#!/usr/bin/env bash
set -ex
if [ -z "$HEROKU_APP_ID" ] ; then
echo '!!! HEROKU_APP_ID not set'
exit 1
fi
if [ -z "$HEROKU_DB_ADDON_ID" ] ; then
echo "!!! HEROKU_DB_ADDON_ID not set. You can get the Heroku DB addon ID from: $ heroku pg:info -a $HEROKU_APP_ID | grep -i 'add-on'"
exit 1
@viktorbenei
viktorbenei / README.md
Last active Nov 2, 2018
bitrise flank config
View README.md

Bitrise Flank config

See the bitrise.yml for an example setup, using https://github.com/TestArmada/flank on https://www.bitrise.io/

The config requires the following variables to be set as Secrets:

  • SERVICE_ACCOUNT_KEY_JSON : the Google (Firebase) Service Account JSON
  • GOOGLE_CLOUD_PROJECT : the Firebase google project name/id

Note: if you'd get an error like Test run failed to complete. Expected 786 tests, received 660 that can mean that the test app is not orchestrator compatible. If that's the case simply change the use-orchestrator: true to use-orchestrator: false in the Flank config (flank.yml) and it'll work.