-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcd.sh
More file actions
46 lines (40 loc) · 1.35 KB
/
cd.sh
File metadata and controls
46 lines (40 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
###############################################################################
# cd.sh
#
# Continuous Delivery/Deployment (CD) Script:
#
# This script performs the following task:
# 1) Runs pypi-release.sh to upload the generated SDK artifacts to PyPI.
#
# Note:
# - This CD script does not pull the Git repository; it assumes that the
# artifacts (the generated SDKs) produced during the CI phase are available.
#
# Requirements:
# - Bash 4 or higher
# - Python, pip and twine installed
# - The generated SDK artifacts present in the working directory
#
# Environment Variables:
# - PYPI_API_TOKEN: A PyPI or TestPyPI API token stored securely in your CI/CD
# environment (e.g., Bamboo). This is required for Twine to authenticate uploads.
#
# Usage:
# bash cd.sh
#
###############################################################################
# Exit immediately if a command fails
set -e
# Function to display error messages
error() {
echo "Error: $1" >&2
exit 1
}
echo "=== CD Process Initiated ==="
###############################################################################
# 1. Perform PyPI Release
###############################################################################
echo "--- Running pypi-release.sh ---"
source pypi-release.sh || error "PyPI release process failed."
echo "=== CD Process Completed Successfully ==="