From bd199e96afa986914a102822a919ff4bb4041ff8 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Sat, 20 Jul 2024 19:21:26 -0500 Subject: [PATCH] chore: Add two different ways of tackling this 1. Importing them all by hand, some code duplication and effort, but probably the least likely to blow up 2. Looping through them all We can also start with 1, and then move to 2 once everything is captured in the Pulumi state with 1(which seems like the sane option) --- pulumi/github/repos/core/modules.py | 42 ++++++++++++++++++++ pulumi/github/repos/import_by_hand.py | 20 ++++++++++ pulumi/github/repos/loop_example.py | 55 +++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 pulumi/github/repos/core/modules.py create mode 100644 pulumi/github/repos/import_by_hand.py create mode 100644 pulumi/github/repos/loop_example.py diff --git a/pulumi/github/repos/core/modules.py b/pulumi/github/repos/core/modules.py new file mode 100644 index 0000000..0f9bf16 --- /dev/null +++ b/pulumi/github/repos/core/modules.py @@ -0,0 +1,42 @@ +import yaml + +import pulumi +import pulumi_github as github + + +nf_core_tf = github.Repository( + "nf-core-tf", + allow_merge_commit=False, + allow_rebase_merge=False, + allow_squash_merge=False, + default_branch="master", + description="Repository to host tool-specific module files for the Nextflow DSL2 community!", + has_downloads=True, + has_issues=True, + has_projects=True, + homepage_url="https://nf-co.re", + merge_commit_message="", + merge_commit_title="", + name="modules", + security_and_analysis=github.RepositorySecurityAndAnalysisArgs( + secret_scanning=github.RepositorySecurityAndAnalysisSecretScanningArgs( + status="disabled", + ), + secret_scanning_push_protection=github.RepositorySecurityAndAnalysisSecretScanningPushProtectionArgs( + status="disabled", + ), + ), + squash_merge_commit_message="", + squash_merge_commit_title="", + topics=[ + "nextflow", + "pipelines", + "nf-test", + "modules", + "nf-core", + "dsl2", + "workflows", + ], + visibility="public", + opts=pulumi.ResourceOptions(protect=True), +) diff --git a/pulumi/github/repos/import_by_hand.py b/pulumi/github/repos/import_by_hand.py new file mode 100644 index 0000000..b28f9c2 --- /dev/null +++ b/pulumi/github/repos/import_by_hand.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import yaml + +import pulumi +import pulumi_github as github + +import pipelines.denovotranscript +import pipelines.meerpipe +import pipelines.pairgenomealign +import pipelines.phaseimpute +import pipelines.reportho + +# ... + +import core.github +import core.modules + +# ... +import core.website diff --git a/pulumi/github/repos/loop_example.py b/pulumi/github/repos/loop_example.py new file mode 100644 index 0000000..eef61d7 --- /dev/null +++ b/pulumi/github/repos/loop_example.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +import yaml + +import pulumi +import pulumi_github as github + +TOPICS = [ + "nextflow", + "pipelines", + "nf-test", + "modules", + "nf-core", + "dsl2", + "workflows", +] + +alpha_test_pipeline_repos = [ + "denovotranscript", + "meerpipe", + "pairgenomealign", + "phaseimpute", + "reportho", +] + +for pipeline in alpha_test_pipeline_repos: + github.Repository( + "nf-core-tf", + allow_merge_commit=True, + allow_rebase_merge=True, + allow_squash_merge=True, + default_branch="master", + description="Alpha test repository for nf-core", + has_downloads=True, + has_issues=True, + has_projects=True, + homepage_url=f"https://nf-co.re/{pipeline}", + merge_commit_message="", + merge_commit_title="", + name=pipeline, + security_and_analysis=github.RepositorySecurityAndAnalysisArgs( + secret_scanning=github.RepositorySecurityAndAnalysisSecretScanningArgs( + status="disabled", + ), + secret_scanning_push_protection=github.RepositorySecurityAndAnalysisSecretScanningPushProtectionArgs( + status="disabled", + ), + ), + squash_merge_commit_message="", + squash_merge_commit_title="", + topics=TOPICS, + visibility="public", + # NOTE Idk if this will work + opts=pulumi.ResourceOptions(protect=True), + )