Git Product home page Git Product logo

heroku-buildpack-subdir-to-root's Introduction

heroku-buildpack-subdir-to-root

A simple heroku buildpack to move sub directory to root of project

This buildpack is supposed to be used as the first buildpack on your workspace containing multiple projects.

Usage

  • Add heroku-buildpack-subdir-to-root as first buildpack
heroku buildpacks:add --index 1 https://github.com/techgaun/heroku-buildpack-subdir-to-root.git --app <YOUR_APP>
  • Configure PROJECT_RELATIVE_PATH
heroku config:set PROJECT_RELATIVE_PATH=packages/adminWeb --app <YOUR_APP>
  • Configure rest of your buildpacks

  • Enjoy the working deployment

  • If something does not work, feel free to create an issue

Debugging (Not Done)

TODO

  • Configure SUBDIR_TO_ROOT_DEBUG to any value

  • Re-run deploy and the buildpack should print extra debug information

heroku-buildpack-subdir-to-root's People

Contributors

edmorley avatar jcorrado avatar techgaun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

heroku-buildpack-subdir-to-root's Issues

Buildpack incompatible with building in /app ("rm: cannot remove '/app': Read-only file system")

Hi

I'm on the team that maintains Heroku's build system and official buildpacks, and wanted to let you know about a future incompatibility with this buildpack.

The directory in which the Heroku build system performs builds is currently a path like/tmp/build_<hash>.

In the near future this path will be changing to /app so that the build-time and run-time app locations are the same path - in order to resolve a number of long standing bugs and reduce the number of hacks buildpacks have to use to work around non-relocatable languages/toolchains.

One side-effect of this build directory change is that it will no longer be possible to rm -rf $BUILD_DIR since that will now be equivalent to rm -rf /app, and due to the way slugs are mounted inside a dyno, the /app directory is read-only (not the contents of the directory, only the directory listing itself).

As such once this change comes into effect, builds using this buildpack will experience errors in the log (but the build will continue on, due to #7) like so:

remote: -----> Subdir to Root buildpack app detected
remote:        Creating temp directory
remote:        Created temp directory: /tmp/codon/tmp/cache/subrootS7COO
remote:        Moving subdir: frontend to temp dir: /tmp/codon/tmp/cache/subrootS7COO
remote:        Cleaning and re-creating build directory
remote: rm: cannot remove '/app': Read-only file system
remote:        Moving project directory from /tmp/codon/tmp/cache/subrootS7COO to /app
remote: mv: inter-device move failed: '/tmp/codon/tmp/cache/subrootS7COO/frontend' to '/app'; unable to remove target: Read-only file system
remote: -----> Discovering process types
remote:        Procfile declares types -> (none)
remote:
remote: -----> Compressing...
remote:        Done: 190B
remote: -----> Launching...
remote:        Released v4

Due to these lines:

rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
msg "Moving project directory from ${TMP_DIR} to ${BUILD_DIR}"
mv -T "${TMP_DIR}/${PROJECT_NAME}" "${BUILD_DIR}"

In order to resolve this, the buildpack needs to instead delete only the contents of the directory (and not the directory root), and adjust the mv of files back into the build directory accordingly.

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.