Can I push to a gitlab repo using github handle? - github

Pretty simple, really. I want to provide my github handle to gain access to a gitlab repo. Is this possible, or do I need to create an account on gitlab?

You still need a GitLab account.
One scenario where you can use GitLab with a GitHub account is "Using GitLab CI/CD with a GitHub repository" (with Premium GitLab only).
There you could register in GitLab CI/CD settings a GitHub token.
But for pushing to a GitLab repository... you need GitLab credentials.

Related

Connect Azure Pipelines to GitHub Enterprise

We have a hosted GitHub Enterprise (GHE) account which needs to integrate with Azure Pipelines. I have installed the Azure Pipelines app from the GitHub Marketplace for our GHE account. The installation of the Azure Pipelines app asks to select an Azure DevOps project and GHE repo to setup the integration. This results in one pipeline being connected to a GHE repo.
But my question is, how to we setup other pipelines within Azure DevOps to use repos in GHE?
Nowhere in the Azure Pipelines interface can I find an option to select a GHE repo. Only public GitHub and GitHub Enterprise (on-prem) server repos. It seems that only the Azure Pipelines app setup wizard allows you to configure a pipeline with a GHE.
I can't imagine that we would have to initiate the setup wizard of the Azure Pipelines app every time we want to connect a pipeline to a GHE repo. That wouldn't even be possible, because most coworkers won't have the permissions to do that. What am I missing?
Remark: I realize that we could create a service connection in Azure DevOps using on a Personal Access Token or username+password. But that's tied to someone's personal account. If that person would leave, the connection is broken. Unless you create a service/dummy account, which doesn't seem very elegant.
If you use GitHub Enterprise, then you can integrate with Azure AD. Then based on group membership you can assign access to repositories with the help of Github Teams.
Then based on those permissions the repos to which somebody has access will be visible during the setup of the Azure DevOps pipeline.
Some useful resources:
https://learn.microsoft.com/en-us/azure/active-directory/saas-apps/github-tutorial
https://github.blog/2019-09-24-azure-active-directory-team-synchronization-now-available-with-enterprise-cloud/
https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams
https://enterprise.github.com/support
I found out the cause of the issue.
First of all, when you install the Azure Pipelines app from the GitHub marketplace, you first need to make sure that you select your GitHub organisation and not your personal account.
Secondly, during the installation you are taken to Azure DevOps to setup your project. Two different authorization pages will be shown; "Azure Pipelines by Microsoft would like to [...]" and the page for OAuth authorization. As can be seen in below image, there is a small grant button that's easily overlooked. You need to press that button before you press the large green that says "Authorize AzurePipelines"
I am now able to select my GitHub Enterprise repositories when I create a new pipeline in Azure DevOps. I simply choose GitHub as the source where my repository lives.

Azure pipeline from Yaml hosted on Gitlab

I think it isn't possible to create an Azure Pipeline from Yaml when hosting the Git repository in GitLab. Is anyone able to confirm or deny this?
I think it is possible for GitHub, BitBucket and Azure Repos Git.
You're right, according to the docs the YAML supported only in Azure Repos Git, Bitbucket Cloud, GitHub and GitHub Enterprise Server:

GitHub Pages Automation

Overview:
I'm using GitHub Pages feature to host documentation. I'm working on a CI/CD process to automate the build so that when the source for the documentation is updated it automatically rebuilds the content and deploys to GitHub Pages.
Details:
So far, using AWS CodeBuild, I've implemented the following:
Pulls down source from GitHub Repo
Uses MkDocs to build and deploy to the special gh-pages branch using the "mkdocs gh-deploy" command.
This is done with command lines in the CodeBuild Buildspec. The reason I'm using commands is that I want to use GitHub Deploy Keys opposed to creating user account (used as a machine account) that my team would need to manage.
I have it all working except what triggers the build. If the process was using a user account to authenticate then I can use AWS CodePipeline which creates a Webhook within the GitHub repo, and then notifications are sent via the Webhook to say that the master branch was updated, which would trigger a new build.
I'd like to implement a similar process but using the GitHub repo's Deploy Key. Any suggestions?

How do I set up a gitlab integration in Bluemix DevOps ToolChain?

IBM Bluemix DevOps ToolChain allows source code repositories to be only github and IBM version gitlab. My repo is in the public gitlab cloud and i do not intend to move it to IBM's gitlab cloud. How do I set up my Toolchain?
Update: It is now possible to add gitlab.com repositories (or repositories from any other GitLab server on the public internet) to Bluemix DevOps Toolchains. More details are available in the Bluemix Documentation.
Original (outdated) answer:
It is not currently possible to add repositories on gitlab.com or other public GitLab servers to an IBM Bluemix DevOps toolchain. However, that capability is actively under development.
Until that feature is available, you could proceed by duplicating your repository to one of the supported Git providers. There are instructions for duplicating a repository at https://help.github.com/articles/duplicating-a-repository/. In short:
git clone --bare https://github.com/exampleuser/old-repository.git
cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git
The example uses github.com, but this approach would work for any git repository.
I think this has been added recently, you can just pick it when you add a tool to your toolchain. There's also a blog post about it https://serifandsemaphore.io/build-a-serverless-api-in-seconds-with-go-c504398d86f6

Mirror from github to gitlab

In Gitlab it is now possible to automatically mirror remote GIT repo:
http://docs.gitlab.com/ee/workflow/repository_mirroring.html
Synchronization is either done manually or via gitlab cron script (running every hour).
I would like to sync in this way my github repo and run Gitlab CI jobs using my own runners.
Is is possible to automatize sync task, i.e. via Github webhooks ? Do you know if there is any other way to do it with Gitlab infrastructure ?
I would like to avoid hacking like:
- cloning github repo in gitlab runner
- running my own cron jobs which do sync more often
Mirror does work, but it's slow. If your goal is to run gitlab-ci for a github repository, good news, gitlab has released a new version which lets you use github.com repository with gitlab-ci:
https://about.gitlab.com/2018/03/22/gitlab-10-6-released/
GitLab CI/CD for GitHub feature a part of our GitLab.com Free tier
Instructions:
https://about.gitlab.com/2018/03/22/gitlab-10-6-released/#gitlab-cicd-for-external-repos
https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/