mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 21:20:44 +00:00
Fix(ci): Correct container publishing pipeline and improve robustness (#4093)
This commit is contained in:
parent
ef8ec98489
commit
8d0a4082a4
2 changed files with 16 additions and 9 deletions
|
|
@ -18,7 +18,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
import { execSync } from 'child_process';
|
||||
import { chmodSync, readFileSync, rmSync } from 'fs';
|
||||
import { chmodSync, existsSync, readFileSync, rmSync, writeFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import yargs from 'yargs';
|
||||
import { hideBin } from 'yargs/helpers';
|
||||
|
|
@ -134,6 +134,14 @@ function buildImage(imageName, dockerfile) {
|
|||
{ stdio: buildStdout, shell: '/bin/bash' },
|
||||
);
|
||||
console.log(`built ${finalImageName}`);
|
||||
if (existsSync('/workspace/final_image_uri.txt')) {
|
||||
// The publish step only supports one image. If we build multiple, only the last one
|
||||
// will be published. Throw an error to make this failure explicit.
|
||||
throw new Error(
|
||||
'CI artifact file /workspace/final_image_uri.txt already exists. Refusing to overwrite.',
|
||||
);
|
||||
}
|
||||
writeFileSync('/workspace/final_image_uri.txt', finalImageName);
|
||||
}
|
||||
|
||||
if (baseImage && baseDockerfile) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue