Merge pull request #52 from pikasTech/fix/v01-ci-tools-image
fix: 避免 v0.1 CI 运行时 apk 安装
This commit is contained in:
@@ -30,7 +30,7 @@ spec:
|
|||||||
default: 127.0.0.1:5000/agentrun
|
default: 127.0.0.1:5000/agentrun
|
||||||
- name: tools-image
|
- name: tools-image
|
||||||
type: string
|
type: string
|
||||||
default: oven/bun:1.2.15-alpine
|
default: 127.0.0.1:5000/hwlab/hwlab-ci-node-tools:node22-alpine-bun-v1
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
- name: git-ssh
|
- name: git-ssh
|
||||||
@@ -67,7 +67,6 @@ spec:
|
|||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
apk add --no-cache git curl
|
|
||||||
rm -rf /workspace/source/repo
|
rm -rf /workspace/source/repo
|
||||||
mkdir -p /workspace/source/repo
|
mkdir -p /workspace/source/repo
|
||||||
git init /workspace/source/repo
|
git init /workspace/source/repo
|
||||||
@@ -100,6 +99,7 @@ spec:
|
|||||||
- name: gitops-branch
|
- name: gitops-branch
|
||||||
- name: revision
|
- name: revision
|
||||||
- name: registry-prefix
|
- name: registry-prefix
|
||||||
|
- name: tools-image
|
||||||
results:
|
results:
|
||||||
- name: env-identity
|
- name: env-identity
|
||||||
- name: build-count
|
- name: build-count
|
||||||
@@ -109,21 +109,20 @@ spec:
|
|||||||
- name: source
|
- name: source
|
||||||
steps:
|
steps:
|
||||||
- name: plan
|
- name: plan
|
||||||
image: oven/bun:1.2.15-alpine
|
image: $(params.tools-image)
|
||||||
env:
|
env:
|
||||||
- name: GIT_TERMINAL_PROMPT
|
- name: GIT_TERMINAL_PROMPT
|
||||||
value: "0"
|
value: "0"
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
apk add --no-cache git nodejs
|
|
||||||
cd /workspace/source/repo
|
cd /workspace/source/repo
|
||||||
node <<'NODE' > /workspace/source/env-identity
|
node <<'NODE' > /workspace/source/env-identity
|
||||||
const { createHash } = require("node:crypto");
|
const { createHash } = require("node:crypto");
|
||||||
const { readFileSync } = require("node:fs");
|
const { readFileSync } = require("node:fs");
|
||||||
const inputs = [
|
const inputs = [
|
||||||
["baseImage", "oven/bun:1.2.15-alpine"],
|
["toolsImage", "127.0.0.1:5000/hwlab/hwlab-ci-node-tools:node22-alpine-bun-v1"],
|
||||||
["systemPackages", "ca-certificates git kubectl nodejs openssh-client"],
|
["systemPackages", "ca-certificates curl git kubectl nodejs openssh-client"],
|
||||||
["containerfile", readFileSync("deploy/container/Containerfile", "utf8")],
|
["containerfile", readFileSync("deploy/container/Containerfile", "utf8")],
|
||||||
["bootScript", readFileSync("deploy/runtime/boot/agentrun-boot.sh", "utf8")],
|
["bootScript", readFileSync("deploy/runtime/boot/agentrun-boot.sh", "utf8")],
|
||||||
["bootMgr", readFileSync("deploy/runtime/boot/agentrun-mgr.sh", "utf8")],
|
["bootMgr", readFileSync("deploy/runtime/boot/agentrun-mgr.sh", "utf8")],
|
||||||
@@ -190,7 +189,7 @@ spec:
|
|||||||
gitopsBranch,
|
gitopsBranch,
|
||||||
sourceCommitId: revision,
|
sourceCommitId: revision,
|
||||||
envIdentity,
|
envIdentity,
|
||||||
toolchainInputs: ["oven/bun:1.2.15-alpine", "deploy/container/Containerfile", "deploy/runtime/boot/*.sh", "package.json", "bun.lock", "tsconfig.json", "apk:ca-certificates git kubectl nodejs openssh-client"],
|
toolchainInputs: ["127.0.0.1:5000/hwlab/hwlab-ci-node-tools:node22-alpine-bun-v1", "deploy/container/Containerfile", "deploy/runtime/boot/*.sh", "package.json", "bun.lock", "tsconfig.json", "tools:ca-certificates curl git kubectl nodejs openssh-client"],
|
||||||
buildServices: reused ? [] : ["agentrun-mgr"],
|
buildServices: reused ? [] : ["agentrun-mgr"],
|
||||||
reusedServices: reused ? ["agentrun-mgr"] : [],
|
reusedServices: reused ? ["agentrun-mgr"] : [],
|
||||||
unsafeReuseServices: [],
|
unsafeReuseServices: [],
|
||||||
@@ -213,6 +212,8 @@ spec:
|
|||||||
value: $(params.revision)
|
value: $(params.revision)
|
||||||
- name: registry-prefix
|
- name: registry-prefix
|
||||||
value: $(params.registry-prefix)
|
value: $(params.registry-prefix)
|
||||||
|
- name: tools-image
|
||||||
|
value: $(params.tools-image)
|
||||||
- name: image-publish
|
- name: image-publish
|
||||||
runAfter: [plan-artifacts]
|
runAfter: [plan-artifacts]
|
||||||
workspaces:
|
workspaces:
|
||||||
@@ -222,6 +223,7 @@ spec:
|
|||||||
params:
|
params:
|
||||||
- name: revision
|
- name: revision
|
||||||
- name: registry-prefix
|
- name: registry-prefix
|
||||||
|
- name: tools-image
|
||||||
results:
|
results:
|
||||||
- name: image
|
- name: image
|
||||||
- name: digest
|
- name: digest
|
||||||
@@ -272,7 +274,7 @@ spec:
|
|||||||
- name: buildkit-bin
|
- name: buildkit-bin
|
||||||
mountPath: /workspace/buildkit-bin
|
mountPath: /workspace/buildkit-bin
|
||||||
- name: build-or-reuse
|
- name: build-or-reuse
|
||||||
image: oven/bun:1.2.15-alpine
|
image: $(params.tools-image)
|
||||||
env:
|
env:
|
||||||
- name: HTTP_PROXY
|
- name: HTTP_PROXY
|
||||||
value: http://127.0.0.1:10808
|
value: http://127.0.0.1:10808
|
||||||
@@ -283,7 +285,6 @@ spec:
|
|||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
apk add --no-cache curl nodejs
|
|
||||||
cd /workspace/source/repo
|
cd /workspace/source/repo
|
||||||
env_identity="$(cat /workspace/source/env-identity)"
|
env_identity="$(cat /workspace/source/env-identity)"
|
||||||
if node -e 'const p=require("/workspace/source/ci-plan.json"); process.exit((p.buildServices||[]).length===0 ? 0 : 1)'; then
|
if node -e 'const p=require("/workspace/source/ci-plan.json"); process.exit((p.buildServices||[]).length===0 ? 0 : 1)'; then
|
||||||
@@ -343,6 +344,8 @@ spec:
|
|||||||
value: $(params.revision)
|
value: $(params.revision)
|
||||||
- name: registry-prefix
|
- name: registry-prefix
|
||||||
value: $(params.registry-prefix)
|
value: $(params.registry-prefix)
|
||||||
|
- name: tools-image
|
||||||
|
value: $(params.tools-image)
|
||||||
- name: gitops-promote
|
- name: gitops-promote
|
||||||
runAfter: [image-publish]
|
runAfter: [image-publish]
|
||||||
workspaces:
|
workspaces:
|
||||||
@@ -359,11 +362,12 @@ spec:
|
|||||||
- name: repository-digest
|
- name: repository-digest
|
||||||
- name: env-identity
|
- name: env-identity
|
||||||
- name: image-status
|
- name: image-status
|
||||||
|
- name: tools-image
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
steps:
|
steps:
|
||||||
- name: promote
|
- name: promote
|
||||||
image: oven/bun:1.2.15-alpine
|
image: $(params.tools-image)
|
||||||
env:
|
env:
|
||||||
- name: GIT_TERMINAL_PROMPT
|
- name: GIT_TERMINAL_PROMPT
|
||||||
value: "0"
|
value: "0"
|
||||||
@@ -384,7 +388,6 @@ spec:
|
|||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
apk add --no-cache git openssh-client nodejs
|
|
||||||
cd /workspace/source/repo
|
cd /workspace/source/repo
|
||||||
node <<'NODE' > /workspace/source/artifact-catalog.v01.json
|
node <<'NODE' > /workspace/source/artifact-catalog.v01.json
|
||||||
const { readFileSync } = require("node:fs");
|
const { readFileSync } = require("node:fs");
|
||||||
|
|||||||
Reference in New Issue
Block a user