2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								load(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'scripts/lib.star',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'pipeline',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'lint_backend_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'codespell_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'shellcheck_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'test_backend_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'test_frontend_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'build_backend_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'build_frontend_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'build_plugins_step',
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-06 20:22:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    'gen_version_step',
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'package_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'e2e_tests_server_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'e2e_tests_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'build_storybook_step',
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-14 20:35:55 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    'build_frontend_docs_step',
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'build_docs_website_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'copy_packages_for_docker_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'build_docker_images_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'postgres_integration_tests_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'mysql_integration_tests_step',
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-06 21:50:54 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    'redis_integration_tests_step',
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-07 21:06:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    'memcached_integration_tests_step',
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'benchmark_ldap_step',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'ldap_service',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'integration_test_services',
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-10 22:54:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    'validate_scuemata',
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ver_mode = 'pr'
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								def pr_pipelines(edition):
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-06 21:50:54 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    services = integration_test_services(edition)
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    variants = ['linux-x64', 'linux-x64-musl', 'osx64', 'win64',]
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-06 20:22:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    include_enterprise2 = edition == 'enterprise'
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    steps = [
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        codespell_step(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        shellcheck_step(),
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-06 20:22:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        test_backend_step(edition=edition),
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-04 21:05:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        lint_backend_step(edition=edition),
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        test_frontend_step(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        build_frontend_step(edition=edition, ver_mode=ver_mode),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        build_plugins_step(edition=edition),
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-10 22:54:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        validate_scuemata(),
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-06 20:22:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    ]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # Have to insert Enterprise2 steps before they're depended on (in the gen-version step)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if include_enterprise2:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        edition2 = 'enterprise2'
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        steps.append(benchmark_ldap_step())
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        services.append(ldap_service())
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        steps.extend([
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            test_backend_step(edition=edition2),
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-04 21:05:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            lint_backend_step(edition=edition2),
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-06 20:22:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64']),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        ])
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # Insert remaining steps
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    steps.extend([
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        gen_version_step(ver_mode=ver_mode, include_enterprise2=include_enterprise2),
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        package_step(edition=edition, ver_mode=ver_mode, variants=variants),
							 | 
						
					
						
							
								
									
										
										
										
											2020-12-23 22:42:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        e2e_tests_server_step(edition=edition),
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-06 20:22:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        e2e_tests_step(edition=edition),
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        build_storybook_step(edition=edition, ver_mode=ver_mode),
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-14 20:35:55 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        build_frontend_docs_step(edition=edition),
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        build_docs_website_step(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        copy_packages_for_docker_step(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        build_docker_images_step(edition=edition, ver_mode=ver_mode, archs=['amd64',]),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        postgres_integration_tests_step(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        mysql_integration_tests_step(),
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-06 20:22:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    ])
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if include_enterprise2:
							 | 
						
					
						
							
								
									
										
										
										
											2020-12-23 22:42:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        steps.extend([
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-06 21:50:54 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            redis_integration_tests_step(),
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-07 21:06:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            memcached_integration_tests_step(),
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-06 20:22:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            package_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64']),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            e2e_tests_server_step(edition=edition2, port=3002),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            e2e_tests_step(edition=edition2, port=3002),
							 | 
						
					
						
							
								
									
										
										
										
											2020-12-23 22:42:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        ])
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-07 20:22:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    trigger = {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        'event': ['pull_request',],
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    return [
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        pipeline(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            name='test-pr', edition=edition, trigger=trigger, services=services, steps=steps,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            ver_mode=ver_mode,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        ),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    ]
							 |