Skip to content

Commit

Permalink
Merge pull request #38 from aiyengar2/v0.2.0
Browse files Browse the repository at this point in the history
Changes for v0.2.0
  • Loading branch information
aiyengar2 authored May 17, 2021
2 parents 0ed3001 + 19c96f7 commit cae97e4
Show file tree
Hide file tree
Showing 43 changed files with 485 additions and 1,143 deletions.
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://raw.githubusercontent.com/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

0 comments on commit cae97e4

Please sign in to comment.