Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 891 Bytes

README.md

File metadata and controls

47 lines (36 loc) · 891 Bytes

Builder daemon

This simple program is used to build our Gatsby website.

Install

  1. Install node app.

    npm install -g oikeuttaelaimille/builder
  2. Start app with systemd.

    cat > /etc/systemd/system/builder.service <<EOF
    [Unit]
    Description=Builder Service
    After=network.target
    [Service]
    Type=simple
    User=ubuntu
    Group=ubuntu
    WorkingDirectory=/tmp
    ExecStart=/usr/lib/node_modules/builder/src/index.js
    Environment=PORT=9999
    Environment=COMMAND=/home/ubuntu/scripts/build.sh
    Environment=COMMAND_WORKING_DIRECTORY=/tmp
    Environment=NODE_ENV=production
    [Install]
    WantedBy=default.target
    EOF
    
    systemctl start builder.service
    systemctl enable builder.service
  3. Add build command

    cat > /home/ubuntu/scripts/build.sh <<EOF
    
    # Your build script here.
    npx gatsby build
    
    EOF