Skip to content

Instantly share code, notes, and snippets.

@fire
Created January 22, 2024 03:06
Show Gist options
  • Select an option

  • Save fire/fcd2d7e3e10b18265fa3d5934fb2237e to your computer and use it in GitHub Desktop.

Select an option

Save fire/fcd2d7e3e10b18265fa3d5934fb2237e to your computer and use it in GitHub Desktop.

Revisions

  1. fire created this gist Jan 22, 2024.
    136 changes: 136 additions & 0 deletions test.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,136 @@
    # Proposed: Overcoming a V-Sekai limit with Documentation

    ## Metadata

    - Status: Proposed <!-- Draft | Proposed | Rejected | Accepted | Deprecated | Superseded by -->
    - Deciders: V-Sekai
    - Tags: V-Sekai

    ## The Backdrop

    ## The Challenge

    ## The Strategy

    ## GoCD Agent Setup and Automatic Startup on Boot for macOS

    Here's a step-by-step guide to setting up a GoCD agent service and configuring it to automatically start up on boot on a Mac.

    ### Initial System Boot and Account Setup

    1. Boot your freshly reset or newly bought Mac.
    2. Proceed with the initial setup, creating a user account as prompted by the macOS setup wizard.

    ### Preparing GoCD Agent

    ```shell
    # Navigate to the GoCD agent directory (assuming "go-agent-20.5.0" is the version you have).
    cd go-agent-20.5.0

    # Remove quarantine attribute from all files in the directory.
    sudo xattr -d -r com.apple.quarantine .
    ```

    ### Single Sign-On Handling

    3. If necessary, handle Single Sign-On (SSO) to ease into further installations.

    ### Xcode Installation

    4. Log in with your Apple ID to download Xcode from the App Store if required for development.

    ### Installing Homebrew and Command Line Tools

    5. Install Homebrew, the macOS package manager, which will also install the command line developer tools.

    ```shell
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    ```

    ### Installing GoCD Agent

    6. Install the GoCD agent using Homebrew or by downloading it directly from the GoCD website.

    ```shell
    # Example using Homebrew
    brew install go-agent
    ```

    ### Configuring GoCD Agent

    7. Configure the GoCD agent by editing the `wrapper-properties.conf` file.

    ```shell
    # Use your favourite text editor to modify the wrapper-properties.conf file.
    open -e ./wrapper-config/wrapper-properties.conf

    # Inside the file, set the GoCD server URL and other configurations as needed.
    ```

    ### Change GoCD Agent Server URL

    8. Update the GoCD agent server URL in the configuration file to `https://ci.v-sekai.cloud/go`.

    ```shell
    # Example entry within wrapper-properties.conf
    wrapper.app.parameter.100=-Dgocd.agent.server.url=https://ci.v-sekai.cloud/go
    ```

    ### Automating Startup

    9. To automate the GoCD agent startup on boot, create a launch daemon:

    ```shell
    sudo tee /Library/LaunchDaemons/com.gocd.agent.plist <<EOF
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.gocd.agent</string>
    <key>ProgramArguments</key>
    <array>
    <string>/Users/fire/Documents/go-agent-23.5.0/bin/go-agent</string>
    <string>start</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    </dict>
    </plist>
    EOF
    ```
    Replace `/Users/fire/Documents/go-agent-23.5.0` with the actual absolute path of the `go-agent` binary within your system.
    10. Load the newly created `com.gocd.agent.plist` to register it with launch services:
    ```shell
    sudo launchctl load /Library/LaunchDaemons/com.gocd.agent.plist
    ```
    11. Verify that the agent starts on boot:
    ```shell
    sudo launchctl list | grep com.gocd.agent
    ```
    Your GoCD agent is now configured to automatically start up as a daemon whenever your Mac boots up.
    ## The Upside
    ## The Downside
    ## The Road Not Taken
    ## The Infrequent Use Case
    ## In Core and Done by Us?
    ## Further Reading
    1. [V-Sekai · GitHub](https://github.com/v-sekai) - Official GitHub account for the V-Sekai development community focusing on social VR functionality for the Godot Engine
    2. [V-Sekai/v-sekai-game](https://github.com/v-sekai/v-sekai-game) - GitHub page for the V-Sekai open-source project bringing social VR/VRSNS/metaverse components to the Godot Engine
    AI assistant Aria assisted with this article.