Skip to content

Instantly share code, notes, and snippets.

View tnolet's full-sized avatar

Tim Nolet tnolet

View GitHub Profile
def vampDeploymentName = 'simpleservice'
def vampHost = 'http://10.0.1.134:3232'
stage('Deploy') {
sh "curl -X POST --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/blueprints -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/deployments/${vampDeploymentName} -H 'Content-Type: application/x-yaml'"
}
#!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'
#!groovy
stage('Deploy to Vamp') {
sh "curl -X POST --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/blueprints -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/deployments/simpleservice -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @gateway.yml ${vampHost}/api/v1/gateways/simpleservice/simpleservice/web -H 'Content-Type: application/x-yaml'"
}
---
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_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 / 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 / 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,