Is there any way to create two applications that in Openshift that use the same git repo (although perhaps different branches?).
I am basically looking for a super simple way to create one "experimental" or "dev" application and one production one.
Thanks!
This blog post on release management covers the topic in more detail:
https://blog.openshift.com/release-management-in-the-cloud/
Here's a quick summary of the process...
# setup
cd LOCAL_APP_DIRECTORY
rhc app create STG_APP_NAME CARTRIDGE_TYPE
rhc app create --no-git PROD_APP_NAME CARTRIDGE_TYPE
git remote add production -m master PROD_GIT_URL
git push -f production master
git remote rename origin staging
# deployment
git push staging # or simply, git push
git push production
# emergency rollbacks:
git log # return commit history, example hash: 28c5555352a902c549c965da30cf7559c80f328e
git push staging 28c5555352a902c549c965da30cf7559c80f328e:master
git push production 28c5555352a902c549c965da30cf7559c80f328e:master
Related
(I'm using real examples, so it is clearer.)
I cloned an official Mercurial repository locally
hg clone https://bitbucket.org/Coin3D/soqt -r default
from this repo: https://bitbucket.org/Coin3D/soqt/branch/default
Now I want to update my local copy with a commit taken from a remote fork of the main project:
https://bitbucket.org/roboticslibrary/soqt/branch/patch-hidpi
How can I integrate a specific commit from a remote fork (#214c74a in this example) into my local clone?
With git I would add the remote fork, then I would use "fetch" on that and then I would use "cherry-pick" to get the specific commit.
Is that possible at all in Mercurial?
Thanks a lot!
this is my blog hosted in github.
http://john-qin.github.io/
now, i want to setup octopress on my ubuntu 12.04. I followed the instruction on this page.
http://octopress.org/docs/deploying/github/
I got stuck after "rake setup_github_pages". this instruction is for setting up brand new environment for octopress. I already have it in github. how do I pull the existing one? and where should I put them?
Octopress repositories have two branches, source and master. The source branch contains the files that are used to generate the blog and the master contains the blog itself.
When the local folders are initially configured according to the Octopress Setup Guide, the master branch is stored in a subfolder named _deploy. Since the folder name begins with an underscore, it is ignored when you git push origin source. Instead, the master branch (which contains your blog posts) gets updated when you rake deploy.
To recreate the local directory structure of an existing Octopress blog, follow these instructions.
First you need to clone the source branch to the local octopress folder.
git clone -b source git#github.com:username/username.github.com.git octopress
Then clone the master branch to the _deploy subfolder.
cd octopress
git clone git#github.com:username/username.github.com.git _deploy
Then run the rake installation to configure everything
gem install bundler
rbenv rehash # If you use rbenv, rehash to be able to run the bundle command
bundle install
rake setup_github_pages
It will prompt you for your repository URL. Enter the read/write url for your repository
(For example, 'git#github.com:your_username/your_username.github.com)
You now have a new local copy of your Octopress blog. Check out this post for more information.
Is it possible to push from one remote repository to another remote repository?
I have a case where I push my local changes to a remote integration repos. Once approved, I want the integration repos pushed into a release repos (where I'll build my release from).
Is this technically possible?
EDIT: 1st repository is local on my disk. 2nd and 3rd are both remote repositories on my server that I DON'T have file system access to. I want to be able to push from 2nd to 3rd from my PC (using my local HG/TortoisHG client).
The simple way is to login to your server, cd to the integration repository and then push to a release repository.
If you do not have such a login, simply keep a local clone of the integration repository which you only use to locally push to a remote release repo:
$ hg clone <remote-integration-repo> integration
$ cd integration
$ hg push <remote-release-repo>
For subsequent pushes, do
$ cd integration
$ hg pull # optionally with -u option
$ hg push <remote-release-repo>
In case you have multiple integration and release repostitories, you might want to automate these steps in a script.
The basic message is that it does not really make a difference if you push to the release repo from a local or remote machine.
Depends on what you mean by "remote". If you can log into these machines and you can establish an SSH connection between them, it's easily possible.
Have just started using git. Building and installing it was easy. Then I went into the directory of one of my web projects and added a git repo to it.
$ cd ~/Sites/webapp
$ git init (and so on)
I also set up gitweb, and when I added ~/Sites/webapp to $projectroot setting in gitweb.cgi, that appeared in my browser when I went to http://localhost/gitweb/gitweb.cgi
My question is thus -- from what I understand, git doesn't have a central repo concept. Every project that I may be working on will have its own git repository. Since my projects are all over my hard disk, their respective repos are also all over the hard disk. How do I add multiple repositories to gitweb? Is there some kind of central registry of all my repos? Should I really rejig how I work, and move all my projects to a central directory? How is this done?
Better late then never I guess.
I solved it by creating a project root directory and linking the git repositories.
project_root="/opt/gitweb"
In /opt/gitweb
ln -s ~/Sites/webapp webapp.git
ln -s ~/someotherplace/whereitis/application appliation.git
I do this by creating an empty repository and linking to the repositories I want to browse. This workaround is necessary because of the complicated way instaweb runs gitweb and sets the project root.
git init instaweb
cd instaweb
ln -s ~/projects/gitproj1 gitproj1
ln -s ~/projects/gitproj2 gitproj2
git instaweb --httpd webrick
The server is up and running now and the homepage will list a .git project (which is the empty repository you just initialised) along with the two actual projects you linked to.
Found myself quite confused today about this.
I create a blank repository locally(hg init), cloned it to working copy, added some code, commited and pushed it(to local repo obviously).
Now I need to share that repository with others. There is a server that has mercurial on it, how do I clone my repository to a remote one such that other developers can access it and pull/push code from/to it?
You'll want to check out the publishing repositories wiki page to get into web interfaces and access controls, but at it's most basic you can do something like this:
hg clone yourlocalrepo ssh://you#server//home/you/repo
That clones your local repo to a remote location of your choosing. Note that there are two double slashes in that URL.
You can't create a remote repo like that using http://, only ssh://. If all you have is http to hgweb.cgi you can 'hg init' an empty repo on the server and then hg push to it.
If your "official" repositories are served up by an HTTP server, and you want to create a repo in the central location based on a local machine's repo, here's one way. You need admin rights on the central server to do this.
e.g. I'm developing on windows, and my central repository is running on linux and served by lighttpd per the official guide. The server's central repo directory is /var/hg/repos/, owned by the user/group www-data. My local machine's IP is 10.1.10.100, and the repository I want to clone is named foo.
On the local machine, open a command prompt into the repository directory and type hg serve. This runs the local hg web server, which will allow the server to pull from it.
ssh into the central repo server, logging in as a user with sudo rights to www-data.
cd /var/hg/repos
sudo -u www-data hg clone http://10.1.10.100 foo
For those that come later and don't want to bother about the hassles of ssh for pushing changes to a server built to host repos, you can just init on the server, and then push as you do every other repo.
# on server:
cd repos/
mkdir myrepo
cd myrepo
hg init
cd ..
chown -R apache:apache myrepo
cd ..
vim hgweb.config
# change [paths]
[paths]
myrepo = /path/to/myrepo
# on your machine
# make sure you've configured hgrc correctly
[paths]
default = http://server/hg/repos/myrepo
hg push
# ???
# profit