Update the Ci/CD pipline to publish AMQ as library
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
# This pipeline would run the test coverage report to satisfy Coverage-Check rule.
|
# This pipeline would run the test coverage report to satisfy Coverage-Check rule.
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
|
- build
|
||||||
|
- publish
|
||||||
|
|
||||||
|
variables:
|
||||||
|
PROJECT_ID: 217
|
||||||
|
|
||||||
# Define a cache for pip dependencies to speed up builds
|
# Define a cache for pip dependencies to speed up builds
|
||||||
cache:
|
cache:
|
||||||
@@ -30,3 +35,31 @@ test:
|
|||||||
coverage: '/^TOTAL.*\s+(\d+%)$/' # Regex to extract coverage percentage from the report
|
coverage: '/^TOTAL.*\s+(\d+%)$/' # Regex to extract coverage percentage from the report
|
||||||
#rules:
|
#rules:
|
||||||
# - if: $CI_COMMIT_BRANCH == "develop" # Run this job only on the 'develop' branch
|
# - if: $CI_COMMIT_BRANCH == "develop" # Run this job only on the 'develop' branch
|
||||||
|
|
||||||
|
# Build the package
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
image: python:3.11
|
||||||
|
before_script:
|
||||||
|
- pip install --upgrade pip
|
||||||
|
- pip install setuptools wheel
|
||||||
|
script:
|
||||||
|
- python setup.py sdist bdist_wheel
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- dist/
|
||||||
|
|
||||||
|
# Publish the package to PyPI
|
||||||
|
publish:
|
||||||
|
stage: publish
|
||||||
|
image: python:3.11
|
||||||
|
before_script:
|
||||||
|
- pip install --upgrade pip
|
||||||
|
- pip install twine
|
||||||
|
script:
|
||||||
|
# - twine upload --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD dist/*
|
||||||
|
- twine upload --repository-url https://git.cleverthis.com/api/v4/projects/$PROJECT_ID/packages/pypi --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD dist/*
|
||||||
|
only:
|
||||||
|
- main # Only publish from the main branch
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="amqp",
|
||||||
|
version="0.2.0",
|
||||||
|
author="Stanislav Hejny",
|
||||||
|
author_email="stanislav.hejny@cleverthis.com",
|
||||||
|
description="Adapter for RabbitMQ to integrate a CleverThis python-code Service with CleverMicro platform",
|
||||||
|
long_description=open("README.md").read(),
|
||||||
|
long_description_content_type="text/markdown",
|
||||||
|
url="https://git.cleverthis.com/cleverthis/clevermicro/amq-adapter-python",
|
||||||
|
packages=find_packages(),
|
||||||
|
install_requires=[
|
||||||
|
# dependencies here
|
||||||
|
"aiohttp~=3.11.11",
|
||||||
|
"fastapi==0.115.6",
|
||||||
|
"pika~=1.3.2",
|
||||||
|
"opentelemetry-api",
|
||||||
|
"opentelemetry-sdk",
|
||||||
|
"opentelemetry-exporter-otlp",
|
||||||
|
"opentelemetry-exporter-prometheus",
|
||||||
|
"opentelemetry-instrumentation-pika"
|
||||||
|
],
|
||||||
|
classifiers=[
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
|
],
|
||||||
|
python_requires=">=3.11",
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user