Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update rpm default versioning #340

Merged
merged 1 commit into from
Oct 16, 2024
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
4 changes: 2 additions & 2 deletions charts/common-library/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: A Helm chart library with common components for KubeRocketCI Tekton
home: https://docs.kuberocketci.io
name: edp-tekton-common-library
type: library
version: 0.3.5
appVersion: 0.3.5
version: 0.3.6
appVersion: 0.3.6
icon: https://docs.kuberocketci.io/img/logo.svg
keywords:
- edp
Expand Down
2 changes: 1 addition & 1 deletion charts/common-library/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# edp-tekton-common-library

![Version: 0.3.5](https://img.shields.io/badge/Version-0.3.5-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.3.5](https://img.shields.io/badge/AppVersion-0.3.5-informational?style=flat-square)
![Version: 0.3.6](https://img.shields.io/badge/Version-0.3.6-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.3.6](https://img.shields.io/badge/AppVersion-0.3.6-informational?style=flat-square)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/epmdedp)](https://artifacthub.io/packages/search?repo=epmdedp)

A Helm chart library with common components for KubeRocketCI Tekton Pipelines
Expand Down
3 changes: 1 addition & 2 deletions charts/common-library/templates/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,8 @@
- name: CBIS_NAME
value: $(tasks.init-values.results.RESULT_IMAGE_NAME)
- name: IMAGE_TAG
value: $(tasks.get-version.results.IS_TAG)
value: "$(tasks.get-version.results.IS_TAG)"
{{- end -}}

# final section for gerrit codereview pipelines
{{- define "gerrit-review-vote" -}}
finally:
Expand Down
6 changes: 3 additions & 3 deletions charts/pipelines-library/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: edp-tekton-common-library
repository: file://../common-library
version: 0.3.5
version: 0.3.6
- name: tekton-cache
repository: https://epam.github.io/edp-helm-charts/stable
version: 0.3.2
digest: sha256:bd87e325017748e96d3efa7b95a78c299e9ddc483975548626015860cffecc70
generated: "2024-10-03T17:38:15.533831+03:00"
digest: sha256:bd44514da4c8bb7d5450905c8573ef13280f79bd195a37afa2e910e357e6753e
generated: "2024-10-14T19:28:03.095977+03:00"
2 changes: 1 addition & 1 deletion charts/pipelines-library/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ annotations:
# we use templates from common library
dependencies:
- name: edp-tekton-common-library
version: 0.3.5
version: 0.3.6
repository: "file://../common-library"
- name: tekton-cache
version: 0.3.2
Expand Down
2 changes: 1 addition & 1 deletion charts/pipelines-library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Follows [Tekton Interceptor](https://tekton.dev/vault/triggers-main/clusterinter
| Repository | Name | Version |
|------------|------|---------|
| @epamedp | tekton-cache | 0.3.2 |
| file://../common-library | edp-tekton-common-library | 0.3.5 |
| file://../common-library | edp-tekton-common-library | 0.3.6 |

## Values

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,18 @@ spec:
- name: get-version
taskRef:
kind: Task
name: get-version-default
name: get-version-rpm
runAfter:
- init-values
params:
- name: BRANCH_NAME
value: $(params.git-source-revision)
- name: BASE_IMAGE
value: $(params.image)
workspaces:
- name: source
subPath: source
workspace: shared-workspace

{{- include "get-cache" $ | nindent 4 }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,18 @@ spec:
- name: get-version
taskRef:
kind: Task
name: get-version-default
name: get-version-rpm
runAfter:
- init-values
params:
- name: BRANCH_NAME
value: $(params.git-source-revision)
- name: BASE_IMAGE
value: $(params.image)
workspaces:
- name: source
subPath: source
workspace: shared-workspace

{{- include "get-cache" $ | nindent 4 }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ spec:
- name: get-version
taskRef:
kind: Task
name: get-version-default
name: get-version-rpm
runAfter:
- init-values
params:
- name: BRANCH_NAME
value: $(params.git-source-revision)
- name: BASE_IMAGE
value: $(params.image)
workspaces:
- name: source
subPath: source
workspace: shared-workspace

{{- include "get-cache" $ | nindent 4 }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,19 @@ spec:
- name: get-version
taskRef:
kind: Task
name: get-version-default
name: get-version-rpm
runAfter:
- init-values
params:
- name: BRANCH_NAME
value: $(params.git-source-revision)
- name: BASE_IMAGE
value: $(params.image)
workspaces:
- name: source
subPath: source
workspace: shared-workspace


{{- include "get-cache" $ | nindent 4 }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
"-i", inventory_path,
ansible_group,
"-m", "yum",
"-a", f"name={codebase} state=present allow_downgrade=true",
"-a", f"name={codebase}-{image_tag} state=present allow_downgrade=true",
"-b",
"--become"
]
Expand Down
3 changes: 0 additions & 3 deletions charts/pipelines-library/templates/tasks/edp-rpm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ spec:
type: string
description: Current build version of application
default: "1"
- name: CACHE_DIR
default: "/workspace/source/cache"
description: The path to the cache directory.
- name: EXTRA_LINT_COMMAND
type: string
description: Run rpm lint command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ spec:
printf "%s" "${VCS_TAG}" > "$(results.VCS_TAG.path)"
printf "%s" "${IS_TAG}" > "$(results.IS_TAG.path)"
printf "%s" "${BUILD_ID}" > "$(results.VERSION.path)"
printf "%s" "${NORMALIZED_VERSION}" > "$(results.NORMALIZED_VERSION.path)"
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: get-version-rpm
spec:
description: |
This task generates a version number for the application based on the current timestamp and the branch name.
The version number is used to tag the image and the codebase image stream.
workspaces:
- description: A workspace that contains fetched git repo.
name: source
results:
- name: VERSION
description: "Application version"
- name: VCS_TAG
description: "VCS tag"
- name: IS_TAG
description: "CodebaseImageStream tag"
- name: TIMESTAMP
description: Current timestamp
- name: NORMALIZED_VERSION
description: Normalized version
steps:
- name: get-timestamp
image: alpine:3.18.9
script: |
ts=$(date "+%Y%m%d-%H%M%S")
nts=$(date "+%Y%m%d.%H%M%S")
echo "Current Timestamp: ${ts}"
echo "Current Normalized Timestamp: ${nts}"
echo ${ts} | tr -d "\n" | tee $(results.TIMESTAMP.path)
echo ${nts} | tr -d "\n" | tee $(results.NORMALIZED_VERSION.path)

- name: get-version
image: alpine/make:4.2.1
workingDir: $(workspaces.source.path)
script: |
set -e

VERSION=$(make version)
NORMALIZED_VERSION="$(cat $(results.NORMALIZED_VERSION.path))"
VCS_TAG="${VERSION}-${NORMALIZED_VERSION}"
IS_TAG="${VCS_TAG}"

echo "VCS tag - ${VCS_TAG}"
echo "IS tag - ${IS_TAG}"
echo "Normalized Version - ${NORMALIZED_VERSION}"

printf "%s" "${VERSION}" > "$(results.VERSION.path)"
printf "%s" "${VCS_TAG}" > "$(results.VCS_TAG.path)"
printf "%s" "${IS_TAG}" > "$(results.IS_TAG.path)"
Loading