Skip to content

Instantly share code, notes, and snippets.

@julio-saito-linx
Forked from nuxlli/generator_arq.js
Last active August 29, 2015 14:08
Show Gist options
  • Save julio-saito-linx/493e4467116f4f1f19a3 to your computer and use it in GitHub Desktop.
Save julio-saito-linx/493e4467116f4f1f19a3 to your computer and use it in GitHub Desktop.
'ruby19-postgres': {
// Dependent systems
depends: [],
// More images: http://images.azk.io
image: "postgres:9.3",
workdir: "/azk/#{manifest.dir}/ruby19",
mounts: {
'/azk/#{manifest.dir}': path("."),
// '/var/lib/postgresql' : persistent('postgresql'), // Volume nomed
// '/var/log/postgresql' : path('./log/postgresql'),
},
// http: {
// domains: [ "#{system.name}.#{azk.default_domain}" ]
// },
ports: {
// exports global variables
portA: "5432:5432/tcp",
},
scalable: {"default": 1},
// envs: {
// // set instances variables
// EXAMPLE: "value",
// },
},
// rails 4, node.js, mysql
/*
Rules = investigator + jury
Generator.detect [
[Rules].investigate();
Generator.judgment();
[Rules].verdict();
]
*/
var evidences = {
"./front": {
ruby : { type: "runtime", data: { version: "2.0" } },
node : { type: "runtime", data: { version: "0.10.30" } },
rails: {
replaces: ["ruby", "node"],
type: "framework",
data: { version: "4.1" },
},
mysql: { type: "database", data: { version: "x.p.o", databasename: "" } },
},
"./api": {
node: { type: "runtime", data: { version: "0.10.30" } },
mysql: { type: "database", data: { version: "x.p.o", databasename: "" } },
}
},
// Verdict
systems = {
front: {
depends: ["mysql"],
images: "rails4.1",
},
api: {
depends: ["mysql"],
images: "dockerfile/nodejs",
},
mysql: {
},
}
/*
1) usar arrays pra ficar mais simples.
2) Detecções internas ficam pertencendo a seus pais. Por exemplo,
o Rails possui uma gemfile
*/
var foldersDetected = [
{
path: './front',
detections: [
{ name: 'ruby', type: 'runtime', from: 'Gemfile',
data: { version: '2.0' } },
{ name: 'node', type: 'runtime', from: 'package.json',
data: { version: '0.10.30' } },
{ name: 'rails', type: 'framework', from: 'Gemfile',
data: { version: '4.1' },
replaces: ['ruby', 'node'],
detections: [
{ name: 'mysql', type: 'database', from: 'Gemfile',
data: {
version: 'x.p.o',
databasename: ''
}
}
]
},
],
},
{
path: './api',
detections: [
{ name: 'node', type: 'runtime', from: 'Gemfile',
data: { version: '0.10.30' },
detections: [
{ name: 'mongo', type: 'database', from: 'Gemfile',
data: {
version: '2.4.5',
url: 'mongodb://localhost:27017/mymongo_db'
}
}
]
},
],
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment