opendevstack / ods-quickstarters

Contains project quickstarters (boilerplates) for Nginx, Go, Java (Spring Boot), Python (Flask), Rust (Axum), Scala (Play), TypeScript (Express), Angular, Ionic, Jupyter, RShiny - all including CI/CD integration & Jenkins build agents
Apache License 2.0
27 stars 39 forks source link

Provide new "upgrade existing repo to ODS" quickstarter #284

Open clemensutschig opened 4 years ago

clemensutschig commented 4 years ago

Is your feature request related to a problem? Please describe. Assuming you have your code somewhere version controlled, there is quite some manual steps one needs to do to get it into ODS. Namely:

  1. pick any quickstarter in prov app (gets you jenkinsfile / sq and ocp resources)
  2. clone / clean the created sources
  3. add new remote and merge existing code

The reason why this is not (really) working today is 3 fold:

  1. Provision app will fail if the repo already exists (https://github.com/opendevstack/ods-provisioning-app/blob/2b3773f77dcebed5b3388598020053365e67d5e7/src/main/java/org/opendevstack/provision/services/BitbucketAdapter.java#L587)
  2. PushToRepo stage contains the upgrade magic in case the repo is already filled with state (https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/src/org/ods/quickstarter/PushToRemoteStage.groovy)
  3. CopyFilesStage (https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/src/org/ods/quickstarter/CopyFilesStage.groovy#L13) - does a (blind) copy of quickstarter files, w/o checking if they already exist - so in case a jenkinsfile exists, it will fail ..

I want to solicit feedback on this first - to see what we could do ... my proposal would be to create

  1. a new quickstarter (sort of based on the docker-plain) with checks on what's already in the repo - and adds jenkinsfile / sq props and also ocp resources .. .
  2. add a check into the prov app if this new quickstarter is used, that the repo must already exist, and we only add roles / webhook proxy ...

@torstenhe @michaelsauter

renedupont commented 2 years ago

While it is a bit of a different approach, I think what @oalyman is working on (for JVM languages) goes in the same direction: https://github.com/opendevstack/ods-gradle-conventions#readme