Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parameterized Generators and Pipelines (#2132)
* Parameterised build pipeline generator Users can now generate their own pipelines using this script from their own repositories to where they want to generate them. Signed-off-by: Morgan Davies <morgandavies2020@gmail.com> * Implement file path param in pipelines * Implement repository checkout in downstream generators * Implement file path params in downstream generators * Roll out previous changes across all version files Signed-off-by: Morgan Davies <morgandavies2020@gmail.com> * Pass in new params to pr tester Signed-off-by: Morgan Davies <morgandavies2020@gmail.com> * configureBuild is already declared, add test stub * Better error handling for regen * Remove inline if's * Use elvis operators * Multiple Regen updates * Added timestamps to build generator * Correctly parsed ENABLE_PIPELINE_SCHEDULE * Added checkout credentials to build generator * Upgraded dot map logic to put logic * Ensured we only checkout once on build generator * Removed trigger schedule from config map unless we are asking for one * General logic improvements for pipeline generators * Clean up whitespaces * Create initial defaults json * Don't generate triggers if no schedule * Parameterise as much as possible in defaults.json * defaults.json changed to be more expressive * defaults.json is read in generators and passed down as a param, even when it's not read from * Whitespace removals * Try using jenkins readJson * Try as empty stub * Try with empty func * Try as list * Try replicating jenkins src impl * Basic def function declaration * Try as string method (since java.langString is classname in error) * Ensure to specifiy map when pulling in JSON * Try declaring as a func * Change implementation back to file since readJSON cannot be done with our test suite * Specify param name in impl * It's parseText for strings *facepalm* * Use readFile outside of json slurp * Use defs, specify param name * Move all read files into master node * Moves PR Tester jenkins script into GitHub (doc updated) * Ensure the build testers have access to platform configs * Revert addition of timestamps * Download the defaults.json file instead of trying to open it * Usually doesn't work out due to jenkins pathing * Try parse * Create URL class instance seperatly * Remove unessassary json convert * Update param to current version * Remove unessassry workspace paths * see if adding scm checkout back in fixes not found lib * Fix bug in version pipeline, now will always use sanitised value * Init default config paths after java version update parsing * Spelling * Remove as Map * Instantiate as a map * Try not parsing at all? * Pretty print JSON to prevent parising error * Remove extra parsing in downstream pipeline * Add error handling for missing JSON file * defaultJson -> defaultsJson * Pass in json defaults to pr tester * Fix bug in triggerSchedule setting * Pretty print out config for top level generator * Add missing params to config regen script * Update other regen files to match working jdk8 * Update main pipeline files to match jdk8 * Remove unimportant pipelineSchedule * Move checkout further up * Parameterise the defaults json * Move defaults json further up * Trial loading lib after checkout in downstream regen * Pretty print out in regen * Parameterise lib path, strong defaultsJson description * Parameterise regen script path * Parameterise lib and downstream basefile paths, intelligently pulling in new values * More credential changes * Fixed bug in that credentials could be read from anywhere on the build * Credentials will now also be generated and passed down to the pipelines * Added checkout credentials to generators * Renamed var and switch back user/pass * Try with username/colon * More credential changes * Credentials will now also be generated and passed down to the pipelines * Added checkout credentials to generators * double quotes * single quotes * access var directly * double quotes var * single quotes var (normal) * Strongify defaults param * Renames jobTemplateDirectories to templateDirectories * Trial checkout system in build generator Generator will check if a file or script exists at a location in the user's repository and will checkout to adopt's if it does not exist using it's helper class, ConfigHandler * Manually create methods for pipeline generator since there's no lib to load * Minor updates * Remove WORKSPACE from params * Ensure we use the right template path and checkout * Always clean up * Clean up boolean logic * Try parsing the boolean * Try using a if else block * Try using a noSchedule config * Remove potentinally useless try-catch * Remove attempts at changing the template logic I can't find a way to make it work within a resonable timeframe and our existing logic is ok for now * Add Repo Switching to Downstream job generator * Renames ConfigHandler class to RepoHandler * Remove RepoHandler from top level files * We cannot import it so we use closures instead and use the repo handler further down the chain * Also condenses exception messages into the actual exceptions * Declare closure outside of scope * Finish setting up generators, passing down everything the jobs * Replace empty pipelineSchedule in config * Conform remaining files * Passes down remote configs and adopt defaults to downstream jobs * make script will now run in adopt's workspace and exit it after build * Removed duplicated code in top generator * Made platform config dir default a url so it can be downloaded by our bash scripts * Try update version after normal to be consistent * Make generators less inclusive * Declare var outside of try catch * f * Enter blank checkout creds if they don't exist * MAke lib load in pipeline a global exception * Mapify user remote configs * Do map parsing further up * Try constructor map * Try declaring "as Map" * Try using json slurper to parse map to be consistent * Use JsonSluprers across downstream generation * Try using dot logic for assigning json values * Add use adopt bash scripts param * Also check if dir exists in bash * Introduce constructor for build_base_file * Remove hashmap references in class instantiation * Remove hashmap values * Clean up Platform config parsing * Ensure file is created and ran * Try creating files first * Try specify true * try checking if it is a true string * stringify everything * Booleanify useAdoptBashScripts * try normal logic * See what useAdoptBashScripts is * debug * Move debug * Rejig order of params * debug * Try using file redirect * Adjust how branch and URL is determinted for platform config pulling * debug * Addiotional https * rm debug * Remove extra uneeded parsing code * Allow generation of useAdoptBashScripts * Also removes unessassary if for pipeline schedule * Add weekly template * Amend failing tests * Update testers * Try again with tests * Cast and set splitAdoptUrl as object * triggerSchedule -> pipelineSchedule * Update tester * Change around scripts to add common stuff into bash * Flesh out testing suite for RepoHandler * Remove duped JDK14 Aix key * First doc updates * More brevity on build generator output * Comment and compatibility upgrades * Add in an additional check for platforms on a failed direct link * Debug out better * Amend config location for test builds * Specify no OS on linux pr build * Reduce duration of build generator by querying adopt api * Functionise download script * Clean up echos, make bash method a function * Use regex when checking error code * Remove TODO's and update other pipeline files * Minor comment and styling updates * Align map entries, replace semi-colon with colon * Remove compile testing on pr tester * Change name of jenkins credentials * USE_ADOPT_BASH_SCRIPTS -> USE_ADOPT_SHELL_SCRIPTS * Made nessassary changes
- Loading branch information