Skip to content

Instantly share code, notes, and snippets.

View tnolet's full-sized avatar

Tim Nolet tnolet

View GitHub Profile
---
name: simpleservice/simpleservice/web
routes:
simpleservice/simpleservice/simpleservice:1.0.0/web:
weight: 100%
simpleservice/simpleservice/simpleservice:1.1.0/web:
condition:
ref: only_firefox
@tnolet
tnolet / jenkins_pipeline4.groovy
Last active September 18, 2017 15:27
jenkins_pipeline4.groovy
#!groovy
node {
def nodeHome = tool name: '8.3.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${nodeHome}/bin:${env.PATH}"
// !! Replace these with your own settings !!
def gitRepo = 'https://github.com/magneticio/simpleservice/'
def dockerHub = 'https://registry.hub.docker.com'
def dockerHubCreds = 'docker-hub-login'
def dockerRepo = 'magneticio'
@tnolet
tnolet / install_vamp_k8s_acs.sh
Last active October 3, 2017 12:42
Install Kubernetes on Azure Container Service
# Setup Azure Container Service with Kubernetes
az group create --name myVampResourceGroup --location westeurope
az acs create --orchestrator-type kubernetes --resource-group myVampResourceGroup --name myVampK8SCluster --generate-ssh-keys
az acs kubernetes install-cli
az acs kubernetes get-credentials --resource-group myVampResourceGroup --name myVampK8SCluster
# Install Vamp
curl -s https://raw.githubusercontent.com/magneticio/vamp.io/master/static/res/v0.9.5/vamp_kube_quickstart.sh | bash
@tnolet
tnolet / canary_release_k8s_vamp2.sh
Created October 3, 2017 15:03
simple canary release on kubernetes with Vamp step 2
vamp merge simpleservice:1.1.0 simpleDep
@tnolet
tnolet / canary_release_k8s_vamp1.sh
Last active October 3, 2017 15:03
simple canary release on kubernetes with Vamp step 1
# Create two blueprint using the Vamp CLI
curl -s https://raw.githubusercontent.com/magneticio/simpleservice/master/blueprints/service_100.yml | vamp create blueprint --stdin
curl -s https://raw.githubusercontent.com/magneticio/simpleservice/master/blueprints/service_110.yml | vamp create blueprint --stdin
@tnolet
tnolet / vamp_vga_app.json
Created October 12, 2017 09:53
Vamp Gateway Agent Marathon JSON
{
"id": "/vamp/vamp-gateway-agent",
"cmd": null,
"cpus": 0.2,
"mem": 256,
"disk": 0,
"instances": 1,
"acceptedResourceRoles": [
"slave_public"
],
@tnolet
tnolet / simpleservice_marathon.json
Created October 18, 2017 09:47
simpleservice_marathon.json
{
"id": "/simple-service-1.0.0",
"container": {
"type": "DOCKER",
"docker": {
"image": "magneticio/simpleservice:1.0.0",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 3000,
@tnolet
tnolet / aci.sh
Last active December 4, 2017 13:35
Azure Container Instances getting started
az group create --name timACI --location eastus
az container create --name simpleservice --image magneticio/simpleservice:1.0.0 --resource-group timACI --ip-address public --port 3000
az container show --name simpleservice --resource-group timACI
Name ResourceGroup ProvisioningState Image IP:ports CPU/Memory OsType Location
------------- --------------- ------------------- ------------------------------ ------------------- --------------- -------- ----------
simpleservice timACI Succeeded magneticio/simpleservice:1.0.0 52.191.116.216:3000 1.0 core/1.5 gb Linux eastus
@tnolet
tnolet / hook_method.js
Created January 15, 2018 21:00 — forked from iamkvein/hook_method.js
Improved way of temporarily replacing a method on an object
var install_hook_to = function(obj) {
if (obj.hook || obj.unhook) {
throw new Error('Object already has properties hook and/or unhook');
}
obj.hook = function(_meth_name, _fn, _is_async) {
var self = this,
meth_ref;
exports.handler = (event, context, callback) => {
for (let i=0; i<30; i++){
console.log(fib(i))
}
const result = {
"isBase64Encoded": false,
"statusCode": 200,
"headers": {},
"body": "done"
}