Can you access your own private git repo from Codenvy? - codenvy

This may seem like a dumb question, but the documentation is not very clear on this, and from some of the GitHub tickets it seems like they only whitelist certain hosts, so maybe you can confirm for me:
Can I clone a Git repository from my own private host? In other words, something like:
git clone ssh://user#myhost/repo.git
from the workspace? Currently it times out when I try that.

You certainly can clone from a private repo. There are a few ways to do it depending on the target (if it's GitHub for example Codenvy has a little octocat icon that makes it a single-click to setup). The docs outline the various options:
https://codenvy.com/docs/user-guide/git-svn/index.html
But generally it comes down to setting up the SSH key pair between Codenvy and the git repo. The docs include some examples. If there are specific issues that you're having or you think you've found a bug it's best to file an issue at https://github.com/codenvy/codenvy/issues

Related

What does jenkins look into the project to start unit tests

I have looked into jenkins tutorials and all most all of them mention that we should provide with the URL to the git repo.
Fine.
But once jenkins has an access to the git repo, what part of project does it look into to figure out which tests should be run or wether to run them at all etc ? Is it some configuration file in the repo ?
Guess that depends on what kind of project your repo is. If I understand the question correctly. The provided url gives Jenkins the information to do a git clone url which checks out the project in Jenkins workspace.
Then according to the type, lets say it's a Maven-project, you fill in the goals you'd like Jenkins to run locally. Usually clean test. It is then run at top level, root of the project, guessing it will find a pom.xml there. If not you'll have to tell it where to look.
A more clearer answer would perhaps be easier if you told what kind of project you'd like to build.

Any way to have rebar get-deps check a local cache before cloning a repository?

I have a project with several dependencies on remote repositories (all on github.com at the moment if that helps). The dependencies don't change often. It would be nice if there was a way to keep the existing rebar.conf files the same so that they pointed to the upstream repositories, but to be able to cache the repos (or a snapshot) locally so that clean builds don't need go to the internet.
Is there anyway of doing this? I.e. rebar command line options, environment settings, git options, etc.?
I suppose you could do couple of things:
Make your own local clone of all repositories and change
rebar.config to take this repos from it. On the first look it seems
horrible solution, but it has a lot of advantages. Github is often
not available, clone speed will increase, and the last most valuable
is: projects are evolving and one day you will find that everything
is broken because one of the deps has changed their APi in master branch.
You could do local deps folder with all you need repos and share
it via symlink with every repo you need.
Rebar has a feature that lets you add a custom script file, rebar.config.script, to modify rebar's configuration dynamically. This lets you implement something similar to #danechkin's answer #2 except using an environment variable to switch between the local shared deps folder and the default one for the project. No changes to rebar.config needed. The example at https://github.com/basho/rebar/wiki/Dynamic-configuration shows how to do this.

Using Git with a Redmine hosted on Heroku

I have a question. I am using Redmine for a issue tracking system for my upcoming project and I recently did the install on Heroku and I was wondering if there was a good way to use Git via a github repository to do issue tracking (ie. I can make a commit, do a refs #issue_number and it would associate that commit with the issue I'm tracking). I know there is some way to do it with svn, but we want to use git for the project. I heard that heroku is unable to do Redmine with git from someone since you need a 'bare' and 'minimum' directory? (or something similar to that) Is this true? or is there a guide out there (I've been googling 'git with heroku and redmine' and other variants for the last little bit with no luck) on installing git to associate it with my github repository for my heroku based Redmine?
Thanks in advanced!
Just to clarify, you have mentioned that you are using GitHub, Redmine, and Heroku, and want to relate commits to issue numbers within Redmine.
I believe that Heroku will not come into this, but what you want to look at is a post-receive hook for your repository on GitHub.
The best direction I can give you is to follow this documentation, but select the "Redmine" post-receive hook, and set it up according to the detailed instructions that they provide.
The documentation for the hook explicitly states the following:
Commits which are related to Redmine issues are detected by matching '#IssueNo' in the commit message (i.e "fixing bug #234" is related to issue #234)
which I believe is the functionality that you are after. Please correct me if I am wrong.

Github straight to heroku

I have a project on a private github repository (but this should work for public repositories too) and there are many contributors. The github repository has been designated as the master copy. This project is set up to deploy to my app on heroku.com.
I would like to get the git push to go straight from github to heroku without first having to host it on my workstation. Is there a way to do that?
Sounds like this isn't possible: Push from github to heroku without downloading repo
Not sure you can do this directly, but this should at least get you looking in the right area: http://help.github.com/post-receive-hooks/
This thread might be of interest as well.

Whats the best way to work with Github and multiple computers?

I am developing some school grading software and decided to use Github to host the project. After building some code on my Ubuntu box I pushed it to Github and then cloned it down to my MacBook Pro. After editing the code on the MBP I pushed it back to Github. The next morning I tried to update my repo on the Ubuntu box with a git pull and it gave me all kinds of trouble.
Whats the best way to work in this situation? I don't want to fork my own repo and I don't really want to send myself emails or pull requests. Why can't I just treat Github like a master and push/pull from it onto all of my personal repos on different computers?
I'll assume your problem was that the machine on which you first created the repo crapped out when you tried to issue the git pull command.
When you clone an existing git repository (like you did on your 2nd machine, the MacBook Pro), you're automatically set up to so your git pull commands will automatically merge the remote with your local changes.
However, when you initially create a repo and then share it on a remote repository, you have to issue a few commands to make things as automated as a on cloned repo.
# GitHub gives you that instruction, you've already done that
# git remote add origin git#github.com:user_name/repo_name.git
# GitHub doesn't specify the following instructions
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
These last few instructions configure git so future git pull's from this repo will merge all remote changes automatically.
The following is a bit of shameless self-promotion. If you use Ruby, I have created a Ruby-based tool that lets you deal with all these kinds of things with git remote branches. The tool is called, unsurprisingly, git_remote_branch :-)
If you don't use Ruby, my tool is probably gonna be too much of a hassle to install. What you can do is look at an old post on my blog, where most of the stuff grb can do for you was explicitly shown. Whip out your git notes file :-)
You can also add multiple SSH public keys.

Resources