diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-12 09:07:10 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-12 09:07:10 -0400 |
commit | a8d6e37a874c7a40429d0aec247658ae1edca6ed (patch) | |
tree | c9c958c0c416ecea8eec0042a88a4b2a036c1274 /src/deliverable.c | |
parent | 6a66d6848a834eddae8225fd723a2a05e98b3c4d (diff) | |
download | stasis-a8d6e37a874c7a40429d0aec247658ae1edca6ed.tar.gz |
Bootstrap delivery context
* Gives access to build information before directory creation
* Better control over where data ends up
* Decreases complexity related to uploading artifacts from a delivery tree
Diffstat (limited to 'src/deliverable.c')
-rw-r--r-- | src/deliverable.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/deliverable.c b/src/deliverable.c index b71b178..6c88e66 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -239,10 +239,10 @@ void delivery_init_dirs_stage1(struct Delivery *ctx) { fprintf(stderr, "OMC_ROOT is set, but empty. Please assign a file system path to this environment variable.\n"); exit(1); } - path_store(&ctx->storage.root, PATH_MAX, rootdir, ""); + path_store(&ctx->storage.root, PATH_MAX, rootdir, ctx->info.build_name); } else { // use "omc" in current working directory - path_store(&ctx->storage.root, PATH_MAX, "omc", ""); + path_store(&ctx->storage.root, PATH_MAX, "omc", ctx->info.build_name); } path_store(&ctx->storage.tools_dir, PATH_MAX, ctx->storage.root, "tools"); path_store(&ctx->storage.tmpdir, PATH_MAX, ctx->storage.root, "tmp"); @@ -673,6 +673,23 @@ static int populate_info(struct Delivery *ctx) { } return 0; } + +int *bootstrap_build_info(struct Delivery *ctx) { + struct Delivery local; + memset(&local, 0, sizeof(local)); + local._omc_ini_fp.cfg = ini_open(ctx->_omc_ini_fp.cfg_path); + local._omc_ini_fp.delivery = ini_open(ctx->_omc_ini_fp.delivery_path); + delivery_init_platform(&local); + populate_delivery_cfg(&local); + populate_delivery_ini(&local); + populate_info(&local); + ctx->info.build_name = strdup(local.info.build_name); + ctx->info.build_number = strdup(local.info.build_number); + ctx->info.release_name = strdup(local.info.release_name); + memcpy(&ctx->info.time_info, &local.info.time_info, sizeof(ctx->info.time_info)); + ctx->info.time_now = local.info.time_now; + ctx->info.time_str_epoch = strdup(local.info.time_str_epoch); + delivery_free(&local); return 0; } |