Beispiel #1
0
func (a *App) Compile(ctx *app.Context) (*app.CompileResult, error) {
	var opts compile.AppOptions
	custom := &customizations{Opts: &opts}
	opts = compile.AppOptions{
		Ctx: ctx,
		Result: &app.CompileResult{
			Version: 1,
		},
		Bindata: &bindata.Data{
			Asset:    Asset,
			AssetDir: AssetDir,
			Context:  map[string]interface{}{},
		},
		Customization: (&compile.Customization{
			Callback: custom.process,
			Schema: map[string]*schema.FieldSchema{
				"node_version": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "4.1.0",
					Description: "Node version to install",
				},
			},
		}).Merge(compile.VagrantCustomizations(&opts)),
	}

	return compile.App(&opts)
}
Beispiel #2
0
func (a *App) Compile(ctx *app.Context) (*app.CompileResult, error) {
	var opts compile.AppOptions
	custom := &customizations{Opts: &opts}
	opts = compile.AppOptions{
		Ctx: ctx,
		Bindata: &bindata.Data{
			Asset:    Asset,
			AssetDir: AssetDir,
			Context:  map[string]interface{}{},
		},
		ScriptPacks: []*scriptpack.ScriptPack{
			&stdSP.ScriptPack,
			&pythonSP.ScriptPack,
		},
		Customization: (&compile.Customization{
			Callback: custom.process,
			Schema: map[string]*schema.FieldSchema{
				"python_version": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "2.7",
					Description: "Python version to install",
				},
				"python_entrypoint": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     fmt.Sprintf("%s:app", ctx.Appfile.Application.Name),
					Description: "WSGI entry point",
				},
			},
		}).Merge(compile.VagrantCustomizations(&opts)),
	}

	return compile.App(&opts)
}
Beispiel #3
0
func (a *App) Compile(ctx *app.Context) (*app.CompileResult, error) {
	var opts compile.AppOptions
	custom := &customizations{Opts: &opts}
	opts = compile.AppOptions{
		Ctx: ctx,
		Result: &app.CompileResult{
			Version: 1,
		},
		FoundationConfig: foundation.Config{
			ServiceName: ctx.Application.Name,
		},
		Bindata: &bindata.Data{
			Asset:    Asset,
			AssetDir: AssetDir,
			Context: map[string]interface{}{
				"dep_binary_path": fmt.Sprintf("/usr/local/bin/%s", ctx.Application.Name),
				"path": map[string]string{
					"guest_working": fmt.Sprintf(
						"/otto-deps/%s-%s",
						ctx.Application.Name,
						ctx.Appfile.ID),
				},
			},
		},
		Customization: (&compile.Customization{
			Callback: custom.process,
			Schema: map[string]*schema.FieldSchema{
				"go_version": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "1.5",
					Description: "Go version to install",
				},

				"go_import_path": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "",
					Description: "Go import path for where to put this in the GOPATH",
				},

				"run_command": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "{{ dep_binary_path }}",
					Description: "Command to run this app as a dep",
				},
			},
		}).Merge(compile.VagrantCustomizations(&opts)),
	}

	return compile.App(&opts)
}
Beispiel #4
0
func (a *App) Compile(ctx *app.Context) (*app.CompileResult, error) {
	var opts compile.AppOptions
	custom := &customizations{Opts: &opts}
	opts = compile.AppOptions{
		Ctx: ctx,
		Result: &app.CompileResult{
			Version: 1,
		},
		Bindata: &bindata.Data{
			Asset:    Asset,
			AssetDir: AssetDir,
			Context:  map[string]interface{}{},
		},
		Customization: (&compile.Customization{
			Callback: custom.process,
			Schema: map[string]*schema.FieldSchema{
				"node_version": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "4.1.0",
					Description: "Node version to install",
				},
				"npm_version": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "3.3.12",
					Description: "Npm version to install",
				},
				"port": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "8080",
					Description: "Port for Nginx pass through",
				},
				"app_startup_file": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "output/server.js",
					Description: "Application startup file",
				},
				"env_variables": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "",
					Description: "Environment variables to be set in format key=value key=value",
				},
			},
		}).Merge(compile.VagrantCustomizations(&opts)),
	}

	return compile.App(&opts)
}
Beispiel #5
0
func (a *App) Compile(ctx *app.Context) (*app.CompileResult, error) {
	fragmentPath := filepath.Join(ctx.Dir, "dev-dep", "Vagrantfile.fragment")

	var opts compile.AppOptions
	custom := &customizations{Opts: &opts}
	opts = compile.AppOptions{
		Ctx: ctx,
		Result: &app.CompileResult{
			Version: 1,
		},
		FoundationConfig: foundation.Config{
			ServiceName: ctx.Application.Name,
		},
		Bindata: &bindata.Data{
			Asset:    Asset,
			AssetDir: AssetDir,
			Context: map[string]interface{}{
				"fragment_path": fragmentPath,
				"path": map[string]string{
					"guest_working": fmt.Sprintf(
						"/otto-deps/%s-%s",
						ctx.Application.Name,
						ctx.Appfile.ID),
				},
			},
		},
		Customization: (&compile.Customization{
			Callback: custom.process,
			Schema: map[string]*schema.FieldSchema{
				"image": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "",
					Description: "Image name to run",
				},

				"run_args": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "",
					Description: "Args to pass to `docker run`",
				},
			},
		}).Merge(compile.VagrantCustomizations(&opts)),
	}

	return compile.App(&opts)
}
Beispiel #6
0
// Compile ...
func (a *App) Compile(ctx *app.Context) (*app.CompileResult, error) {
	var opts compile.AppOptions
	custom := &customizations{Opts: &opts}
	opts = compile.AppOptions{
		Ctx: ctx,
		Result: &app.CompileResult{
			Version: 1,
		},
		FoundationConfig: foundation.Config{
			ServiceName: ctx.Application.Name,
		},
		Bindata: &bindata.Data{
			Asset:    Asset,
			AssetDir: AssetDir,
			Context:  map[string]interface{}{},
		},
		ScriptPacks: []*scriptpack.ScriptPack{
			&stdSP.ScriptPack,
			&javaSP.ScriptPack,
		},
		Customization: (&compile.Customization{
			Callback: custom.processDev,
			Schema: map[string]*schema.FieldSchema{
				"gradle_version": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "2.8",
					Description: "Java version to install",
				},
				"maven_version": &schema.FieldSchema{
					Type:        schema.TypeString,
					Default:     "3.3.9",
					Description: "Maven version to install",
				},
			},
		}).Merge(compile.VagrantCustomizations(&opts)),
	}

	return compile.App(&opts)
}