BIX-Digital / ods-contrib

Code to help using OpenDevStack.
Apache License 2.0
1 stars 1 forks source link

Can not deploy a QS with run script #19

Closed nichtraunzer closed 3 years ago

nichtraunzer commented 3 years ago

Describe the bug the script fails https://github.com/BIX-Digital/ods-contrib/blob/master/quickstart-with-jenkins/run.sh when trying to deploy a quickstarter (inf-terraform-aws) into an EDP project.

To Reproduce

  1. Checkout repository, switch to branch 3.x
  2. execute an oc login command
  3. execute run.sh - see log output for params
  4. Email & servernames have been wiped - test happend on a prod EDP project on the European cluster

Expected behavior The script shall create an EDP component (component ID test, project ID age, inf-terraform-aws qs).

Affected version (please complete the following information):

Log Output (ensure to remove any confidential information like tokens, project names, etc.

[quickstart-with-jenkins]$ sh ./run.sh  \
   --username="blih@blah.com" \
   --project-id="age" \
   --component-id="test" \
   --quickstarter="inf-terraform-aws" \
   --ods-bitbucket-project="age" \
   --ods-image-tag="3.0.0" 
   --quickstarter-branch="3.x" \
   --shared-lib-branch="3.x"
INFO: Param --quickstarter-repo not defined, setting it to 'ods-quickstarters'
INFO: Param --ods-namespace not defined, setting it to 'ods'
INFO: Param --group-id not defined, setting it to 'org.opendevstack.genecloud'
INFO: Param --package-name not defined, setting it to 'org.opendevstack.age.testd'
\n
INFO: Selecting project to create the pipeline for...
Already on project "age-cd" on server "https://xxx.com:443".
INFO: Pulling routes of Jenkins and webhook proxy
INFO: Jenkins URL: https://jenkins-age-cd.xxx.com
INFO: Webhook Proxy URL: https://webhook-proxy-age-cd.xxx.com
INFO: Pulling webhook trigger secret...
INFO: Generating Bitbucket token...
Please enter your Bitbucket password:
INFO: Pulling your bitbucket host information
INFO: Bitbucket URL: https://bitbucket.xxxx.com
INFO: Creating repo test in age...
curl: (22) The requested URL returned error: 401

Additional context It fails at the curl statements which create the repository and the WebHook. PS: run.sh succeeds when curl commands are removed and an empty repo will be created upfront !!!

PPS: when changing the parameter (because i want to get the latest version of the QS)

--quickstarter-branch="4.x" \

to the latest 4.x branch the jenkins pipline will fail (but maybe i am using it here in the wrong way)

michaelsauter commented 3 years ago

Does the token you entered have enough permissions to create repos in Bitbucket?

gerardcl commented 3 years ago

AFAIK the issue happens within the script, if one tries to run the steps outside it works, so there is something bad formatted or not properly handled within the bash script...

faust2199 commented 3 years ago

I believe the root cause is that the specific Bitbucket instance is no longer allowing password based authentication. If we change the script to use Bitbucket token instead, then the script works as intended. The token needs to be created in the web UI, with Projects:Admin permission.