Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give instructions for creating an app from a local clone #1

Open
ncoghlan opened this issue Dec 1, 2016 · 3 comments
Open

Give instructions for creating an app from a local clone #1

ncoghlan opened this issue Dec 1, 2016 · 3 comments

Comments

@ncoghlan
Copy link

ncoghlan commented Dec 1, 2016

I set up a new project using this one as a template, but it took me a bit of thought to realise the right way to do a deployment based on that.

  1. Push the imported sample code up to the source repo

  2. Use that source repo in the deployment command rather than deploying directly from the local system:

    oc new-app python:3.5~https://github.com/ncoghlan/srpminfo.git

That way the deployed app is correctly associated with the relevant source repo.

@GrahamDumpleton
Copy link
Contributor

To do it from a local clone only, without having your own fork on GitHub with the changes, entails using a binary build. The first steps for this are:

oc new-build python:3.5 --binary --name=srpminfo
oc start-build srpminfo --from-dir=.

Once the first build has completed, then run:

oc new-app srpminfo
oc expose sac srpminfo

After every code change you make and for which you want to do a build, you need to run again:

oc start-build srpminfo --from-dir=.

Because this is a binary build linked to your local checkout, you cannot use the start build button in the web console as it doesn't have access to the code files and the build will fail.

@ncoghlan
Copy link
Author

ncoghlan commented Dec 2, 2016

The approach I've been taking is this:

  • use a local virtualenv & python wsgi.py for dev iterations
  • commit and do a proper deployment to update the cluster

I could do an intermediate step with oc cluster up to get a more complete deployment working locally, but the minimalist approach is actually working pretty well so far.

@ncoghlan
Copy link
Author

ncoghlan commented Dec 2, 2016

That is, deployments are a matter of:

git commit -m "Whatever I changed"
git push
oc start-build srpminfo

And then the redeployment once the build finishes is automatic.

oggo added a commit to oggo/os-py-kucera-api that referenced this issue Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants