Skip to content

Instantly share code, notes, and snippets.

View J00MZ's full-sized avatar
🍋
Snicket

Joe Tavin J00MZ

🍋
Snicket
View GitHub Profile
@J00MZ
J00MZ / azure.json
Created March 12, 2019 17:15
azure.json crash
{
"resource_group_name": "MY-RG",
"subscription_id": "00000000-0000-0000-0000-000000000000",
"client_id": "00000000-0000-0000-0000-000000000000",
"tenant_id": "00000000-0000-0000-0000-000000000000",
"object_id": "00000000-0000-0000-0000-000000000000"
}
@J00MZ
J00MZ / packer.json
Created March 12, 2019 17:08
packer.json crash
{
"variables": {
"azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}",
"datadog_api_key": "{{env `DATADOG_API_KEY`}}"
},
"builders": [
{
@J00MZ
J00MZ / crash.log
Created March 12, 2019 17:00
packer crash.log
2019/03/12 16:31:41 [INFO] Packer version: 1.3.5
2019/03/12 16:31:41 Packer Target OS/Arch: linux amd64
2019/03/12 16:31:41 Built with Go Version: go1.12
2019/03/12 16:31:41 Detected home directory from env var: /home/ubuntu
2019/03/12 16:31:41 Using internal plugin for cloudstack
2019/03/12 16:31:41 Using internal plugin for hyperv-vmcx
2019/03/12 16:31:41 Using internal plugin for parallels-pvm
2019/03/12 16:31:41 Using internal plugin for profitbricks
2019/03/12 16:31:41 Using internal plugin for amazon-instance
2019/03/12 16:31:41 Using internal plugin for azure-arm
provider "spotinst" {
token = "${var.spotinst_token}"
account = "${var.spotinst_account}"
}
resource "spotinst_elastigroup_azure" "qa_mlb_runtime" {
name = "qa_mlb_runtime"
resource_group_name = "DevQA-RG"
region = "northeurope"
product = "Linux"
@J00MZ
J00MZ / jenkins_run.sh
Created February 3, 2019 18:40
Jenkins as Docker image
# Variables
HOST_PATH="/data/jenkins_master"
CONTAINER_PATH="/var/jenkins_home"
JENKINS_DOCKER_IMAGE="jenkins/jenkins"
HTTP_PORT="-1" # disables http
JNLP_PORT="50000"
SSL_PORT="443"
CONT_HTTPS_PORT="8443"
SSH_SERVER_PORT="43387"
KEY_STORE="/var/jenkins_home/.keystore/cacerts.jks"
@J00MZ
J00MZ / jenkinsfile
Created January 29, 2019 16:32
Jenkinsfile wait example
stage ('Copy jar to cluster') {
steps {
script {
node ('AWS_AGENT') {
the_env = "${env.Environment}".toLowerCase()
attempt = 0
if (the_env == 'prd'){
// set wait before copy for maximum 20 minutes
max_attempts = 20
}
@J00MZ
J00MZ / dynamo_global_variable.md
Last active May 4, 2019 22:05
Use DynamoDB item to manage Global Flag variable

Objective

Use DynamoDB to have a centralized location flag variable that can be accessed from multiple EC2 instances

Steps

  1. Create DynamoDB table, call it GlobalVariable.
  2. Primary key: name = id, type = number
  3. Sort key field: name = flag, type = String
  4. Add item to table using your value with key id # - example below uses 42.