简体   繁体   中英

How can I deploy my application within a cloned repository on Google App Engine?

I'm using a node package to run a web server (among other benefits) for my project. The catch is, my project is only loaded on the server if it's within a directory of the node package. In other words, my directory structure looks like this:

<npm_pkg>/
  <npm_pkg_src>/
  clients/
    <my_project_name>/
      <my_project_src>

I would like to be able to use standard deployment processes for my project (eg gcloud app deploy , Travis continuous deployment, etc.), but I need to run my project from within a subdirectory of the larger package. Is there an easy way to force a git clone <pkg> during a build step and deploy my project in the target subdirectory?

I'm pretty new to CI/CD, but I tried to search around for similar examples and couldn't find any. Note: the parent project is not owned by me and thus I can't just use submodules without forking it (and I have no intention to alter it in any way). I also strictly just want to be able to trigger deploys based on my actual project's repository, if possible, whereas submodules would involve maintaining two and committing features twice (from what I understand).

Any help is much appreciated.

Edit: I forgot to mention that as part of this configuration I also need to run my server script from the root of the parent package. IOW, my package.json 's start script will look like "start": "cd ../.. && npm start" . Just in case it's relevant.

This might be what you're looking for: CI/CD with App Engine

Clone from the repo and deploy from the subdirectory it is located, and Cloud Source Repositories can automate the whole process for you

I would also suggest you keep services separate, this will make things clearer for you and others that will/might be working on the project with you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM