src-d / sourced-ce

source{d} Community Edition (CE)
https://docs.sourced.tech/community-edition
GNU General Public License v3.0
188 stars 51 forks source link

Refactor the status sub command #208

Closed carlosms closed 5 years ago

carlosms commented 5 years ago

Fix #203.

I couldn't find a way to have sourced status be a command and have sub-commands, as initially proposed. So I added sourced status all.

$ sourced status
Please specify one command of: all, components, config or workdirs
Usage:
  sourced [OPTIONS] status [status-OPTIONS] <command>

Show the list of working directories and the current deployment

Help Options:
  -h, --help                                     Show this help message

[status command options]

    Log Options:
          --log-level=[info|debug|warning|error] Logging level (default: info) [$LOG_LEVEL]
          --log-format=[text|json]               log format, defaults to text on a terminal and json otherwise [$LOG_FORMAT]
          --log-fields=                          default fields for the logger, specified in json [$LOG_FIELDS]
          --log-force-format                     ignore if it is running on a terminal or not [$LOG_FORCE_FORMAT]

Available commands:
  all         Show all the available status information
  components  Show the status of the components containers
  config      Show the configuration for the active working directory
  workdirs    List all working directories
$ sourced status all
List of all working directories:
  /home/cmartin/repos
  /home/cmartin/repos/gitbase
* bblfsh

Configuration used for the active working directory:

COMPOSE_PROJECT_NAME=srcd-YmJsZnNo
GITBASE_VOLUME_TYPE=volume
GITBASE_VOLUME_SOURCE=gitbase_repositories
GITBASE_SIVA=true
GITHUB_ORGANIZATIONS=bblfsh
GITHUB_TOKEN=xxx
NO_FORKS=true
GITBASE_LIMIT_CPU=7.9
GITCOLLECTOR_LIMIT_CPU=3.9
GITBASE_LIMIT_MEM=14869912780

Status of all components:

            Name                          Command                       State                   Ports         
--------------------------------------------------------------------------------------------------------------
srcd-ymjsznno_bblfsh-web_1     /bin/bblfsh-web -addr :808 ...   Up                      0.0.0.0:9999->8080/tcp
srcd-ymjsznno_bblfsh_1         /tini -- bblfshd                 Up                      0.0.0.0:9432->9432/tcp
srcd-ymjsznno_ghsync_1         /bin/sh -c sleep 10s && gh ...   Up                                            
srcd-ymjsznno_gitbase_1        ./init.sh                        Up                      0.0.0.0:3306->3306/tcp
srcd-ymjsznno_gitcollector_1   /bin/dumb-init -- /bin/sh  ...   Up                                            
srcd-ymjsznno_metadatadb_1     docker-entrypoint.sh postgres    Up                      0.0.0.0:5433->5432/tcp
srcd-ymjsznno_postgres_1       docker-entrypoint.sh postgres    Up                      0.0.0.0:5432->5432/tcp
srcd-ymjsznno_redis_1          docker-entrypoint.sh redis ...   Up                      0.0.0.0:6379->6379/tcp
srcd-ymjsznno_sourced-ui_1     /entrypoint.sh                   Up (health: starting)   0.0.0.0:8088->8088/tcp
carlosms commented 5 years ago

Tests updated in e0fcf78