Skip to content

CLI application and daemon for managing BitSwan automation Servers and workspaces, written in go

License

Notifications You must be signed in to change notification settings

bitswan-space/bitswan-automation-server

Repository files navigation

Bitswan Automation Server

CLI app and daemon for managing bitswan automation server and workspace deployments

drawing drawing drawing drawing drawing drawing

Table of Contents

Features

  • Automatically set up independent bitswan automation server deployments.
  • Deployments can either connect to the bitswan.ai SaaS, use the on prem bitswan management tools or operate completely independently

Prerequisites

Before installation, make sure you have installed Docker and Docker compose. Installation guides can be found on these links :

Installation

Linux / WSL

LATEST_VERSION=$(curl -sL https://api.github.com/repos/bitswan-space/bitswan-automation-server/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')
curl -L "https://github.com/bitswan-space/bitswan-automation-server/releases/download/${LATEST_VERSION}/bitswan-automation-server-${LATEST_VERSION}-linux-amd64.tar.gz" | tar -xz

MacOS (Apple Sillicon M1+)

LATEST_VERSION=$(curl -sL https://api.github.com/repos/bitswan-space/bitswan-automation-server/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')
curl -L "https://github.com/bitswan-space/bitswan-automation-server/releases/download/${LATEST_VERSION}/bitswan-automation-server-${LATEST_VERSION}-darwin-arm.tar.gz" | tar -xz

MacOS (Intel-based)

LATEST_VERSION=$(curl -sL https://api.github.com/repos/bitswan-space/bitswan-automation-server/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')
curl -L "https://github.com/bitswan-space/bitswan-automation-server/releases/download/${LATEST_VERSION}/bitswan-automation-server-${LATEST_VERSION}-darwin-amd64.tar.gz" | tar -xz

Move the binary to a directory in your PATH

sudo mv bitswan-automation-server-<your-version> /usr/local/bin/bitswan

Alternatively, if you don't have sudo access or prefer a local installation:

mkdir -p ~/bin
mv bitswan-automation-server-<your-version> ~/bin/

#Add to PATH if using ~/bin (add this to your ~/.bashrc or ~/.zshrc)
export PATH="$HOME/bin:$PATH"

Setting up and connecting a workspace

SaaS

bitswan workspace init my-workspace

On-prem

With public domain / DNS SSL

bitswan workspace init --domain=my-workspace.bitswan.io my-workspace

With internal domain / DNS SSL

Note:

Before you initialize your workspace with an internal domain, make sure you have generated certificate for sub domain of workspace, e.g. *.my-workspace.my-domain.local. You have to specify path to the certificate and private key in init command. Certificate and private key must be in a format full-chain.pem and private-key.pem.

bitswan workspace init --domain=my-workspace.my-domain.local --certs-dir=/etc/certs my-workspace

Local dev

This is for setting up a workspace locally without first setting up a domain name or connecting to the SaaS.

Create some certs for these domains using a certificate authority you setup for yourself.

mkcert --install

Add the CA certificate to Chrome by:

  1. Navigate to chrome://settings/certificates
  2. Go to "Authorities" tab
  3. Click "Import" and select the ca.crt file
  4. Check all trust settings and click "OK"

And finally setup the workspace.

bitswan workspace init --local dev-workspace

You should be able to access the editor in chrome via https://dev-workspace-editor.bitswan.localhost.

You can get the password to the editor using the command:

bitswan workspace list --long --passwords

You can use an OAuth2 authentication to access the editor

bitswan workspace init --domain=bitswan.localhost --mkcerts dev-workspace --oauth-config <json-file>

Example of json file

{
  "oauth_issuer_url": "<your-oauth-issuer-url>/realms/<yourrealm>",
  "oauth_client_id": "<your-oauth=client-id>",
  "oauth_client_secret": "<your-client-secret>",
  "oauth_cookie_secret": "<your-cookie-secret>",
  "oauth_email_domains": ["<you can use * to allow all domains>"],
  "oauth_allowed_groups": ["<your-allowed-groups>"]
}

Remote git repository

If you wanna connect and persist your pipelines and GitOps configuration in remote git repository you can use --remote flag to specify your repository. main branch will be used to store pipelines code and each workspace will create it's own branch (e.g. my-workspace) to store their configurations.

bitswan workspace --remote=git@github.com:<your-name>/<your-repo>.git my-workspace

Contribute

If you find issues in that setup or have some nice features / improvements, I would welcome an issue or a PR :)

About

CLI application and daemon for managing BitSwan automation Servers and workspaces, written in go

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 14

Languages