aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-04-12 15:57:32 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-04-12 15:57:32 -0400
commit507c003a36584fae29cba00ca8e264488f39476e (patch)
treed1062275360e96071ca3e8bf8b3d0be9df4a9a06 /src/main.c
parent4049e0de876611d1d94fbd0185a0ab9722cb8ce1 (diff)
downloadstasis-507c003a36584fae29cba00ca8e264488f39476e.tar.gz
Save raw and rendered versions of the input configuration.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 6608299..7c20ae7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -532,6 +532,33 @@ int main(int argc, char *argv[]) {
conda_exec("list");
msg(OMC_MSG_L1, "Creating release\n");
+ msg(OMC_MSG_L2, "Exporting delivery configuration\n");
+ if (!pushd(ctx.storage.cfgdump_dir)) {
+ char filename[PATH_MAX] = {0};
+ sprintf(filename, "%s.ini", ctx.info.release_name);
+ FILE *spec = fopen(filename, "w+");
+ if (!spec) {
+ msg(OMC_MSG_ERROR | OMC_MSG_L2, "failed %s\n", filename);
+ exit(1);
+ }
+ ini_write(ctx._omc_ini_fp.delivery, &spec, INI_WRITE_RAW);
+ fclose(spec);
+
+ memset(filename, 0, sizeof(filename));
+ sprintf(filename, "%s-rendered.ini", ctx.info.release_name);
+ spec = fopen(filename, "w+");
+ if (!spec) {
+ msg(OMC_MSG_ERROR | OMC_MSG_L2, "failed %s\n", filename);
+ exit(1);
+ }
+ ini_write(ctx._omc_ini_fp.delivery, &spec, INI_WRITE_PRESERVE);
+ fclose(spec);
+ popd();
+ } else {
+ SYSERROR("Failed to enter directory: %s", ctx.storage.delivery_dir);
+ exit(1);
+ }
+
msg(OMC_MSG_L2, "Exporting %s\n", env_name_testing);
if (conda_env_export(env_name_testing, ctx.storage.delivery_dir, env_name_testing)) {
msg(OMC_MSG_ERROR | OMC_MSG_L2, "failed %s\n", env_name_testing);