GithubHelp home page GithubHelp logo

How to deploy private repository about heaven HOT 8 CLOSED

atmos avatar atmos commented on August 21, 2024
How to deploy private repository

from heaven.

Comments (8)

gogames avatar gogames commented on August 21, 2024

@atmos Can you please help?

from heaven.

willdurand avatar willdurand commented on August 21, 2024

Hi @gogames. Actually, you don't need to run git clone in your Fabric since it is Heaven's responsibility to checkout (a.k.a. clone) your repository. Heaven mainly does three things:

  1. Listen to GitHub, waiting for deployment event
  2. When it receives such an event, it clones the repository
  3. Once cloned, it goes into this repository and applies the configured strategy (Fabric in your case)

So, what you should do in your deploy method is not to clone the repo, but the actual deployment process (like compiling assets, pushing the build to a server, etc.)

from heaven.

gogames avatar gogames commented on August 21, 2024

@willdurand Thank you!

How can I send the repository to remote server and then compile the project on that server? The point is I do not want to do compilation on Heaven and then push the executable file to remote server.

That would be perfect if I can have a sample fabfile.py file.

Thank you so much!

from heaven.

willdurand avatar willdurand commented on August 21, 2024

I don't use Fabric anymore unfortunately. Yet, IMO Heaven's main use case is to create a build (or artifact or executable), hence it should do compilation.

What I would do in your case would be to:

  1. git archive the current state of your repo (what Heaven cloned)
  2. Push the archive to your remote server
  3. Do compilation

Based on what you wrote here, it should work with no extra credentials, since Heaven knows how to git clone, and your Fabric should know how to ssh your remote server.

from heaven.

gogames avatar gogames commented on August 21, 2024

According to document of providers, heaven simply execute a command fab -R %{environment} %{task}:branch_name=%{ref} which means I do not have the chance to ask heaven to push the archive to remote server and do the rest.

Please correct me if I misunderstand the document.

from heaven.

gogames avatar gogames commented on August 21, 2024

The problem is simplified: how to push the archive to remote servers?.

Thanks @willdurand for help.

from heaven.

willdurand avatar willdurand commented on August 21, 2024

Well, this is your job to write the fabfile, so you can put everything you want. Here is what might work:

def deploy(branch_name):
    local('git archive --format=tar --output=/tmp/archive.tar --prefix=dist/ %s' % branch_name)
    run('scp /tmp/archive.tar user@remove_server:~/') # see also `put()`, which might be better
    run('tar xf ~/archive.tar')

    with cd('~/dist/')
        run('compile')

from heaven.

gogames avatar gogames commented on August 21, 2024

Awesome it should work! Let me close the issue now. Thank you!

from heaven.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.