#!/bin/sh # Installs 3 files: # - configuration to /etc/build-server/config.json # - build-server executable into /usr/local/bin/ # - rc-service script into /etc/init.d/build-server # # Enables and starts the service with user prompt to # update the configuration. mkdir /etc/build-server/ # Grab the binary curl -s https://build-server.build.jmh.lol/artifacts/build-main-d33a341d7efee7bfd9b80b9bb7c8b760858bba58/build-server-linux-amd64 >/usr/local/bin/build-server-tmp chmod +x /usr/local/bin/build-server-tmp # Grab the rc-service script curl -s https://build-server.build.jmh.lol/service-script >/etc/init.d/build-server chmod +x /etc/init.d/build-server # Stop the service if running rc-service build-server stop # Replace the binary with the temporary, stash previous mv /usr/local/bin/build-server /usr/local/bin/build-server.bak mv /usr/local/bin/build-server-tmp /usr/local/bin/build-server # Enable and start the service rc-update add build-server rc-service build-server start echo Edit configuration: /etc/build-server/config.json echo Then restart the service: service build-server restart echo "" echo This server will need to be provisioned with any dependencies echo required for your software. echo "" # This is specific to just the build server project: # echo Set the Git URL of the desired project, then add a Makefile # echo with the target \"build-server-artifacts\" to the project. # echo "" # echo Trigger builds via GET request: # echo curl https://yourserver.com/build?branch=main\&token=yourtoken