How to update Git bot Pipeline API token

Issue

  • How to update the token for a Git Provider (GitHub, Bitbucket) bot.

Environment

Resolution

There is an API token per Git Provider (bot) linked to your cluster. An API token is added during the installation process, but also you could add new git providers by jx-create-git-server.

Steps

1.- The credentials used by pipeline are in a Kubernetes secret. Get the old secrets (Note: in the below example Github is used as SCM).

$ > kubectl get secrets | grep pipeline             
jx-pipeline-git-github-github                  Opaque                                2      63d

$> kubectl get secret jx-pipeline-git-github-github  -o yaml  > secrets-jx-pipeline-git-github-github.yaml

2.- Encode (base64) the new API token and copy it into the data.password field

$ >  echo -n <new-apitoken> | base64

3.- Apply changes

kubectl apply -f secrets-jx-pipeline-git-github-github.yaml

Tested product/plugin versions

  • Jenkins X 1.3.980
jx                 1.3.980
jenkins x platform 0.0.3690
Kubernetes cluster v1.11.7-gke.12
kubectl            v1.13.4
helm client        v2.13.0+g79d0794
helm server        v2.13.0+g79d0794
git                git version 2.7.4
Operating System   Ubuntu 16.04.6 LTS
  • GitHub
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.