SIOS-Technology-Inc / dacrane

"Dacrane" is a Delivery as Code (DaC) tool for deploying cloud infrastructures and applications anywhere.
Apache License 2.0
61 stars 1 forks source link

Node.js and Docker Build Resources #27

Closed t-ikeda-sti closed 11 months ago

t-ikeda-sti commented 1 year ago

User Story

Developers want to be able to easily build their own Node.js applications from dacrane (e.g., by simply specifying the programming language and build file).

Acceptance Criteria

dacrane.yaml

import: https://raw.githubusercontent.com/SIOS-Technology-Inc/dacrane/main/module/docker-npm.yaml
name: api
modules:
- name: api
  module: docker-npm
  argument:
    iamge: api
    tag: v1

/module/docker-npm.yaml

name: docker-npm
parameter:
  type: object
  required: ["image"]
  properties:
    node_base_iamge_tag: 
      title: Docker Image Tag
      description: >
        This is docker image tag name. https://hub.docker.com/_/node/
      type: string
      default: latest
    src_files: 
      title: Source Code File Path
      description: 
      type: string
      default: "**/*.js"
    package_json:       
      title: package.json File Path
      description: package.json File Path
      type: string
      default: "./package.json"
    package_json_lock:  
      title: package-lock.json File Path
      description: package-lock.json File Path
      type: string
      default: "./package-lock.json"
    build_command:
      title: Build Commnd
      description:  This command is used to install or transpile dependent modules.
      type: array
      items: { type: string }
      default: ["npm", "ci"]
    start_command:
      title: Start Command
      description: This command is used to start the Node.js program.
      type: array
      items: { type: string }
      default: ["npm", "start" ]
    image:
      title: Image Name
      description:  The name of the image to be built.
      type: string
    tag: 
      title: Image Tag
      description:  The tag of the image to be built.
      type: string
      default: latest
    env:
      title: Environment
      description:  Environment variables to be set at build time.
      type: object
      patternProperties: { ".*": { type: string } }
      default: {}
modules:
- name: dockerfile
  module: resource/file
  argument:
    filename: ./Dockerfile
    contents: >
      # write 
- name: image
  module: resource/docker-local-image
  argument:
    dockerfile: ...
    image: ...
    tag: ...
t-ikeda-sti commented 11 months ago

implemented.