Skip to content

Synch your config with git to Remotely manage several script-server instances #309

Open
@tristanlatr

Description

@tristanlatr

Hello,

I've been maintaining a couple instances of script-server and I'de like to share this useful script and associated JSON configuration file.

The goal is to allow several script-server instances to share configuration, having one script-server for testing purposes and the other only for production.

The trick is to store your config files in a git repository ! This enables complete remote administration (no manual SSH) of your script-server instances by storing your configuration files in a git repository and synchronize it with the provided script. Start script-server launcher.py -d /home/script-server/script-server-conf (for instance) to load a custom folder synched with git.

You can find the auto git update script that I use here https://github.com/tristanlatr/autogit

Tell me if that's useful for you :)

by default 2020-06-09 at 8 27 00 PM

{
  "name": "__Auto git administration",
  "script_path": "/home/script-server/autogit/autogit.sh",
  "working_directory": "/home/script-server/",
  "description": "Administrators can edit script configuration files with the web GUI. See [script-server manual](https://github.com/bugy/script-server/wiki/Script-config) for more informations.  \nScript-server configurations files synchronized with repository [REPO-NAME](https://REPO-URL)    \n---   \n\nUse this script to manage script-server configuration across YOUR INSTANCES .   \n    PRODUCTION script-server is on the branch **\"prod\"**   \n    TEST script-server is on the branch **\"master\"**   \nChanges should always be tested on master then merged on the \"prod\" branch manually or by doing a PR. \nUpdate **REPO-NAME**  after any changes in the local server scripts configuration.\n\n---\n\nAutomatic git update script. Update will synchronize your repository with upstream. To commit and push your changes, update with \"merge\" strategy. If you want to discard your local changes, update with \"stash\" strategy.    \n\n***See help or [autogit on github](https://github.com/tristanlatr/autogit) for more infos***    \n",
  "allowed_users": [
    "@AdminsScriptServer"
  ],
  "requires_terminal": true,
  "bash_formatting": true,
  "kill_on_disconnect": false,
  "parameters": [
    {
      "name": "Repository",
      "required": false,
      "param": "-r",
      "type": "list",
      "values": [
        "/home/script-server/script-server-conf",
        "/home/script-server/others-repositories",
        "/home/script-server/autogit"
      ]
    },
    {
      "name": "Update",
      "param": "-u",
      "type": "list",
      "description": "Synchronize  repository",
      "values": [
        "merge",
        "merge-overwrite",
        "merge-or-branch",
        "merge-or-fail",
        "merge-or-stash",
        "stash"
      ]
    },
    {
      "name": "Commit message",
      "param": "-m",
      "description": "If updating any local changes"
    },
    {
      "name": "Read-only",
      "param": "-o",
      "no_value": true,
      "default": "false",
      "description": "Will not commit or push local changes (if any)"
    },
    {
      "name": "Informations",
      "param": "-i 10",
      "no_value": true,
      "description": "Show last 10 commits informations"
    },
    {
      "name": "Checkout",
      "param": "-b",
      "type": "string",
      "description": "Switch branch"
    },
    {
      "name": "Reset to commit",
      "param": "-t",
      "type": "string",
      "description": "Hard reset"
    },
    {
      "name": "SSH key",
      "required": false,
      "param": "-k",
      "type": "list",
      "no_value": false,
      "default": "~/.ssh/bitbucket-write",
      "secure": false,
      "values": [
        "~/.ssh/bitbucket-write",  
        "~/.ssh/github-write"
      ]
    },
    {
      "name": "Git add untracked",
      "param": "-a",
      "no_value": true,
      "description": "Add all untracked files"
    },
    {
      "name": "Help",
      "param": "-h",
      "no_value": true
    }
  ]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions