Dependencies

  • MySQL >= 5.6.4
  • ansible in &PATH
  • git >= 2.x in$PATH

Install MySQL

  • $ sudo apt-get update
  • $ sudo apt-get install mysql-server
  • $ sudo mysql_secure_installation

Install ansible

  • $ sudo apt-get install software-properties-common
  • $ sudo apt-add-repository ppa:ansible/ansible
  • $ sudo apt-get update
  • $ sudo apt-get install ansible

Install git

  • $ sudo apt-get install git

Install Semaphore

  • $ curl -L https://github.com/ansible-
    semaphore/semaphore/releases/download/v2.2.0/semaphore_linux_amd64 > /usr/bin/semaphore
  • $ chmod +x /usr/bin/semaphore
  • $ semaphore -setup
    执行semaphore -setup会让我们输入一系列信息,包括MySQL的端口号,用户名密码,数据库名。semaphore配置文件的路径,默认是/tmp/semaphore/semaphore_config.json,semaphore默认跑在本机3000端口。下面是一个默认的配置文件。
{
        "mysql": {
                "host": "127.0.0.1:3306",
                "user": "root",
                "pass": "password",
                "name": "semaphore"
        },
        "port": "",
        "bugsnag_key": "",
        "tmp_path": "/tmp/semaphore",
        "cookie_hash": "o67znYBjL8GZgWlSJf0j5+fUanmD0o/EznZqFp51LEg=",
        "cookie_encryption": "NNre4ftoV/eGSZSdvAOr46T/H1y5OONriGj6pwOzVKs="
 }

上面都设置完后,在启动前semaphore会要求我们建立一个初始用户,用来登录semaphore,然后就可以启动了。
Run Semaphore

  • $ nohup /usr/bin/semaphore -config /tmp/semaphore/semaphore_config.json &