Opened 2 years ago

Last modified 21 months ago

#5335 closed change

Adding dependencies and build steps to websites — at Version 4

Reported by: juliandoucette Assignee:
Priority: Unknown Milestone: Websites code sharing
Module: Sitescripts Keywords:
Cc: wspee, kvas, jsonesen, ire, saroyanm, matze, ferris, juliandoucette Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kvas)

Background

  • We would like to share SCSS across websites
  • We are currently building SCSS into CSS locally and pushing it to websites
    • Including SCSS from website-defaults, which we are installing locally via npm config

We would like to move the building step onto a staging and/or production server. The easiest (especially in terms of deployment) way to allow this is to make CMS able to perform pre-build and post-build steps. Then website authors could indicate additional actions (i.e. shell commands) to perform before and after generation and generate_static_pages.py would perform those actions during the generation process.

What to change

Introduce a configuration section into settings.ini of the website called [build-steps]. The section would have two configuration variables, each of which is interpreted as a list of strings (separated by newlines):

  • before-build -- commands to be run before the generation takes place (in the directory where the sources of the website are located).
  • after-build -- commands to be run after the generation takes place (in the directory where the output resides).

Interaction with preview

  • Preview should run the before-build steps before launching the web server.

Documentation

New section and options should be added to documentation. It should be emphasized that it's the responsibility of the website developers to ensure that the commands listed in the build steps are present on target production server and that they can be run by the CMS site generation server.

Example

[build-steps]
before-build=
    python ensure_dependencies.py
    npm install
    gulp scss
after-build= html-prettify -r *

Change History (4)

comment:1 Changed 2 years ago by juliandoucette

  • Description modified (diff)

comment:2 Changed 2 years ago by juliandoucette

  • Description modified (diff)

comment:3 Changed 2 years ago by ire

  • Cc ire added; iaderinokun removed

comment:4 Changed 2 years ago by kvas

  • Component changed from Infrastructure to Sitescripts
  • Description modified (diff)
Note: See TracTickets for help on using tickets.