Skip to content

Instantly share code, notes, and snippets.

View Brantone's full-sized avatar

Brantone Brantone

  • Canada
View GitHub Profile
#!/usr/bin/env bash
source tc-props.bash
echo "Running on $agent_name"
echo "Deploying $org_app_version to $org_deploy_server..."
# ...
@Brantone
Brantone / upload.sh
Created December 11, 2020 09:19 — forked from ouchadam/upload.sh
Upload APK to appcenter app=my-cool-app owner=owner-in-appcenter file=path/to/file token=1234-api-token destination_name=group-to-apply
#!/bin/bash
set -e
CONFIG=$@
for line in $CONFIG; do
eval "$line"
done
AUTH="X-API-Token: $token"
CONTENT_TYPE=application/vnd.android.package-archive
@Brantone
Brantone / kcpasswordEncode.sh
Created May 24, 2022 19:46 — forked from brunerd/kcpasswordEncode.sh
Encode a string for use in macOS /etc/kcpassword using shell, printf, sed, awk and xxd
#!/bin/bash
#kcpasswordEncode (20210911) Copyright (c) 2021 Joel Bruner (https://github.com/brunerd)
#Licensed under the MIT License
#given a string creates data for /etc/kcpassword
function kcpasswordEncode {
#ascii string
local thisString="${1}"
local i
@Brantone
Brantone / git.migrate
Created May 21, 2019 17:42 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@Brantone
Brantone / gist:cc357a36d6199112a3fa9d80f8588802
Created June 28, 2018 08:20 — forked from evilchili/gist:1848087
invoke a downstream jenkins job with the current job parameters + additions
import hudson.model.*
// extract the version tag from the console log
def version_pattern = ".*\\[\\s*INFO\\s*\\]\\s+VERSION=(.*)\\s*\$"
def matcher = manager.getLogMatcher( version_pattern )
if ( matcher?.matches() ) {
// add the version string to the job summary
def ver = matcher.group(1)
manager.addInfoBadge( "Version: $ver" )
import hudson.FilePath
import jenkins.model.Jenkins
import com.cloudbees.hudson.plugins.folder.*
Jenkins jkns = Jenkins.instance
def build_vars = build.buildVariables
def base_folder_name = build_vars['baseFolderName']
def build_proj_file = 'ServerBuild.proj'
def tier = (build_vars['assembliesTier'].toInteger() - 1)
@Brantone
Brantone / Gemfile
Created May 16, 2018 21:49 — forked from jdennes/Gemfile
Export a list of members from a GitHub organisation
source "https://rubygems.org"
gem "octokit"
@Brantone
Brantone / visualstudio.rb
Last active May 7, 2018 04:47
Chef VisualStudio install loop
node['agent']['visualstudio']['versions'].each do |vs|
directory "#{Chef::Config[:file_cache_path]}\\visualstudio\\#{vs.version}\\" do
action :create
recursive true
end
remote_file "#{Chef::Config[:file_cache_path]}\\visualstudio\\#{vs.version}\\#{vs.installer}" do
action :create
source "#{node['agent']['software_repo_root']}/microsoft/vs#{vs.version}/#{vs.installer}"
checksum vs.checksum
@Brantone
Brantone / cheftips.txt
Last active March 6, 2017 22:55
Chef Random tips
Commands
--------
Run on nodes
# knife ssh "name:macOS2*" "sudo DEVELOPER_DIR=/Library/Developer/CommandLineTools/ chef-client" -x [user] -P
Data Bags
---------
If not already have secret key:
@Brantone
Brantone / databag_encrypt_file.krb
Created March 4, 2017 00:06
Chef Knife script for encrypting a file into a data bag
#!/usr/bin/knife exec
# Knife exec script to put the contents of a file into a data bag, then encrypt it.
# Care of : https://www.coveros.com/chef-knife-script-for-encrypting-a-file-a-data-bag/
########### USAGE ############
this_file = File.basename(__FILE__)
usage = <<-EOS
#{this_file}: Encrypts and stores the contents of a file into a data bag item. This
is typically used to encrypt and store the contents of a PEM file.