Skip to content

Commit

Permalink
fix scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren committed Jun 28, 2024
1 parent 857636f commit e3a47d1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
34 changes: 34 additions & 0 deletions scripts/create_image_pull_secret.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# Prompt for GitHub username
read -p $'\e[1;32m Enter your GitHub username:\e[0m ' GITHUB_USERNAME

# Prompt for GitHub token

# Prompt for GitHub token requirements
cat <<EOF
Please provide a GitHub personal access token with the following requirements:
- The token should have the "read:packages" scope to access GitHub Container Registry.
To create a personal access token go to https://github.com/settings/tokens
For more information, see: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry
EOF

read -s -p $'\e[1;32m Enter your GitHub personal access token:\e[0m ' GITHUB_TOKEN
echo

# Create the ImagePullSecret in Kubernetes
kubectl create secret docker-registry ghcr-secret \
--docker-server=ghcr.io \
--docker-username=$GITHUB_USERNAME \
--docker-password=$GITHUB_TOKEN \
[email protected]

# Check if the secret was created successfully
if [ $? -eq 0 ]; then
printf "\e[42mImagePullSecret created successfully.\e[0m\n"
else
printf "\e[41mError creating the ImagePullSecret.\e[0m\n"
exit 1
fi
13 changes: 8 additions & 5 deletions scripts/setup_kind_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ if [[ "$@" == *"--reset"* ]]; then
fi

if ! kind get clusters | grep -q tracetest; then
kind create cluster --name tracetest --kubeconfig $KUBECONFIG_FILE
kind create cluster \
--name tracetest \
--config $PROJECT_ROOT/kind-config.yaml \
--kubeconfig $KUBECONFIG_FILE
else
echo "Cluster already exists"
fi
Expand All @@ -44,18 +47,18 @@ fi

# install mongo operator
helm repo add mongodb https://mongodb.github.io/helm-charts --force-update
helm install \
helm upgrade --install \
community-operator mongodb/community-operator

# install cert manager
helm repo add jetstack https://charts.jetstack.io --force-update
helm install \
helm upgrade --install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.15.0 \
--set crds.enabled=true

helm install ttdeps $PROJECT_ROOT/charts/tracetest-dependencies -f $PROJECT_ROOT/values-kind.yaml
helm install tt $PROJECT_ROOT/charts/tracetest-onprem -f $PROJECT_ROOT/values-kind.yaml
helm upgrade --install ttdeps $PROJECT_ROOT/charts/tracetest-dependencies -f $PROJECT_ROOT/values-kind.yaml
helm upgrade --install tt $PROJECT_ROOT/charts/tracetest-onprem -f $PROJECT_ROOT/values-kind.yaml

0 comments on commit e3a47d1

Please sign in to comment.