I'm wondering what is the best way to incorporate documentation created with Sphynx, in a remote repository in GitHub.
Should I commit all the files in the build and source folder?
Related
I'm trying to setup a CI-pipeline using Github Actions for my Python scripts, but these scripts make use of a package that is not publically available and it requires a local license. Because of this, I cannot use it in Github Actions. I also haven't found a way to run the Github Actions locally using the local package (local Github pipelines often try to download requirements from the internet). Does anyone have a solution for this? Is there perhaps a way to do this in VS Code?
For automating some of our workflows I am implementing some Python scripts which create project templates. The content of a project template is located in a folder which also is a local git repository. So the project in the end will be linked and pushed to a remote repository on our company server. Each project additionally uses some of our own created libraries which are added as a git submodule into the project folder and is part of the project git repository.
So my script should now first create the local project git repository which I do by using Gitpython with the following code:
Repo.init(os.path.join(sRepoPath, '.git'), bare=True)
After the repository is created, I want to add one or more remote repositories as a submodule and then clone them into the project folder. But I can't find out how to do it from the Gitpython documentation. It does not cover such a case with remotes as a submodule.
I've already tried several code combinations from the Gitpython documentation. Something like (of course not working):
mainRepo = Repo(sDestinationRepoPath)
test_remote = mainRepo.create_remote('submodule', "ssh://git#bb.mycompany.corp:1234/fwlib/system_lib.git")
mainRepo.create_submodule(test_remote)
But I can't sort it out how it should be done. Can anyone tell me how to do it?
This question already has an answer here:
Are we able to use GitHub API to create a commit? especially v4?
(1 answer)
Closed 3 years ago.
Ok, this seems like a stupid question and I don't have a lot of experience using git as I have always been dependent on GitHub desktop for my work. So my question is, Can a github remote repo be committed to and pushed to via only the github api. Can it be done without installing git on your system? I have used PyGitHub and git-python or even python subprocess that can be used to create a remote repo, initialize and add to the the local repo and perform the commit and pushes to the remote repo and I know that these services require the use of the git client installed on the system.
So I was just wondering if only the standalone github api can be called through python requests to do the same but the requirement being that I don't have to get Git installed in my local system. Any help on the matter would be really enlightening.
Can a github remote repo be committed to and pushed to via only the github api. Can it be done without installing git on your system?
Kinda: you can interact with the raw objects via the API, I'm not sure you can behave as if git was on your machine and to push/pull from a local working copy as you'd do if you did have git installed locally.
My experience of it is that it requires some understanding of the low-level fundamentals of Git (blobs, trees, commits, refs, and their relations): the v3 API exposes a git data / git database endpoint which provides transparent access to low-level git structures. There are some limitations (e.g. can't interact with a brand new empty repository via this, you have to have at least one commit in it somehow, high-level operations like "cherrypick" or "rebase" are unavailable and have to be hand-rolled if you want them, ...) but aside from that it works fine.
To understand the low-level objects I would recommend the "Git Internals" chapter of the git book, sections 10.2 Git Objects and 10.3 Git References. There are also "from the ground up" tutorials out there which explain these structures in a more hands-on way by building partial git clients from the ground up.
So I was just wondering if only the standalone github api can be called through python requests to do the same but the requirement being that I don't have to get Git installed in my local system.
See above, kinda: you can most certainly interact with a github repository via the API in most every way possible, but rebuilding a git client out of the API might be difficult.
PyGithub will enable you to deal with whatever we have in Github.com. To manage your local git. Like, committing or pushing or stashing. You might need to use some python modules that deal with Git, not Github. One of the examples could be
https://github.com/gitpython-developers/GitPython
Here is the scenario I am dealing with:
I WANT to/HAVE setup CircleCI build for my project with unit tests etc.
In this project I use another one of my libraries which needs to be installed on the build container in CirleCi, otherwise my tests are failing.
I need to find a way to either:
pull git repository of external reference and install it
Or download it as zip
Or some other way ?
Happy to add more explanation if needed.
From the section Using Resources External to Your Repository:
CircleCI supports git submodule, and has advanced SSH key management to let you access multiple repositories from a single test suite. From your project’s Project Settings > Checkout SSH keys page, you can add a “user key” with one-click, allowing you access code from multiple repositories in your test suite. Git submodules can be easily set up in your circle.yml file (see example 1).
CircleCI’s VMs are connected to the internet. You can download dependencies directly while setting up your project, using curl or wget.
(Or just using git clone without submodules.)
I installed openstack through DevStack because I had to modify some files.
When I install DevStack, I have all the files under /opt/stack. There I have services folders (glance, keystone...) and libraries folders (python-glanceclient, python-keystoneclient).
If I modify those files, how can I replicate modification on a already deployed Openstack? Installing openstack without devstack builds a different structure of folder.
I mean, where the python-'service'client folders are in a fresh openstack installation?
Thank you
devstack pulls it's openstack software stack from github. the git repot's it installs from are located in /opt/stack.
What you may want to do is fork openstack as well as the repot of the openstack projects you wish to modify, then make your devstack deployment deploy not from the openstack repot, but your own forked repot.
you can do this by modifying the stack.sh script ( I believe ). devstack.org has a line by line explanation of the entire script on their site and that can point you in the right direction.
http://devstack.org/stack.sh.html read this.
once you've deployed using your own git repository you can of course edit and commit back to it. even push to it.
then any other devstack deployment you have can also be setup to pull from your repository instead of the public openstack repos.
of course rebasing later against openstack will be increasingly difficult as openstack developement moves at a fairly brisk pace.
If the modification you are making is one you want to commit back to the open source project check out this site:
http://wiki.openstack.org/HowToContribute
Basically openstack has a commit review and continuous integration environment that is based off of gerrit and jenkins. This is the method by which commits back to the open source repository are gate tested and manually reviewed by other developers before being merged.
If you are intending to deploy this for production use, I recommend against deploying from devstack. This is not the proper way to do that.