2.44.0 • Published 8 months ago

@aeppic/install-build-server v2.44.0

Weekly downloads
32
License
MIT
Repository
-
Last release
8 months 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.44.0

8 months ago

2.43.0

9 months ago

2.38.0

9 months ago

2.41.0

9 months ago

2.39.0

9 months ago

2.37.0

9 months ago

2.42.0

9 months ago

2.40.0

9 months ago

2.29.0

11 months ago

2.25.0

11 months ago

2.27.0

11 months ago

2.32.0

10 months ago

2.34.0

10 months ago

2.30.0

11 months ago

2.19.0

12 months ago

2.17.0

12 months ago

2.36.0

10 months ago

2.15.0

1 year ago

2.20.0

12 months ago

2.22.0

11 months ago

2.28.0

11 months ago

2.24.0

11 months ago

2.26.0

11 months ago

2.31.0

10 months ago

2.33.0

10 months ago

2.18.0

12 months ago

2.35.0

10 months ago

2.16.0

12 months ago

2.21.0

11 months ago

2.23.0

11 months ago

2.14.0

1 year ago

2.13.0

1 year ago

2.11.0

1 year ago

2.12.0

1 year ago

2.10.0

1 year ago

2.9.0

1 year ago

2.8.0

1 year ago

2.7.0

1 year ago

2.6.0

1 year ago

2.5.0

1 year ago

2.4.0

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.1.0

1 year ago

2.0.0

2 years ago

1.9.8

3 years ago

1.9.7

3 years ago

1.9.6

3 years ago

1.9.5

4 years ago

1.9.4

4 years ago

1.9.3

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.3

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.1

5 years ago

1.6.2

5 years ago

1.7.0

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.1

5 years ago

1.2.0

5 years ago

1.3.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago