Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .tekton/kartograph-agent-runtime-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,9 @@ spec:
value: $(params.git-url)
workspaces:
- name: basic-auth
workspace: git-auth
workspace: hp-fleet-gitops-auth
- name: netrc
workspace: netrc
workspace: hp-fleet-gitops-auth
taskSpec:
params:
- name: COMMIT_SHA
Expand Down Expand Up @@ -657,6 +657,12 @@ spec:
export HOME=/tekton/home
mkdir -p "$HOME"

if [ ! -f "${WORKSPACE_BASIC_AUTH_PATH}/.git-credentials" ] && [ ! -f "${WORKSPACE_NETRC_PATH}/.netrc" ]; then
echo "ERROR: Secret kartograph-hp-fleet-gitops-auth is missing or empty."
echo "Apply .tekton/kartograph-hp-fleet-gitops-auth.secret.example.yaml in kartograph-tenant."
exit 1
fi

if [ -f "${WORKSPACE_NETRC_PATH}/.netrc" ]; then
cp "${WORKSPACE_NETRC_PATH}/.netrc" "$HOME/.netrc"
chmod 600 "$HOME/.netrc"
Expand Down Expand Up @@ -685,7 +691,7 @@ spec:

PATCH_FILE="apps/kartograph/overlays/stage/configmap-patch.yaml"
if [ -f "$PATCH_FILE" ]; then
sed -i 's|\(KARTOGRAPH_EXTRACTION_RUNTIME_STICKY_IMAGE:.*kartograph-agent-runtime:\)[^"]*|\1'"${COMMIT_SHA}"'"|' "$PATCH_FILE"
sed -i 's|\(KARTOGRAPH_EXTRACTION_RUNTIME_STICKY_IMAGE:.*kartograph-agent-runtime:\)[^"]*|\1'"${COMMIT_SHA}"'|' "$PATCH_FILE"
fi

git config user.email "konflux@kartograph.openshift.com"
Expand Down Expand Up @@ -777,4 +783,7 @@ spec:
- name: git-auth
secret:
secretName: "{{ git_auth_secret }}"
- name: hp-fleet-gitops-auth
secret:
secretName: kartograph-hp-fleet-gitops-auth
status: {}
13 changes: 11 additions & 2 deletions .tekton/kartograph-api-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,9 @@ spec:
value: $(params.git-url)
workspaces:
- name: basic-auth
workspace: git-auth
workspace: hp-fleet-gitops-auth
- name: netrc
workspace: netrc
workspace: hp-fleet-gitops-auth
taskSpec:
params:
- name: COMMIT_SHA
Expand Down Expand Up @@ -657,6 +657,12 @@ spec:
export HOME=/tekton/home
mkdir -p "$HOME"

if [ ! -f "${WORKSPACE_BASIC_AUTH_PATH}/.git-credentials" ] && [ ! -f "${WORKSPACE_NETRC_PATH}/.netrc" ]; then
echo "ERROR: Secret kartograph-hp-fleet-gitops-auth is missing or empty."
echo "Apply .tekton/kartograph-hp-fleet-gitops-auth.secret.example.yaml in kartograph-tenant."
exit 1
fi

if [ -f "${WORKSPACE_NETRC_PATH}/.netrc" ]; then
cp "${WORKSPACE_NETRC_PATH}/.netrc" "$HOME/.netrc"
chmod 600 "$HOME/.netrc"
Expand Down Expand Up @@ -769,4 +775,7 @@ spec:
- name: git-auth
secret:
secretName: "{{ git_auth_secret }}"
- name: hp-fleet-gitops-auth
secret:
secretName: kartograph-hp-fleet-gitops-auth
status: {}
13 changes: 11 additions & 2 deletions .tekton/kartograph-dev-ui-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,9 @@ spec:
value: $(params.git-url)
workspaces:
- name: basic-auth
workspace: git-auth
workspace: hp-fleet-gitops-auth
- name: netrc
workspace: netrc
workspace: hp-fleet-gitops-auth
taskSpec:
params:
- name: COMMIT_SHA
Expand Down Expand Up @@ -657,6 +657,12 @@ spec:
export HOME=/tekton/home
mkdir -p "$HOME"

if [ ! -f "${WORKSPACE_BASIC_AUTH_PATH}/.git-credentials" ] && [ ! -f "${WORKSPACE_NETRC_PATH}/.netrc" ]; then
echo "ERROR: Secret kartograph-hp-fleet-gitops-auth is missing or empty."
echo "Apply .tekton/kartograph-hp-fleet-gitops-auth.secret.example.yaml in kartograph-tenant."
exit 1
fi

if [ -f "${WORKSPACE_NETRC_PATH}/.netrc" ]; then
cp "${WORKSPACE_NETRC_PATH}/.netrc" "$HOME/.netrc"
chmod 600 "$HOME/.netrc"
Expand Down Expand Up @@ -769,4 +775,7 @@ spec:
- name: git-auth
secret:
secretName: "{{ git_auth_secret }}"
- name: hp-fleet-gitops-auth
secret:
secretName: kartograph-hp-fleet-gitops-auth
status: {}
23 changes: 23 additions & 0 deletions .tekton/kartograph-hp-fleet-gitops-auth.secret.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Apply in Konflux tenant namespace (kartograph-tenant) after replacing placeholders.
#
# PAT needs repo + pull_request scope on openshift-online/hp-fleet-gitops.
# Do not commit real tokens.
#
# oc project kartograph-tenant
# oc create -f kartograph-hp-fleet-gitops-auth.secret.yaml
#
apiVersion: v1
kind: Secret
metadata:
name: kartograph-hp-fleet-gitops-auth
namespace: kartograph-tenant
type: Opaque
stringData:
.gitconfig: |
[credential]
helper = store
.git-credentials: https://x-access-token:REPLACE_WITH_GITHUB_PAT@github.com
.netrc: |
machine github.com
login x-access-token
password REPLACE_WITH_GITHUB_PAT
13 changes: 11 additions & 2 deletions .tekton/kartograph-openshell-gateway-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,9 @@ spec:
value: $(params.git-url)
workspaces:
- name: basic-auth
workspace: git-auth
workspace: hp-fleet-gitops-auth
- name: netrc
workspace: netrc
workspace: hp-fleet-gitops-auth
taskSpec:
params:
- name: COMMIT_SHA
Expand Down Expand Up @@ -657,6 +657,12 @@ spec:
export HOME=/tekton/home
mkdir -p "$HOME"

if [ ! -f "${WORKSPACE_BASIC_AUTH_PATH}/.git-credentials" ] && [ ! -f "${WORKSPACE_NETRC_PATH}/.netrc" ]; then
echo "ERROR: Secret kartograph-hp-fleet-gitops-auth is missing or empty."
echo "Apply .tekton/kartograph-hp-fleet-gitops-auth.secret.example.yaml in kartograph-tenant."
exit 1
fi

if [ -f "${WORKSPACE_NETRC_PATH}/.netrc" ]; then
cp "${WORKSPACE_NETRC_PATH}/.netrc" "$HOME/.netrc"
chmod 600 "$HOME/.netrc"
Expand Down Expand Up @@ -769,4 +775,7 @@ spec:
- name: git-auth
secret:
secretName: "{{ git_auth_secret }}"
- name: hp-fleet-gitops-auth
secret:
secretName: kartograph-hp-fleet-gitops-auth
status: {}
Loading