Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Make pushing a local repository easier #513

Open
ekohl opened this issue Nov 20, 2013 · 1 comment
Open

Make pushing a local repository easier #513

ekohl opened this issue Nov 20, 2013 · 1 comment

Comments

@ekohl
Copy link

ekohl commented Nov 20, 2013

I was playing with creating a django project template for openshift. Since --from-code doesn't accept a local git repo, I am following this workflow (as documented in the README):

# Create the django project
django-admin.py startproject -n application --template https://github.com/ekohl/django-project-openshift/archive/master.zip myproject

# Do the initial commit
cd myproject
mv openshift .openshift # because startproject ignores hidden files
git init
git add .
git commit -m "Initial commit"

# Create the application
rhc app create myproject python-2.7 --from-code empty --no-git

# Set the git remote & push
git remote add openshift `rhc show-app myproject | awk '/Git URL/ { print $3 }'`
git push --set-upstream openshift HEAD

Now that works, but if you use rhc git-clone it will also set the application values in .git/config for rhc app *. It would be great if --from-code /path/to/myproject works and sets the needed values. Then --no-git should not be needed either.

This should also be helpful on existing projects that move to openshift, but are not publicly accessible (as most companies prefer).

@cben
Copy link

cben commented Sep 8, 2015

👍 --from-code . would be great.

Benefit of the create empty, then push workflow over create --from-code:

  • less likely to time out
  • easier to debug (build problems show up on stdout during push, rather than racing to rhc ssh 'ps auxf; tail -n +1 -f /tmp/initial-build.log' in parallel before create fails and the app gets destroyed...).

It'd also be useful to have a command like rhc git-clone that only sets up a remote (with configurable name) and/or the rhc.* git configs.
The use case is having several apps from the same code. E.g. I have both an rhcloud-staging and an rhcloud git remotes, and want git config pointed to the prod app so that rhc tail etc will access the prod one.
[My current kludge for the configs was creating with --git, then doing:

git config -f CHECKED_OUT_SUBDIR/.git/config --get-regexp '^rhc\.' | xargs -n 2 git config

and a sed command similar to the above awk for the remote. BTW awk '/^\s*Git URL:/ { print $3}' is better - doesn't match Initial Git URL: line.]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants