charts/pipelines-library/templates/pipelines/python/flask/gerrit-build-edp.yaml [63:170]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - name: get-version
      taskRef:
        kind: Task
        name: get-version-edp
      runAfter:
        - init-values
      params:
        - name: CODEBASEBRANCH_NAME
          value: $(params.CODEBASEBRANCH_NAME)

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

    - name: update-build-number
      taskRef:
        kind: Task
        name: update-build-number-python
      runAfter:
        - get-version
      params:
        - name: VERSION
          value: $(tasks.get-version.results.VERSION)
      workspaces:
        - name: source
          workspace: shared-workspace
          subPath: source

{{ include "security"  $ | nindent 4 }}

    - name: build
      taskRef:
        kind: Task
        name: python
      runAfter:
        - get-cache
        - update-build-number
      params:
        - name: EXTRA_COMMANDS
          value: |
            # we checkout the source code in the /source directory
            # and hold cache in the /cache directory

            # build
            python setup.py clean build sdist bdist_wheel

            # lint
            pip3 install -r test-requirements.txt
            pylint --output-format=colorized *.py
            flake8 --exclude .local --filename=*.py
            # test
            pytest -sv --color=yes
      workspaces:
        - name: source
          workspace: shared-workspace

    - name: sonar
      taskRef:
        kind: Task
        name: sonarqube-general
      runAfter:
        - build
      params:
        - name: SONAR_PROJECT_KEY
          value: $(params.CODEBASE_NAME)
        - name: SONAR_PROJECT_NAME
          value: $(params.CODEBASE_NAME)
        - name: branch
          value: $(params.git-source-revision)
      workspaces:
        - name: source
          workspace: shared-workspace
          subPath: source

    - name: push
      taskRef:
        kind: Task
        name: python
      runAfter:
        - sonar
      params:
        - name: EXTRA_COMMANDS
          value: |
            pip3 install -r test-requirements.txt
            python setup.py sdist

            # Get package version from the get-version task
            versionLowerCase=$(echo $(tasks.get-version.results.VERSION) | tr '[:upper:]' '[:lower:]')

            # # Define a repository for publishing the package
            if echo "$versionLowerCase" | grep -q "snapshot"; then
                TWINE_REPOSITORY_URL="${REPOSITORY_URL_SNAPSHOTS}"
            else
                TWINE_REPOSITORY_URL="${REPOSITORY_URL_RELEASES}"
            fi

            echo "[TEKTON][INFO] TWINE_REPOSITORY_URL contains ${TWINE_REPOSITORY_URL}"

            twine upload dist/*
      workspaces:
        - name: source
          workspace: shared-workspace

{{- include "build-pipeline-python-image-build-push-common"  $ | nindent 4 }}

{{- include "save-cache-pyhton" $ | nindent 4 }}

{{ include "build-pipeline-end"  $ | nindent 4 }}

{{ include "finally-block-edp"  $ | nindent 2 }}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



charts/pipelines-library/templates/pipelines/python/flask/gitlab-build-edp.yaml [66:173]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - name: get-version
      taskRef:
        kind: Task
        name: get-version-edp
      runAfter:
        - init-values
      params:
        - name: CODEBASEBRANCH_NAME
          value: $(params.CODEBASEBRANCH_NAME)

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

    - name: update-build-number
      taskRef:
        kind: Task
        name: update-build-number-python
      runAfter:
        - get-version
      params:
        - name: VERSION
          value: $(tasks.get-version.results.VERSION)
      workspaces:
        - name: source
          workspace: shared-workspace
          subPath: source

{{ include "security" $ | nindent 4 }}

    - name: build
      taskRef:
        kind: Task
        name: python
      runAfter:
        - get-cache
        - update-build-number
      params:
        - name: EXTRA_COMMANDS
          value: |
            # we checkout the source code in the /source directory
            # and hold cache in the /cache directory

            # build
            python setup.py clean build sdist bdist_wheel

            # lint
            pip3 install -r test-requirements.txt
            pylint --output-format=colorized *.py
            flake8 --exclude .local --filename=*.py
            # test
            pytest -sv --color=yes
      workspaces:
        - name: source
          workspace: shared-workspace

    - name: sonar
      taskRef:
        kind: Task
        name: sonarqube-general
      runAfter:
        - build
      params:
        - name: SONAR_PROJECT_KEY
          value: $(params.CODEBASE_NAME)
        - name: SONAR_PROJECT_NAME
          value: $(params.CODEBASE_NAME)
        - name: branch
          value: $(params.git-source-revision)
      workspaces:
        - name: source
          workspace: shared-workspace
          subPath: source

    - name: push
      taskRef:
        kind: Task
        name: python
      runAfter:
        - sonar
      params:
        - name: EXTRA_COMMANDS
          value: |
            pip3 install -r test-requirements.txt
            python setup.py sdist

            # Get package version from the get-version task
            versionLowerCase=$(echo $(tasks.get-version.results.VERSION) | tr '[:upper:]' '[:lower:]')

            # # Define a repository for publishing the package
            if echo "$versionLowerCase" | grep -q "snapshot"; then
                TWINE_REPOSITORY_URL="${REPOSITORY_URL_SNAPSHOTS}"
            else
                TWINE_REPOSITORY_URL="${REPOSITORY_URL_RELEASES}"
            fi

            echo "[TEKTON][INFO] TWINE_REPOSITORY_URL contains ${TWINE_REPOSITORY_URL}"

            twine upload dist/*
      workspaces:
        - name: source
          workspace: shared-workspace

{{- include "build-pipeline-python-image-build-push-common" $ | nindent 4 }}

{{- include "save-cache-pyhton" $ | nindent 4 }}

{{ include "build-pipeline-end" $ | nindent 4 }}

{{ include "finally-block-edp" $ | nindent 2 }}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



