Skip to content

Scaffold.js Work #40

@DavidWells

Description

@DavidWells

Scaffold.js is a re-implementation of these 2 bash scripts:

This bash script is responsible for the "magic" of the build image where you give it a repo and it just works ™

Under the hood it's:

  • Creating directories in the build image
  • Fetching caches dependancies & binaries from previous runs
  • Installing various versions of runtimes
  • Installing static site generator dependancies
  • Running the build.cmd (will be taken over by @netlify/build)
  • Saves the dependancies etc to cache for next run.

run-build.sh and https://github.com/netlify/netlify-build/blob/master/packages/%40netlify-build/src/scaffold.js have this logic.

We need to get the new node package working inside the https://github.com/netlify/build-image so we can continue iterating on it and eventually replace the giant bash script with maintainable node script.

I was able to get it running locally in docker, but there are some pieces that are missing in Ruby/Go installers.

docker run -it -v $PWD:/netlify/src netlify/build /bin/bash

There are also many places we can optimize this script and run things concurrently instead of everything synchronously one after the other.


TLDR;


Note: this won't run locally on a users machine, only in a CI context in a docker image. This is due to the fact it does a lot of changes to binaries, deps, etc. and we don't want to break anyone's computer 😃

Metadata

Metadata

Assignees

Labels

feat/buildstype: featurecode contributing to the implementation of a feature and/or user facing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions