Skip to content

Instantly share code, notes, and snippets.

@rafaeltuelho
Last active August 21, 2023 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaeltuelho/6c269b31c15e81149b88e71cb4a30ccc to your computer and use it in GitHub Desktop.
Save rafaeltuelho/6c269b31c15e81149b88e71cb4a30ccc to your computer and use it in GitHub Desktop.
Openshift DevSapces with Github OAuth integration Script.
#!/bin/bash
#for DevSpaces
#Go to https://github.com/settings/applications/new
#Enter the 'Red Hat DevSpaces Workshop' as the Application Name
#Enter the Homepage URL as 'https://devspaces.apps.YOUR-cluster-domain/'
#Enter the Authorization callback URL as 'https://devspaces.apps.YOUR-cluster-domain/api/oauth/callback'
#Remember to copy the Client Id and the Client Secret values
DEV_SPACES_NAMESPACE='openshift-devspaces'
GB_APP_ID='paste your oauth app id here'
GB_APP_SECRET='paste your oauth app secret here'
oc delete secret github-oauth-config --ignore-not-found=true -n openshift-devspaces
oc create secret generic github-oauth-config -n openshift-devspaces \
--from-literal=id=$GB_APP_ID \
--from-literal=secret=$GB_APP_SECRET
oc label secret github-oauth-config -n $DEV_SPACES_NAMESPACE \
--overwrite=true app.kubernetes.io/part-of=che.eclipse.org app.kubernetes.io/component=oauth-scm-configuration
oc annotate secret github-oauth-config -n $DEV_SPACES_NAMESPACE \
--overwrite=true che.eclipse.org/oauth-scm-server=github
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment