Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts -> Actions #1144

Merged
merged 105 commits into from
Jan 24, 2023
Merged

Scripts -> Actions #1144

merged 105 commits into from
Jan 24, 2023

Conversation

jeff-mccoy
Copy link
Contributor

@jeff-mccoy jeff-mccoy commented Dec 27, 2022

Related Issues

Related to #939
Fixes #1137, #1022

Backwards compatible replacement of simple scripts with complex actions

  • Define types
  • package create transparent migration
  • package deploy transparent migration
  • Introduce deprecation pattern into src/pkg/packager
  • PackageCreate actions: Before, After, Success, Failure
  • PackageDeploy actions: Before, After, Success, Failure
  • PackageRemove actions: Before, After, Success, Failure

Other refactors

  • Expand exec to support env variables, add config struct
  • Add common cmd defaults
  • Add set working dir support
  • Inject deploy-time variables as env variables for onDeploy
  • Expand sha256sum function to support any generic crypto hash type

@jeff-mccoy
Copy link
Contributor Author

Automatic conversion of scripts -> actions on zarf package create or zarf package deploy
Screenshot 2022-12-26 at 11 03 31 PM

@jeff-mccoy jeff-mccoy added needs-adr needs-docs PR Label - Docs required to merge needs-tests PR Label - Tests required to merge labels Dec 28, 2022
@jeff-mccoy jeff-mccoy changed the title Nothing Scripts -> Actions Jan 4, 2023
@jeff-mccoy
Copy link
Contributor Author

Added basic mermaid to show the cycle of component actions
Screenshot 2023-01-03 at 11 01 41 PM

@jeff-mccoy
Copy link
Contributor Author

It's ugly for now, but does warn the users.
Screenshot 2023-01-05 at 2 14 43 AM

@RothAndrew
Copy link
Contributor

RothAndrew commented Jan 24, 2023

Does the schema file need to be updated?

Edit: no? I see actions in the schema file in this branch. Maybe I have something cached..

image

@Racer159
Copy link
Contributor

Does the schema file need to be updated?

Edit: no? I see actions in the schema file in this branch. Maybe I have something cached..

image

Not sure which IDE that is, but for VSCode at least it is in settings.json. You also may need to restart your IDE after switching branches (at least VS Code requires a restart)

src/cmd/internal.go Outdated Show resolved Hide resolved
src/cmd/internal.go Outdated Show resolved Hide resolved
src/types/package.go Show resolved Hide resolved
Copy link
Contributor

@YrrepNoj YrrepNoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR has my unbiased approval.

Copy link
Contributor

@Racer159 Racer159 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@jeff-mccoy jeff-mccoy merged commit 6a9d0c9 into main Jan 24, 2023
@jeff-mccoy jeff-mccoy deleted the jeff-doing-stupid-jeff-things branch January 24, 2023 18:45
@jeff-mccoy jeff-mccoy mentioned this pull request Jan 24, 2023
5 tasks
Noxsios pushed a commit that referenced this pull request Mar 8, 2023
## Related Issues
Related to #939 
Fixes #1137, #1022

### Backwards compatible replacement of simple `scripts` with complex
`actions`
- [x] Define types
- [x] `package create` transparent migration
- [x] `package deploy` transparent migration
- [x] Introduce deprecation pattern into `src/pkg/packager`
- [x] Package`Create` actions: `Before`, `After`, `Success`, `Failure`
- [x] Package`Deploy` actions: `Before`, `After`, `Success`, `Failure` 
- [x] Package`Remove` actions: `Before`, `After`, `Success`, `Failure`
  
### Other refactors
- [x] Expand exec to support env variables, add config struct
- [x] Add common cmd defaults
- [x] Add set working dir support 
- [x] Inject deploy-time variables as env variables for `onDeploy`
- [x] Expand sha256sum function to support any generic crypto hash type

Co-authored-by: Wayne Starr <[email protected]>
Co-authored-by: Jon Perry <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zarf Component Chart Values/Outputs
7 participants