angular/aio/aio-builds-setup/docs/overview--scripts-and-commands.md
Georgios Kalpakas 8ae0eec230 feat(aio): enable previews for any PR
This commit introduces the ability to show previews for PRs by any author. It works as follows:

- The build artifacts of all PRs are uploaded to the preview server.
- Automatically verified PRs (i.e. from trusted authors or having a specific label) are deployed and
  publicly accessible as usual.
- PRs that could not be automatically verified are stored for later use (after re-verification).
- A PR can be marked as "trusted" and make its preview publicly accessible by adding the GitHub
  label specified in the `AIO_TRUSTED_PR_LABEL` env var of the preview server.

At the moment, there is no automatic mechanism for notifying the preview server about changes to the
PR's verification status. The PR's "visibility" will be checked and updated every time a new build
is uploaded.
2017-06-23 11:54:20 -07:00

2.5 KiB

Overview - Scripts and Commands

This is an overview of the available scripts and commands.

Scripts

The scripts are located inside <aio-builds-setup-dir>/scripts/. The following scripts are available:

  • create-image.sh: Can be used for creating a preconfigured docker image. See here for more info.

  • test.sh Can be used for running the tests for <aio-builds-setup-dir>/dockerbuild/scripts-js/. This is useful for CI integration. See here for more info.

  • travis-preverify-pr.sh Can be used for "pre-verifying" a PR before uploading the artifacts to the server. It checks whether the author of the PR is a member of one of the specified GitHub teams (therefore allowed to upload build artifacts) or the PR has the specified "trusted PR" label (meaning it has been manually verified by a trusted member). This is useful for CI integration. See here for more info.

  • update-preview-server.sh Can be used for updating the docker container (and image) based on the latest changes checked out from a git repository. See here for more info.

Commands

The following commands are available globally from inside the docker container. They are either used by the container to perform its various operations or can be used ad-hoc, mainly for testing purposes. Each command is backed by a corresponding script inside <aio-builds-setup-dir>/dockerbuild/scripts-sh/.

  • aio-clean-up: Cleans up the builds directory by removing the artifacts that do not correspond to an open PR. It is run as a daily cronjob.

  • aio-health-check: Runs a basic health-check, verifying that the necessary services are running, the servers are responding and there is a working internet connection. It is used periodically by docker for determining the container's health status.

  • aio-init: Initializes the container (mainly by starting the necessary services). It is run (by default) when starting the container.

  • aio-upload-server-prod: Spins up a Node.js upload-server instance. It is used in aio-init (see above) during initialization.

  • aio-upload-server-test: Spins up a Node.js upload-server instance for tests. It is used in aio-verify-setup (see below) for running tests.

  • aio-verify-setup: Runs a suite of e2e-like tests, mainly verifying the correct (inter)operation of nginx and the Node.js upload-server.