ReactJS - How to create ReactJS components
Introduction In this post, we will talk about basic of how to create components…
April 16, 2021
I had to create many repositories in an Github organization. I created an organization, and I had around 40 projects which I need to migrate from perforce to git.
We can repository from Github portal(UI), and it requires at least 6 clicks:
So total of 7+3=10 clicks per project
So, for 40 projects I had to perform 40*10 = 400 clicks
, which was unmanageable.
My requirements are:
I synced those 40 folders to my local directory. Lets call it mylibs_
And, I have a team in github which I will assign permission to these projects.
curl -u USERNAME:TOKEN https://github.com/api/v3/repos/USERNAME/PROJECT/teams
Assumming following folders:
mylibs
mylibs_
AUTH="USERNAME:TOKEN"
for d in *;
do
echo "Working on ${d}"
curl -s -o /dev/null -w "%{http_code}" \
-u ${AUTH} \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://github.com/api/v3/orgs/mylibs/repos \
-d '{"name": "'${d}'", "visibility": "private", "private": "true", "auto_init": "true", "team_id": "TEAM_ID"}'
echo "";
git clone [email protected]:mylibs/${d}.git ../mylibs/${d}
cp -R ${d}/* ../mylibs/${d}/
cd ../mylibs/${d}/
git add .
git commit -m "Migration from P4 to git"
git push
echo ""
echo "Done with ${d}"
cd -
done
Visit github page for How to create oAuth token{:target=“_blank”}
Please note that the repositories created will be with visibility=private
. And the team assigned to each repository will be having readonly access.
Introduction In this post, we will talk about basic of how to create components…
You might need to put sudo before above command. The command will show details…
Introduction In this tutorial we will see: How to instantiate different classes…
Introduction In this post, we will see how to theme form and its fields…
Introduction Assume you have a drupal website and using cloudflare. You are…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…