summaryrefslogtreecommitdiff
path: root/worker/scripts
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-07-26 17:39:44 -0700
committerElizabeth Hunt <me@liz.coffee>2025-07-26 18:09:32 -0700
commit9ee3bf3345b006a745b2ee28fee3613819011796 (patch)
tree5e92342d75d0a72102f320b85363cdbb36f3de43 /worker/scripts
parentdf1a7eec824d9e9d99c58b1f7792c8f384955273 (diff)
downloadci-9ee3bf3345b006a745b2ee28fee3613819011796.tar.gz
ci-9ee3bf3345b006a745b2ee28fee3613819011796.zip
Adds session-level storage for bw cli
Diffstat (limited to 'worker/scripts')
-rwxr-xr-xworker/scripts/ansible_playbook.ts4
-rwxr-xr-xworker/scripts/build_docker_image.ts9
2 files changed, 7 insertions, 6 deletions
diff --git a/worker/scripts/ansible_playbook.ts b/worker/scripts/ansible_playbook.ts
index 6eb4d47..20f85d8 100755
--- a/worker/scripts/ansible_playbook.ts
+++ b/worker/scripts/ansible_playbook.ts
@@ -36,12 +36,12 @@ await LogMetricTraceable.ofLogTraceable(_logJob)
tEitherJob.get().flatMapAsync((job) =>
eitherVault.flatMapAsync(async (vault) => {
const eitherKey = await vault.unlock(tEitherJob);
+ tEitherJob.trace.trace('unlocked vault :3');
return eitherKey.mapRight((key) => ({ job, key, vault }));
}),
),
)
.map(async (tEitherJobVault) => {
- tEitherJobVault.trace.trace('getting ansible secwets uwu~');
const eitherJobVault = await tEitherJobVault.get();
const eitherSshKey = await eitherJobVault.flatMapAsync(({ key, vault }) =>
@@ -49,7 +49,7 @@ await LogMetricTraceable.ofLogTraceable(_logJob)
);
const eitherSshKeyFile = await eitherSshKey.mapRight(({ notes }) => notes).flatMapAsync(saveToTempFile);
const eitherAnsibleSecrets = await eitherJobVault.flatMapAsync(({ key, vault }) =>
- vault.fetchSecret<SecureNote>(tEitherJobVault, key, 'ansible_playbooks'),
+ vault.fetchSecret<SecureNote>(tEitherJobVault, key, 'ansible_secrets'),
);
const eitherAnsibleSecretsFile = await eitherAnsibleSecrets
.mapRight(({ notes }) => notes)
diff --git a/worker/scripts/build_docker_image.ts b/worker/scripts/build_docker_image.ts
index 6b4765c..759dfc1 100755
--- a/worker/scripts/build_docker_image.ts
+++ b/worker/scripts/build_docker_image.ts
@@ -58,9 +58,10 @@ await LogMetricTraceable.ofLogTraceable(_logJob)
.map(async (tEitherJobVault) => {
tEitherJobVault.trace.trace('logging into the wegistwy uwu~');
const eitherJobVault = await tEitherJobVault.get();
- const eitherDockerRegistryLoginItem = await eitherJobVault.flatMapAsync(
- ({ job, key, vault }) => vault.fetchSecret<LoginItem>(tEitherJobVault, key, job.arguments.registry),
- // .finally(() => vault.lock(tEitherJobVault, key)),
+ const eitherDockerRegistryLoginItem = await eitherJobVault.flatMapAsync(({ job, key, vault }) =>
+ vault
+ .fetchSecret<LoginItem>(tEitherJobVault, key, job.arguments.registry)
+ .finally(() => vault.lock(tEitherJobVault, key)),
);
return eitherDockerRegistryLoginItem.flatMapAsync(({ login }) =>
eitherJobVault.flatMapAsync(async ({ job }) => {
@@ -83,7 +84,7 @@ await LogMetricTraceable.ofLogTraceable(_logJob)
const eitherBuiltImage = await eitherWithAuthdRegistryBuildJob.flatMapAsync(({ arguments: args }) =>
tEitherWithAuthdRegistryBuildJob
.move(getBuildCommand(args))
- .peek(t => t.trace.trace('finally building the image~ (◕ᴗ◕✿)'))
+ .peek((t) => t.trace.trace('finally building the image~ (◕ᴗ◕✿)'))
.map((tBuildCmd) =>
getStdout(tBuildCmd, {
env: {},