almartino opened a new pull request, #98:
URL: https://github.com/apache/openserverless-task/pull/98
The solution implements a project-specific undeployment mechanism that:
1. Keeps track of which packages and actions are deployed in the current
project
2. Organizes actions by package in a more detailed structure
3. Allows removing a specific action and updating the deployment file
4. Returns an error if executed in a directory without an OpenServerless
project
### Implementation Details
#### 1. Improved Structure for Deployment Information
When `ops ide deploy` is executed, the system now saves information about
deployed packages and actions in a file with an improved structure:
- Information is stored in `.ops/deployment.json` in the project root
- The file contains a JSON object with:
- `packages`: An array of package names that have been deployed
- `packageActions`: An object that maps each package to an array of its
actions
Example:
```json
{
"packages": ["foo", "bar", "baz"],
"packageActions": {
"foo": ["hello", "world"],
"bar": ["some_action"],
"baz": []
}
}
```
##### Sidenote 1: could be useful to automatically add the `.ops` dir to the
.gitignore file when creating a project?
##### Sidenote 2: should we make this retro compatible for projects prior to
this fix?
#### 2. Project-Specific Undeployment
When `ops ide undeploy` is executed without arguments:
- The system checks for the existence of `.ops/deployment.json`
- If the file exists, it reads the deployment information
- It removes only the actions and packages listed in the file
- If the file doesn't exist, it returns an error message indicating that no
OpenServerless project was found
#### 3. Single Action Undeployment
When `ops ide undeploy contact/index` is executed:
- The system removes the specific action
- It updates the `.ops/deployment.json` file to remove the action from the
list
- If the package no longer has actions, it also removes the package from the
list
references apache/openserverless#117
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]