This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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'" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vamp merge simpleservice:1.1.0 simpleDep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "/vamp/vamp-gateway-agent", | |
"cmd": null, | |
"cpus": 0.2, | |
"mem": 256, | |
"disk": 0, | |
"instances": 1, | |
"acceptedResourceRoles": [ | |
"slave_public" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "/simple-service-1.0.0", | |
"container": { | |
"type": "DOCKER", | |
"docker": { | |
"image": "magneticio/simpleservice:1.0.0", | |
"network": "BRIDGE", | |
"portMappings": [ | |
{ | |
"containerPort": 3000, |