https://github.com/ksingh7/github-action-deploy-to-openshift
Github Action App (python) to OpenShift
https://github.com/ksingh7/github-action-deploy-to-openshift
Last synced: 3 months ago
JSON representation
Github Action App (python) to OpenShift
- Host: GitHub
- URL: https://github.com/ksingh7/github-action-deploy-to-openshift
- Owner: ksingh7
- Created: 2021-11-04T20:52:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-06T21:13:23.000Z (over 3 years ago)
- Last Synced: 2025-01-08T20:15:34.256Z (4 months ago)
- Language: Dockerfile
- Size: 22.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# github-action-deploy-to-openshift
Github Action App (python) to OpenShift```
export SA=github-actions-sa
oc create sa $SA# Now, we have to find the name of the secret in which the Service Account's apiserver token is stored.
export SECRETS=$(oc get sa $SA -o jsonpath='{.secrets[*].name}{"\n"}') && echo $SECRETS
# Select the one with "token" in the name - the other is for the container registry.
export SECRET_NAME=$(printf "%s\n" $SECRETS | grep "token") && echo $SECRET_NAME# Get the token from the secret.
export ENCODED_TOKEN=$(oc get secret $SECRET_NAME -o jsonpath='{.data.token}{"\n"}') && echo $ENCODED_TOKEN;export OPENSHIFT_TOKEN=$(echo $ENCODED_TOKEN | base64 -d) && echo $OPENSHIFT_TOKEN
oc policy add-role-to-user edit -z $SA
export OPENSHIFT_SERVER_URL=$(oc whoami --show-server)
brew install gh
gh auth login --hostname github.com
gh secret -R github.com/ksingh7/github-action-deploy-to-openshift listgh secret -R github.com/ksingh7/github-action-deploy-to-openshift set OPENSHIFT_SERVER_URL -b"${OPENSHIFT_SERVER_URL}"
gh secret -R github.com/ksingh7/github-action-deploy-to-openshift set OPENSHIFT_TOKEN -b"${OPENSHIFT_TOKEN}"export QUAY_PULL_SECRET=''
export DOCKER_USERNAME=karansingh
export DOCKER_PASSWORD=
gh secret -R github.com/ksingh7/github-action-deploy-to-openshift set QUAY_PULL_SECRET -b"${QUAY_PULL_SECRET}"
gh secret -R github.com/ksingh7/github-action-deploy-to-openshift set DOCKER_USERNAME -b"${DOCKER_USERNAME}"
gh secret -R github.com/ksingh7/github-action-deploy-to-openshift set DOCKER_PASSWORD -b"${DOCKER_PASSWORD}"
gh secret -R github.com/ksingh7/github-action-deploy-to-openshift list```