This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
138 changed files
with
16,858 additions
and
1,586 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,34 +24,32 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/develop' | ||
steps: | ||
- name: Validation | ||
- name: Git Setup | ||
run: | | ||
set -x | ||
export NEW_VERSION=${{ github.event.inputs.version }} | ||
# clone repo | ||
git clone https://github.com/GoogleCloudPlatform/cloud-ops-sandbox.git | ||
cd cloud-ops-sandbox | ||
git checkout develop | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "CI" | ||
# validate version number (format: v0.0.0) | ||
export NEW_VERSION=${{ github.event.inputs.version }} | ||
if [[ ! "${NEW_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "${NEW_VERSION} argument must conform to regex string: ^v[0-9]+\.[0-9]+\.[0-9]+$ " | ||
echo "ex. v1.0.1" | ||
exit 1 | ||
fi | ||
# ensure not duplicate | ||
if [[ "$NEW_VERSION" == $(git tag | grep $NEW_VERSION | cat) ]]; then | ||
if [[ ! -z $(git tag | grep $NEW_VERSION | cat) ]]; then | ||
echo "$NEW_VERSION" tag already exists in project | ||
exit 1 | ||
fi | ||
if [[ "$NEW_VERSION" == $(git branch | grep "release/$NEW_VERSION" | cat) ]]; then | ||
echo "$NEW_VERSION" branch already exists in project | ||
if [[ ! -z $(git branch -a | grep "release/$NEW_VERSION" | cat) ]]; then | ||
echo "release/$NEW_VERSION" branch already exists in project | ||
exit 1 | ||
fi | ||
- name: Git Setup | ||
run: | | ||
set -x | ||
git clone https://github.com/daniel-sanche/cloud-ops-sandbox.git | ||
cd cloud-ops-sandbox | ||
git checkout develop | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "CI" | ||
# create new release branch | ||
git fetch | ||
git checkout -b "release/${{ github.event.inputs.version }}" | ||
git merge --strategy-option theirs main | ||
|
@@ -76,28 +74,20 @@ jobs: | |
sed -i -e "s/cloudshell_git_branch=v\([0-9\.]\+\)/cloudshell_git_branch=${NEW_VERSION}/g" ${REPO_ROOT}/website/deploy/index.html; | ||
sed -i -e "s/productVersion': 'v\([0-9\.]\+\)/productVersion': '${NEW_VERSION}/g" ${REPO_ROOT}/website/deploy/index.html; | ||
sed -i -e "s/uncertified:v\([0-9\.]\+\)/uncertified:${NEW_VERSION}/g" ${REPO_ROOT}/website/deploy/index.html; | ||
sed -i -e "s/version = \"v\([0-9\.]\+\)\"/version = \"${NEW_VERSION}\"/g" ${REPO_ROOT}/website/config.toml; | ||
# update custom Cloud Shell image variable | ||
sed -i -e "s/VERSION=v\([0-9\.]\+\)/VERSION=${NEW_VERSION}/g" ${REPO_ROOT}/cloud-shell/Dockerfile; | ||
# update telemetry Pub/Sub topic in telemetry.py from "Test" topic to "Production" topic | ||
PROD_TOPIC="telemetry_prod" | ||
TEST_TOPIC="telemetry_test" | ||
sed -i -e "s/topic_id = \"${TEST_TOPIC}\"/topic_id = \"${PROD_TOPIC}\"/g" ${REPO_ROOT}/terraform/telemetry.py; | ||
- name: Push changes | ||
uses: ad-m/github-push-action@65392840bda2e774394d5cd38ca33e5918aec2d3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: "release/${{ github.event.inputs.version }}" | ||
directory: cloud-ops-sandbox | ||
tags: true | ||
- name: Build PR Body | ||
run: | | ||
cd cloud-ops-sandbox | ||
# find the changes commited to develop since last release | ||
PREV_HASH=$(git merge-base develop main) | ||
RECENT_HASH=$(git rev-parse develop) | ||
DIFF=$(git log ${PREV_HASH}...${RECENT_HASH} --oneline) | ||
echo -e $DIFF | ||
# print version number as title | ||
export NEW_VERSION=${{ github.event.inputs.version }} | ||
|
@@ -111,11 +101,11 @@ jobs: | |
regexes=$(echo $i | tr "/" "\n" | tail -n 1) | ||
# create grep statements for each regex | ||
grep_formatted_regex=$(echo "--grep ^$regexes" | awk -F'|' -v OFS=" --grep ^" '$1=$1') | ||
if [[ ! -z $(git log ${LAST_HASH}...${FIRST_HASH} $grep_formatted_regex) ]]; then | ||
if [[ ! -z $(git log ${PREV_HASH}...${RECENT_HASH} $grep_formatted_regex) ]]; then | ||
# print the category title | ||
echo "### $title" >> PR.txt | ||
# print the commits in the category | ||
git log ${LAST_HASH}...${FIRST_HASH} $grep_formatted_regex --oneline | cut -d " " -f2- | awk '{print "- " $0}' >> PR.txt | ||
git log ${PREV_HASH}...${RECENT_HASH} $grep_formatted_regex --oneline | cut -d " " -f2- | awk '{print "- " $0}' >> PR.txt | ||
echo "" >> PR.txt | ||
fi | ||
done | ||
|
@@ -125,6 +115,7 @@ jobs: | |
echo 'PULL_REQUEST_BODY<<EOF' >> $GITHUB_ENV | ||
cat PR.txt >> $GITHUB_ENV | ||
echo 'EOF' >> $GITHUB_ENV | ||
rm PR.txt | ||
- name: Commit Changes | ||
run: | | ||
set -x | ||
|
@@ -134,6 +125,13 @@ jobs: | |
git add . | ||
git commit -m "chore: update tags for release ${NEW_VERSION}" | ||
git tag "${NEW_VERSION}" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@65392840bda2e774394d5cd38ca33e5918aec2d3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: "release/${{ github.event.inputs.version }}" | ||
directory: cloud-ops-sandbox | ||
tags: true | ||
- name: Create Pull Request | ||
uses: vsoch/pull-request-action@29dbfc0acd2ac96b0ec14b9fd53fa12136130058 | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Contributor Code of Conduct | ||
|
||
As contributors and maintainers of this project, | ||
and in the interest of fostering an open and welcoming community, | ||
we pledge to respect all people who contribute through reporting issues, | ||
posting feature requests, updating documentation, | ||
submitting pull requests or patches, and other activities. | ||
|
||
We are committed to making participation in this project | ||
a harassment-free experience for everyone, | ||
regardless of level of experience, gender, gender identity and expression, | ||
sexual orientation, disability, personal appearance, | ||
body size, race, ethnicity, age, religion, or nationality. | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery | ||
* Personal attacks | ||
* Trolling or insulting/derogatory comments | ||
* Public or private harassment | ||
* Publishing other's private information, | ||
such as physical or electronic | ||
addresses, without explicit permission | ||
* Other unethical or unprofessional conduct. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct. | ||
By adopting this Code of Conduct, | ||
project maintainers commit themselves to fairly and consistently | ||
applying these principles to every aspect of managing this project. | ||
Project maintainers who do not follow or enforce the Code of Conduct | ||
may be permanently removed from the project team. | ||
|
||
This code of conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior | ||
may be reported by opening an issue | ||
or contacting one or more of the project maintainers. | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, | ||
available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Security Policy | ||
|
||
To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). | ||
|
||
The Google Security Team will respond within 5 working days of your report on g.co/vulnz. | ||
|
||
We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. |
Oops, something went wrong.