fix
This commit is contained in:
@@ -7,7 +7,6 @@ const sources=[
|
|||||||
#{url: "https://github.com/tektoncd/catalog/raw/main/task/buildpacks-phases/0.2/buildpacks-phases.yaml", name: "buildpacks-phases.yaml"},
|
#{url: "https://github.com/tektoncd/catalog/raw/main/task/buildpacks-phases/0.2/buildpacks-phases.yaml", name: "buildpacks-phases.yaml"},
|
||||||
#{url: "https://github.com/tektoncd/catalog/raw/main/task/buildpacks/0.6/buildpacks.yaml", name: "buildpacks.yaml"},
|
#{url: "https://github.com/tektoncd/catalog/raw/main/task/buildpacks/0.6/buildpacks.yaml", name: "buildpacks.yaml"},
|
||||||
#{url: "https://github.com/tektoncd/catalog/raw/main/task/check-make/0.1/check-make.yaml", name: "check-make.yaml"},
|
#{url: "https://github.com/tektoncd/catalog/raw/main/task/check-make/0.1/check-make.yaml", name: "check-make.yaml"},
|
||||||
#{url: "https://github.com/tektoncd/catalog/raw/main/task/generate-build-id/0.1/generate-build-id.yaml", name: "generate-build-id.yaml"},
|
|
||||||
#{url: "https://github.com/tektoncd/catalog/raw/main/task/gitea-set-status/0.1/gitea-set-status.yaml", name: "gitea-set-status.yaml"},
|
#{url: "https://github.com/tektoncd/catalog/raw/main/task/gitea-set-status/0.1/gitea-set-status.yaml", name: "gitea-set-status.yaml"},
|
||||||
#{url: "https://github.com/tektoncd/catalog/raw/main/task/hadolint/0.1/hadolint.yaml", name: "hadolint.yaml"},
|
#{url: "https://github.com/tektoncd/catalog/raw/main/task/hadolint/0.1/hadolint.yaml", name: "hadolint.yaml"},
|
||||||
#{url: "https://github.com/tektoncd/catalog/raw/main/task/hugo/0.1/hugo.yaml", name: "hugo.yaml"},
|
#{url: "https://github.com/tektoncd/catalog/raw/main/task/hugo/0.1/hugo.yaml", name: "hugo.yaml"},
|
||||||
|
|||||||
@@ -118,17 +118,17 @@ spec:
|
|||||||
workspace: source
|
workspace: source
|
||||||
- name: ssh-directory
|
- name: ssh-directory
|
||||||
workspace: ssh
|
workspace: ssh
|
||||||
- name: git-version
|
- name: generate-build-id
|
||||||
runAfter: [git-clone]
|
runAfter: [git-clone]
|
||||||
params:
|
params:
|
||||||
- name: branch
|
- name: branch
|
||||||
value: $(params.branch-name)
|
value: $(params.branch-name)
|
||||||
taskRef:
|
taskRef:
|
||||||
name: git-version
|
name: generate-build-id
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
- name: detect-stages
|
- name: detect-stages
|
||||||
runAfter: [git-version]
|
runAfter: [generate-build-id]
|
||||||
params:
|
params:
|
||||||
- name: pipeline-type
|
- name: pipeline-type
|
||||||
value: push
|
value: push
|
||||||
@@ -139,7 +139,7 @@ spec:
|
|||||||
- name: project-path
|
- name: project-path
|
||||||
value: $(params.project-path)
|
value: $(params.project-path)
|
||||||
- name: image-version
|
- name: image-version
|
||||||
value: "$(params.branch-name)-$(tasks.git-version.results.packageVersion)"
|
value: "$(tasks.generate-build-id.results.build-id)"
|
||||||
taskRef:
|
taskRef:
|
||||||
name: auto-ci-detector
|
name: auto-ci-detector
|
||||||
workspaces:
|
workspaces:
|
||||||
|
|||||||
@@ -16,27 +16,40 @@ spec:
|
|||||||
the base-version to the current timestamp.
|
the base-version to the current timestamp.
|
||||||
|
|
||||||
params:
|
params:
|
||||||
- name: base-version
|
- name: toolbox-image
|
||||||
description: Base product version
|
default: sebt3/basic-toolbox-image:1.29.4
|
||||||
|
description: The name of the toolbox image
|
||||||
|
type: string
|
||||||
|
- name: branch
|
||||||
type: string
|
type: string
|
||||||
default: "1.0"
|
|
||||||
results:
|
results:
|
||||||
- name: timestamp
|
- name: timestamp
|
||||||
description: Current timestamp
|
description: Current timestamp
|
||||||
|
- name: commitcount
|
||||||
|
description: Current commitcount
|
||||||
- name: build-id
|
- name: build-id
|
||||||
description: ID of the current build
|
description: Current commitcount
|
||||||
steps:
|
steps:
|
||||||
- name: get-timestamp
|
- name: get-timestamp
|
||||||
image: docker.io/library/bash:5.0.18@sha256:879f94a9da53dc064779e7a68339aecd60a9028ff884cacaa47ae752ca690404 #tag: 5.0.18
|
image: $(params.toolbox-image)
|
||||||
script: |
|
script: |
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
ts=`date "+%Y%m%d-%H%M%S"`
|
ts=`date "+%Y%m%d-%H%M%S"`
|
||||||
echo "Current Timestamp: ${ts}"
|
echo -n "Current Timestamp: "
|
||||||
echo ${ts} | tr -d "\n" | tee $(results.timestamp.path)
|
echo -n ${ts} | tee $(results.timestamp.path)
|
||||||
- name: get-buildid
|
- name: get-commitcount
|
||||||
image: docker.io/library/bash:5.0.18@sha256:879f94a9da53dc064779e7a68339aecd60a9028ff884cacaa47ae752ca690404 #tag: 5.0.18
|
image: $(params.toolbox-image)
|
||||||
script: |
|
script: |
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
ts=`cat $(results.timestamp.path)`
|
cc=`git rev-list --count HEAD`
|
||||||
buildId=$(inputs.params.base-version)-${ts}
|
echo -n "Commit Count: "
|
||||||
echo ${buildId} | tr -d "\n" | tee $(results.build-id.path)
|
echo -n ${cc} | tee $(results.commitcount.path)
|
||||||
|
- name: get-build-id
|
||||||
|
image: $(params.toolbox-image)
|
||||||
|
script: |
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
ts=`cat $(results.timestamp.path)|sed 's/-/./`
|
||||||
|
cc=`cat $(results.commitcount.path)`
|
||||||
|
buildId="$(params.branch)-${cc}.${ts}"
|
||||||
|
echo -n "Build ID: "
|
||||||
|
echo -n ${buildId} | tee $(results.build-id.path)
|
||||||
@@ -243,15 +243,6 @@ spec:
|
|||||||
git remote add origin "${PARAM_URL}"
|
git remote add origin "${PARAM_URL}"
|
||||||
git fetch "--recurse-submodules=${PARAM_SUBMODULES}" $FETCH_CMD origin --update-head-ok --force
|
git fetch "--recurse-submodules=${PARAM_SUBMODULES}" $FETCH_CMD origin --update-head-ok --force
|
||||||
git reset --hard "${PARAM_REVISION}"
|
git reset --hard "${PARAM_REVISION}"
|
||||||
#/ko-app/git-init \
|
|
||||||
# -url="${PARAM_URL}" \
|
|
||||||
# -revision="${PARAM_REVISION}" \
|
|
||||||
# -refspec="${PARAM_REFSPEC}" \
|
|
||||||
# -path="${CHECKOUT_DIR}" \
|
|
||||||
# -sslVerify="${PARAM_SSL_VERIFY}" \
|
|
||||||
# -submodules="${PARAM_SUBMODULES}" \
|
|
||||||
# -depth="${PARAM_DEPTH}" \
|
|
||||||
# -sparseCheckoutDirectories="${PARAM_SPARSE_CHECKOUT_DIRECTORIES}"
|
|
||||||
cd "${CHECKOUT_DIR}"
|
cd "${CHECKOUT_DIR}"
|
||||||
RESULT_SHA="$(git rev-parse HEAD)"
|
RESULT_SHA="$(git rev-parse HEAD)"
|
||||||
EXIT_CODE="$?"
|
EXIT_CODE="$?"
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ data:
|
|||||||
imageRepositoryRef:
|
imageRepositoryRef:
|
||||||
name: ${PROJECT_NAME}-repo
|
name: ${PROJECT_NAME}-repo
|
||||||
filterTags:
|
filterTags:
|
||||||
pattern: '^v(?P<semver>.*)$'
|
pattern: '^v(?P<semver>(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
|
||||||
extract: '$semver'
|
extract: '$semver'
|
||||||
policy:
|
policy:
|
||||||
semver:
|
semver:
|
||||||
@@ -256,7 +256,7 @@ data:
|
|||||||
imageRepositoryRef:
|
imageRepositoryRef:
|
||||||
name: ${PROJECT_NAME}-repo
|
name: ${PROJECT_NAME}-repo
|
||||||
filterTags:
|
filterTags:
|
||||||
pattern: '^main-(?P<semver>.*)$'
|
pattern: '^main-(?P<semver>(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
|
||||||
extract: '$semver'
|
extract: '$semver'
|
||||||
policy:
|
policy:
|
||||||
semver:
|
semver:
|
||||||
|
|||||||
Reference in New Issue
Block a user