31
31
NEW_VERSION=$1
32
32
fi
33
33
34
- # Ensure AWS access before proceeding
35
- ddsaml2aws login -a govcloud-us1-fed-human-engineering
36
- AWS_PROFILE=govcloud-us1-fed-human-engineering aws sts get-caller-identity
37
- aws-vault exec sso-prod-engineering -- aws sts get-caller-identity
38
-
39
34
# Ensure pypi registry access
40
35
read -p " Do you have access to PyPI (y/n)?" CONT
41
36
if [ " $CONT " != " y" ]; then
@@ -52,11 +47,17 @@ if [ "$CONT" != "y" ]; then
52
47
exit 1
53
48
fi
54
49
55
- echo
56
- echo " Replacing version in pyproject.toml"
57
- echo
50
+ echo " Answer 'n' if already done in a PR"
51
+ read -p " Update pyproject.toml version? (y/n)?" CONT
52
+ if [ " $CONT " != " y" ]; then
53
+ echo " Skipping updating package.json version"
54
+ else
55
+ echo
56
+ echo " Replacing version in pyproject.toml"
57
+ echo
58
58
59
- poetry version ${NEW_VERSION}
59
+ poetry version ${NEW_VERSION}
60
+ fi
60
61
61
62
echo
62
63
echo " Building layers..."
66
67
echo " Signing layers for commercial AWS regions"
67
68
aws-vault exec sso-prod-engineering -- ./scripts/sign_layers.sh prod
68
69
69
- echo
70
- echo " Publishing layers to commercial AWS regions"
71
- VERSION=$LAYER_VERSION aws-vault exec sso-prod-engineering -- ./scripts/publish_layers.sh
70
+ echo " Answer 'n' if GitLab already did this"
71
+ read -p " Deploy layers to commercial AWS (y/n)?" CONT
72
+ if [ " $CONT " != " y" ]; then
73
+ echo " Skipping deployment to commercial AWS"
74
+ else
75
+ echo " Ensuring you have access to the production AWS account"
76
+ aws-vault exec sso-prod-engineering -- aws sts get-caller-identity
77
+
78
+ echo
79
+ echo " Publishing layers to commercial AWS regions"
80
+ VERSION=$LAYER_VERSION aws-vault exec sso-prod-engineering --no-session -- ./scripts/publish_layers.sh
81
+ fi
82
+ read -p " Deploy layers to GovCloud AWS (y/n)?" CONT
83
+ if [ " $CONT " != " y" ]; then
84
+ echo " Skipping deployment to GovCloud AWS"
85
+ else
86
+ echo " Ensuring you have access to the AWS GovCloud account"
87
+ ddsaml2aws login -a govcloud-us1-fed-human-engineering
88
+ AWS_PROFILE=govcloud-us1-fed-human-engineering aws sts get-caller-identity
72
89
73
- echo " Publishing layers to GovCloud AWS regions"
74
- ddsaml2aws login -a govcloud-us1-fed-human-engineering
75
- VERSION=$LAYER_VERSION AWS_PROFILE=govcloud-us1-fed-human-engineering ./scripts/publish_layers.sh
90
+ echo " Publishing layers to GovCloud AWS regions"
91
+ ddsaml2aws login -a govcloud-us1-fed-human-engineering
92
+ VERSION=$LAYER_VERSION AWS_PROFILE=govcloud-us1-fed-human-engineering ./scripts/publish_layers.sh
93
+ fi
76
94
95
+ echo " Answer 'n' if GitLab already did this"
77
96
read -p " Ready to publish $NEW_VERSION to PyPI (y/n)?" CONT
78
97
if [ " $CONT " != " y" ]; then
79
- echo " Exiting"
80
- exit 1
98
+ echo " Skipping publishing to PyPI"
99
+ else
100
+ echo
101
+ echo " Publishing to https://pypi.org/project/datadog-lambda/"
102
+ ./scripts/pypi.sh
81
103
fi
82
104
83
- echo
84
- echo " Publishing to https://pypi.org/project/datadog-lambda/"
85
- ./scripts/pypi.sh
86
105
87
- echo
88
- echo ' Publishing updates to github'
89
- git commit pyproject.toml -m " Bump version to ${NEW_VERSION} "
90
- git push origin main
91
- git tag " v$LAYER_VERSION "
92
- git push origin " refs/tags/v$LAYER_VERSION "
106
+ echo " Answer 'n' if you already released in GitHub"
107
+ read -p " Do you want to bump the version in GitHub? (y/n)" CONT
108
+ if [ " $CONT " != " y" ]; then
109
+ echo " Skipping publishing updates to GitHub"
110
+ else
111
+ echo
112
+ echo ' Publishing updates to github'
113
+ git commit pyproject.toml -m " Bump version to ${NEW_VERSION} "
114
+ git push origin main
115
+ git tag " v$LAYER_VERSION "
116
+ git push origin " refs/tags/v$LAYER_VERSION "
117
+ fi
93
118
94
119
echo
95
- echo " Now create a new release with the tag v${LAYER_VERSION} created"
120
+ echo " Now create a new release with the tag v${LAYER_VERSION} created unless you have done this already "
96
121
echo " https://github.com/DataDog/datadog-lambda-python/releases/new?tag=v$LAYER_VERSION &title=v$LAYER_VERSION "
97
122
# Open a PR to the documentation repo to automatically bump layer version
98
123
VERSION=$LAYER_VERSION LAYER=datadog-lambda-python ./scripts/create_documentation_pr.sh
0 commit comments