mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
69 lines
2.5 KiB
YAML
69 lines
2.5 KiB
YAML
## DEPLOYMENT STAGE - PYTHON SDK
|
|
staging_python-sdk:
|
|
stage: Deploy
|
|
allow_failure: true
|
|
retry: 2
|
|
script:
|
|
- sudo apt-get update
|
|
- sudo apt --fix-broken install -y
|
|
- sudo apt-get install -y curl gcc
|
|
- sudo apt-get install -y build-essential
|
|
- curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
|
- sudo apt-get install -y python3-pip
|
|
- cd python-sdk
|
|
- pip3 install -r requirements.txt
|
|
# - git init
|
|
# - git add .
|
|
# - git commit -m "staging commit version 3.0.$CI_PIPELINE_IID"
|
|
- bumpversion --new-version 3.0.$CI_PIPELINE_IID patch setup.py
|
|
- python3 setup.py sdist bdist_wheel
|
|
- twine check dist/*
|
|
- twine upload --repository-url https://test.pypi.org/legacy/ dist/* -u=$PyPi_USERNAME -p=$PyPi_PASSWORD
|
|
- git init
|
|
- git add .
|
|
- git commit -m "staging commit version 3.0.$CI_PIPELINE_IID"
|
|
- git checkout staging || git checkout -b staging
|
|
- git push https://$GITHUB_USERNAME:$GITHUB_PASSWORD@github.com/OneUptime/python-sdk.git staging --force
|
|
- cd ..
|
|
- chmod +x ./ci/scripts/cleanup.sh
|
|
- ./ci/scripts/cleanup.sh
|
|
only:
|
|
refs:
|
|
- master
|
|
- hotfix-master
|
|
environment:
|
|
name: staging
|
|
|
|
## DEPLOYMENT STAGE - PYTHON SDK
|
|
production_python-sdk:
|
|
stage: Deploy
|
|
allow_failure: true
|
|
retry: 2
|
|
script:
|
|
- sudo apt-get update
|
|
- sudo apt --fix-broken install -y
|
|
- sudo apt-get install -y curl gcc
|
|
- sudo apt-get install -y build-essential
|
|
- curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
|
- sudo apt-get install -y python3-pip
|
|
- cd python-sdk
|
|
- pip3 install -r requirements.txt
|
|
- bumpversion --new-version 3.0.$CI_PIPELINE_IID patch setup.py
|
|
- python3 setup.py sdist bdist_wheel
|
|
- twine check dist/*
|
|
- twine upload dist/* -u=$PyPi_USERNAME -p=$PyPi_PASSWORD
|
|
- git init
|
|
- git add .
|
|
- git commit -m "production commit version 3.0.$CI_PIPELINE_IID" || echo "Nothing to update because no changes to sdk was made" && exit 0
|
|
- git checkout -f master
|
|
- git push https://$GITHUB_USERNAME:$GITHUB_PASSWORD@github.com/OneUptime/python-sdk.git master --force
|
|
- cd ..
|
|
- chmod +x ./ci/scripts/cleanup.sh
|
|
- ./ci/scripts/cleanup.sh
|
|
only:
|
|
refs:
|
|
- release
|
|
- hotfix-release
|
|
environment:
|
|
name: staging
|