This repository contains a configured Docker image with scripts to import your personal repositories or repositories, members and teams of an organization into Pulumi.
After running the import script, two sets of artifacts are generated
and saved in the resources/
:
import_*.txt
: files with commands for importing resources.members/*.ts
,repositories/*.ts
andteams/*.ts
: Pulumi resource files.
The alvarofpp/template-infra-pulumi repository has a directory structure that you can use as a basis.
This repository can be used for two purposes:
- Importing your personal repositories.
- Importing members of an organization's repositories and teams.
For both cases, you first need to run make build
to generate the
Docker image that will be used to run the scripts.
The commands using make
that will be shown below can be found in the Makefile
file.
If you choose not to use the Makefile, you can copy and paste the commands
into your terminal.
- Export the GitHub access token with the permissions for your repositories:
export GITHUB_ACCESS_TOKEN=github_pat_...
- You also need to export your username:
export GITHUB_USER=...
- Run:
make import-my-repos
- Export the GitHub access token with permissions for repositories, members and teams:
export GITHUB_ACCESS_TOKEN=github_pat_...
- You also need to export the organization identifier:
export GITHUB_ORG=...
- Run:
make import-org