2.14.0 • Published 14 days ago

@aeppic/install-build-server v2.14.0

Weekly downloads
32
License
MIT
Repository
-
Last release
14 days ago

Install

npx @aeppic/install-build-server installs or updates the a build server to version, build, and package builds.

If a secret is wanted and this is the first time running the install script you can use the parameter --gitlab-secrets-initial=XYZ to set the initial secrets that will be configured. The parameter will also overwrite any existing configuration if provided.

It automatically registers (installs) the service as a SystemD service under /etc/systemd/system but does not enable or start it yet.

The builds can be triggered via a webhook or a simple post call

Purpose

Allow gitlab pipelines to trigger executing scripts on a build server which can clone a project similar to Gitlab CI but also easily commit and push back more complicated configurations such as with @microsoft/rush

Security

Triggering can be secured with a X-Gitlab-Token which can be set in the trigger pipeline of Gitlab.

Note; The build website is publicly accessible and unsecured. Make sure there are no secrets in the build log !

Git clone. The server can only git clone projects the service account can clone via HTTP.

For now this means using git config --global credential.helper store and clone a project once manually at least.

Server prepare

The server needs to be configured with appropriate npm and git settings to read, commit and publish if the scripts to that.

Note: When run as root. Do not forget to npm config set unsafe-perm true Article

Note: Ensure these settings are reachable from the user executing the service in a NON-interactive shell. E.g. .bashrc will not be loaded when a service executes

API

Launch example server

  • PORT=8080
  • GITLAB_SECRETS=/opt/tokens.json

/opt/tokens.json contains "MY_SECRET_TOKEN"

node server.js

Trigger a build

Using a gitlab token as should be configured in the GitLab webhooks

curl -XPOST -H "Content-Type: application/json" -H "X-Gitlab-Token: MY_SECRET_TOKEN" --data @examples/pipeline-event.json http://localhost:8080/gitlab

See builds

curl http://localhost:8080/log to get a json array of recent jobs curl http://localhost:8080/retry/:id to re-run a build based on the id

http://localhost:8080 to see the UI curl http://localhost:8080/log/:id to get the build log as html curl http://localhost:8080/log/:id?wrapped to get the build log with some html wrapper

Notes

When running on Windows paths can be too long. Run git config --system core.longpaths true to ensure they work.

2.14.0

14 days ago

2.13.0

2 months ago

2.11.0

2 months ago

2.12.0

2 months ago

2.10.0

2 months ago

2.9.0

2 months ago

2.8.0

2 months ago

2.7.0

3 months ago

2.6.0

3 months ago

2.5.0

3 months ago

2.4.0

3 months ago

2.3.0

3 months ago

2.2.0

3 months ago

2.1.0

3 months ago

2.0.0

1 year ago

1.9.8

2 years ago

1.9.7

2 years ago

1.9.6

2 years ago

1.9.5

2 years ago

1.9.4

2 years ago

1.9.3

2 years ago

1.9.2

2 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.3

3 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.6.2

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.2.0

4 years ago

1.3.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago