Open pranereddy opened 3 years ago
Repository np-reddy/git-issue-ops is used for defining the necessary objects and workflows to create repository in Artifactory.
Prerequisites:
1) User creates an issue using Issue template and provides following details.
github.repo.name=devops1
arti.repo.type=local
arti.repo.package=ivy
2) Actions workflow is designed to trigger on issue opened (also, edited for testing the workflow) and checks for issue label arti-repo defined in our issue template. 3) Workflow can run on either GitHub-Hosted (ubuntu-latest) or self-hosted (ex.mylaptop). 4) Checkout the code from the repo using actions/checkout@v1 5) Parse the issue description and extract gh repo, rt repo type, pkg type. Store them in separate files on runner workspace so that these can be retrieved from other jobs whenever needed. Passing global env variables is also considered for passing variables but it is more complex (for me, at least 😉) and error prone. 6) Get the gh repo user permissions using collaborators api call and map them into admins, readers and writers based on the repo permissions, copy these to separate files on workspace. 7) Set the JFrog CLI env using jfrog/setup-jfrog-cli@v1 8) Prepare necessary object creation templates and set env varibales. 9) Create arti users and set default passowords and dummy emails (It is not possible to retrieve emails from GH if user chose the email to be private, not even from commit logs, I tried 🤷 ) Note: User validation if already present is not included, will be considered for enhancements. 10) Create arti groups and assign the users according to the user maps we have created earlier. 11) Create arti repo using env variables and arti repo template. Note: Only local repos can be created for now. 12) Create arti permission target using permission template and env varibales, this will tag the repos and groups with required access. Note: Users are excluded from perm target as it is less complex to use groups.
Now, all the required objects are created in Artifactory and ready for use.
Enhancements to be Planned 1) Issue description validation for gh repo-name, arti repo-type, arti repo-pkg. 2) Validation for existing users and repos in artifactory 3) Creation of remote repos 4) Feedback to issue after object creation by using comment.
Implement issueops to do the following.