Skip to content

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

Open

Description

@ncoghlan

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.

Activity

  1. GrahamDumpleton commented on Dec 2, 2016

    @GrahamDumpleton
    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.

  2. ncoghlan commented on Dec 2, 2016

    @ncoghlan
    Author

    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.

  3. ncoghlan commented on Dec 2, 2016

    @ncoghlan
    Author

    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.

  4. added a commit that references this issue on Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions