eed-web-application / core-build-system

0 stars 0 forks source link

new POST endpoint for starting a deployment #18

Open pnispero opened 1 week ago

pnispero commented 1 week ago

Add new POST endpoint for starting a deployment container

The deployment image exists as pnispero/deploy-env:latest. This will be used to deploy official build results releases from the artifact storage for a component:tag.

Logic needed from backend

  1. New POST endpoint possibly /v1/build/component/{componentName}/
  2. when CLI calls endpoint with payload below, backend starts new deployment pod

JSON payload from CLI:

'headers': {
    "linux_username": "string",
    "github_username": "string" 
},
'body': {
    "facilities": "string"
    "initial": "string"   
    "component": "string"
    "tag": "string"   
    "app_type": "string"
}

Arguments (env variables) to pass to the deployment pod

- name: ADBS_FACILITIES
  value: '["LCLS", "FACET"]'
- name: ADBS_INITIAL
  value: "true"
- name: ADBS_APP_TYPE
  value: IOC
- name: ADBS_COMPONENT
  value: test-ioc
- name: ADBS_TAG
  value: test-ioc-1.0.0
pnispero commented 5 days ago

TODO - will attempt to work on this issue myself to learn codebase:

Classes to make (in order because the succeeding classes may depend on the previous ones):

  1. controller/DeploymentController.java
  2. dto/ComponentTagDeploymentDTO.java
  3. dto/ComponentTagDeploymentSummaryDTO.java (maybe?)
  4. model/ComponentTagDeployment.java
  5. mapper/ComponentTagDeploymentMapper.java
  6. exception/DeploymentNotFound.java
  7. exception/DeploymentTagNotFound.java
  8. migration/InitDeployImage.java
  9. task/ProcessDeploymentTask.java
  10. service/ComponentDeploymentService.java

This may or may not be more than what's needed Note* Use the existing build flow as a reference since it is similar.