Update the custom command mirror
This commit is contained in:
@ -21,4 +21,5 @@ patches:
|
||||
git:
|
||||
path: ../patches/git/zot.patch
|
||||
mirrors:
|
||||
- apps-git
|
||||
# - apps-git
|
||||
- custom-command
|
||||
|
@ -4,10 +4,6 @@ variables:
|
||||
include:
|
||||
- kind: Charts
|
||||
path: ./charts/zot.yaml
|
||||
- kind: Charts
|
||||
path: ./charts/gitops-server.yaml
|
||||
- kind: Charts
|
||||
path: ./charts/external-secrets-operator.yaml
|
||||
patches:
|
||||
- name: yamlfmt
|
||||
custom_command:
|
||||
@ -56,3 +52,10 @@ mirrors:
|
||||
commit: |-
|
||||
chore: mirror {{ name }}-{{ version }}
|
||||
upstream_repo: {{ repo_url }}
|
||||
- name: custom-commands
|
||||
custom_command:
|
||||
package:
|
||||
- helm package -d package .
|
||||
upload:
|
||||
- helm push ./package/{{ name }}-{{ version }}.tgz oci://registry.badhouseplants.net
|
||||
- rm -rf ./package
|
||||
|
@ -61,6 +61,7 @@ fn exec(args: Args) -> Result<(), Box<dyn Error>> {
|
||||
// First step is to pull the chart to the working dir
|
||||
let current_repo = chart.chart.find_repo(config.repositories.clone())?;
|
||||
let chart_path = current_repo.pull_chart(chart.chart.clone(), workdir_path.clone())?;
|
||||
chart.chart.version = current_repo.get_version(chart_path.clone())?;
|
||||
if let Some(extensions) = chart.extensions.clone() {
|
||||
extensions
|
||||
.into_iter()
|
||||
@ -89,7 +90,7 @@ fn exec(args: Args) -> Result<(), Box<dyn Error>> {
|
||||
message_empty(&format!("{}", chart.chart.name));
|
||||
Ok(())
|
||||
})?;
|
||||
todo!()
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -12,7 +12,7 @@ pub(crate) struct CustomCommands {
|
||||
impl Target for CustomCommands {
|
||||
fn push(
|
||||
&self,
|
||||
workdir_path: String,
|
||||
_: String,
|
||||
chart_path: String,
|
||||
chart_local: ChartExtended,
|
||||
dry_run: bool,
|
||||
@ -21,14 +21,14 @@ impl Target for CustomCommands {
|
||||
let mut reg = helmzoo_lib::template::register_handlebars();
|
||||
reg.register_template_string("cmd", cmd_tmpl)?;
|
||||
let cmd = reg.render("cmd", &chart_local)?;
|
||||
cli_exec_from_dir(cmd, workdir_path.clone())?;
|
||||
cli_exec_from_dir(cmd, chart_path.clone())?;
|
||||
}
|
||||
if !dry_run {
|
||||
for cmd_tmpl in self.upload.clone() {
|
||||
let mut reg = template::register_handlebars();
|
||||
reg.register_template_string("cmd", cmd_tmpl)?;
|
||||
let cmd = reg.render("cmd", &chart_local)?;
|
||||
cli_exec_from_dir(cmd, workdir_path.clone())?;
|
||||
cli_exec_from_dir(cmd, chart_path.clone())?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user