Skip to content

Commit fef114d

Browse files
committed
Archive Linux CLI artifact for downstream checks
1 parent 5f497af commit fef114d

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

‎Jenkinsfile‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,21 @@ pipeline {
1414
stage('Test') {
1515
steps { sh 'scripts/test.sh' }
1616
}
17+
stage('Archive Linux CLI artifact') {
18+
steps {
19+
sh '''
20+
set -eu
21+
artifact_dir='jenkins-artifacts/codebase-memory-cli-linux-amd64'
22+
rm -rf "$artifact_dir"
23+
mkdir -p "$artifact_dir"
24+
cp build/c/codebase-memory-cli "$artifact_dir/codebase-memory-cli"
25+
chmod 0755 "$artifact_dir/codebase-memory-cli"
26+
sha256sum "$artifact_dir/codebase-memory-cli" > "$artifact_dir/SHA256SUMS"
27+
git rev-parse HEAD > "$artifact_dir/source-revision"
28+
"$artifact_dir/codebase-memory-cli" --version > "$artifact_dir/version.txt"
29+
'''
30+
archiveArtifacts artifacts: 'jenkins-artifacts/codebase-memory-cli-linux-amd64/**', fingerprint: true
31+
}
32+
}
1733
}
1834
}

‎scripts/test.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ bash "$ROOT/tests/test_build_dir_safety.sh"
206206
echo "=== Step 0b: Windows VM worktree sync contract ==="
207207
bash "$ROOT/tests/test_vm_worktree_manifest.sh"
208208

209-
echo "=== Step 0c: UI development proxy security contract ==="
209+
echo "=== Step 0c: Jenkins artifact contract ==="
210+
bash "$ROOT/tests/test_jenkins_artifact_contract.sh"
211+
212+
echo "=== Step 0d: UI development proxy security contract ==="
210213
bash "$ROOT/tests/test_ui_dev_proxy_security.sh"
211214

212215
echo "=== Step 0d: daemon soak recovery contract ==="
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
pipeline="$root/Jenkinsfile"
6+
7+
for required in \
8+
"Archive Linux CLI artifact" \
9+
"codebase-memory-cli-linux-amd64" \
10+
"sha256sum" \
11+
"source-revision" \
12+
"archiveArtifacts"; do
13+
grep -Fq "$required" "$pipeline" || {
14+
echo "missing Jenkins artifact contract: $required" >&2
15+
exit 1
16+
}
17+
done

0 commit comments

Comments
 (0)