docker-builder

command module
v0.0.0-...-5e0d270 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

docker-builder

A service-builder that makes it easier to build and deploy multiple services in a monorepo

Builder config file

{
    "servicename": "servicename", // The servicename in k8s. String-value
    "cluster": "controller" | "services", // Which cluster should the service be deployed to.
    "builder": {}, // How should the service be build and deployed... Optional and defaults to the default manual builder.
    "deploy": {},
    "deploymentfile": "", // Deploymentfile for kubernetes. Optional and defaults to deployment.yaml.
}

Manual builder

{
    "type": "manual",
    "dockerfile": "", // Dockerfile to build the project. Optional and defaults to Dockerfile
    "buildcontext": "root" | "projectdir", // In which context should the dockerfile be built. In the root context or in projectdir context. Optional field with default set to root.
}

dotnet builder

{
    "type": "dotnet",
    "dotnetruntime": "runtime" | "aspnet", // What framework is used by the service. By default the builder checks the dependencies of the solution and selects the best runtime for you, but you can override the checks by setting this property.
    "projectfile": "", // Name of project file relative to this settingsfile. Optional, defaults to file named *.csproj. Required only if multiple csproj files exists inside same folder.
}

node builder

{
    "type": "nodejs",
    "nodeversion": "{nodejs version}", // Required field. What node version should be used to build and as runtime. Eg. 12 or more specific with 12.14.1
    "buildcommand": "", // Optional field. Command to build the project. Could be as simple as "npm build".
    "runcommand": "", // Required field. Command to run the project. Could be as simple as "npm start".
}

Example deployment.yaml file

Servicename, namespace and image gets replaced in the build-step, while the rest are replaced as part of the release step.


apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: #{servicename}#
  namespace: #{namespace}#
spec:
  replicas: #{replicas}#
  template:
    metadata:
      labels:
        app: #{servicename}#
    spec:      
      containers:
      - name: #{servicename}#
        image: #{image}#
        env:
        - name: ENVIRONMENT_VALUE_TO_SET_IN_APPLICATION
          value: "#{VARIABLE_GIVEN_TO_DEPLOYSCRIPT}#"
        - name: Storage
          value: "#{Storage}#"
        - name: ServiceBus
          value: "#{ServiceBus}#"
        - name: logLevel
          value: "Warn"
        - name: ApplicationInsights__InstrumentationKey
          value: "#{ApplicationInsightsInstrumentationKey}#"
        - name: BatchSize
          value: "#{BatchSize}#"

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
test
go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL