This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip ci] Add rendered and modified Helm chart
- Loading branch information
1 parent
4ff277e
commit 5d440a6
Showing
1 changed file
with
97 additions
and
0 deletions.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
stakater-push-main-tag/rendered/stakater-push-main-tag-0.0.10.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
# Source: stakater-push-main-tag/templates/clustertask.yaml | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: stakater-push-main-tag-0.0.10 | ||
annotations: | ||
description: | | ||
Push Tag in case of main branch | ||
spec: | ||
params: | ||
- description: Reference of the image tag | ||
name: IMAGE_TAG | ||
type: string | ||
- default: NA | ||
description: >- | ||
In case of PR, PR number that is to be used in image tag. If this field | ||
is empty it means that it's a commit on main branch | ||
name: PR_NUMBER | ||
type: string | ||
- description: The git revision | ||
name: GIT_REVISION | ||
type: string | ||
steps: | ||
- args: | ||
- '-c' | ||
- | | ||
if [ $(params.PR_NUMBER) == "NA" ]; then | ||
if [ "${WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND}" = "true" ] ; then | ||
cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.git-credentials" ~/.git-credentials | ||
cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.gitconfig" ~/.gitconfig | ||
chmod 400 ~/.git-credentials | ||
chmod 400 ~/.gitconfig | ||
remote_url=$(git config --get remote.origin.url) | ||
if [[ $remote_url == git@* ]]; then | ||
username_repo="${remote_url#*:}" | ||
echo ${username_repo} | ||
username_repo="${username_repo%.git}" | ||
https_url="https://github.com/$username_repo.git" | ||
echo "Converted HTTPS URL: $https_url" | ||
git remote set-url --push origin "$https_url" | ||
else | ||
echo "Remote URL is not in SSH format: $remote_url" | ||
fi | ||
else | ||
if [ "${WORKSPACE_SSH_DIRECTORY_BOUND}" = "true" ] ; then | ||
git config --global user.name tekton-bot | ||
git config --global user.email [email protected] | ||
mkdir ~/.ssh | ||
ls -a ~/ | ||
> ~/.ssh/id_rsa | ||
> ~/.ssh/known_hosts | ||
ls -a ~/.ssh | ||
cat "${WORKSPACE_SSH_DIRECTORY_PATH}"/id_rsa >> ~/.ssh/id_rsa | ||
eval `ssh-agent -s` | ||
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts | ||
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-add ~/.ssh/id_rsa | ||
fi | ||
fi | ||
git tag -am "Bump version to $(params.IMAGE_TAG)" $(params.IMAGE_TAG) | ||
git push --tags | ||
git remote set-url --push origin "$remote_url" | ||
fi | ||
command: | ||
- /bin/bash | ||
env: | ||
- name: WORKSPACE_SSH_DIRECTORY_BOUND | ||
value: $(workspaces.ssh-directory.bound) | ||
- name: WORKSPACE_SSH_DIRECTORY_PATH | ||
value: $(workspaces.ssh-directory.path) | ||
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND | ||
value: $(workspaces.basic-auth.bound) | ||
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH | ||
value: $(workspaces.basic-auth.path) | ||
image: 'stakater/pipeline-toolbox:v0.0.36' | ||
name: push-main-tag | ||
resources: {} | ||
workingDir: $(workspaces.source.path) | ||
workspaces: | ||
- name: source | ||
- name: ssh-directory | ||
optional: true | ||
description: | | ||
A .ssh directory with private key, known_hosts, config, etc. Copied to | ||
the user's home before git commands are executed. Used to authenticate | ||
with the git remote when performing the clone. Binding a Secret to this | ||
Workspace is strongly recommended over other volume types. | ||
- name: basic-auth | ||
optional: true | ||
description: | | ||
A Workspace containing a .gitconfig and .git-credentials file. These | ||
will be copied to the user's home before any git commands are run. Any | ||
other files in this Workspace are ignored. It is strongly recommended | ||
to use ssh-directory over basic-auth whenever possible and to bind a | ||
Secret to this Workspace over other volume types. |