-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.sh
executable file
·24 lines (20 loc) · 1.32 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# This script replaces @willjschmitt's repository names, etc, with the attendees
# usernames and such throughout the repository to bootstrap a fork of the
# repository.
set -e
if [ -z "${GITHUB_USERNAME}" ]; then
>&2 echo "GITHUB_USERNAME must be set."
exit -1
fi
if [ -z "${DOCKERHUB_USERNAME}" ]; then
>&2 echo "DOCKERHUB_USERNAME must be set."
exit -1
fi
REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
>&2 echo "Updating files in repository in ${REPOSITORY_ROOT} to use ${GITHUB_USERNAME} as the GitHub username and ${DOCKERHUB_USERNAME} as the DockerHub username."
sed -i '' "s|willjschmitt/greeter-server|${DOCKERHUB_USERNAME}/greeter-server|g" "${REPOSITORY_ROOT}/.github/workflows/add-release-actions-workflow.patch"
sed -i '' "s|DOCKERHUB_USERNAME: willjschmitt|DOCKERHUB_USERNAME: ${DOCKERHUB_USERNAME}|g" "${REPOSITORY_ROOT}/.github/workflows/add-release-actions-workflow.patch"
sed -i '' "s|github.com/willjschmitt|github.com/${GITHUB_USERNAME}|g" "${REPOSITORY_ROOT}/config/greeter-service.applications.yaml"
sed -i '' "s|willjschmitt/greeter-server|${DOCKERHUB_USERNAME}/greeter-server|g" "${REPOSITORY_ROOT}/config/greeter-service-production/deployment.yaml"
sed -i '' "s|willjschmitt/greeter-server|${DOCKERHUB_USERNAME}/greeter-server|g" "${REPOSITORY_ROOT}/config/greeter-service-staging/deployment.yaml"