Skip to content

Deploy CLI

Repository: https://gitlab.group.team.blue/hostedshop/proj/deploy

CLI application used for deployment of code, migrations, demo deployment and shopfactory maintenance.

[smartweb@codedeploy1.shopfactory.io ~]$ sw-deploy
Smartweb Deployer - For deploying solution, syncing files and tooling 1

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help                         Displays help for a command
  list                         Lists commands
  self-update                  Update sw-deploy to other version
 config
  config:get-servers           Fetch all shopfactory servers to json
  config:update                Update config from repo
 deploy
  deploy:all-solution          Finds all not created solution and deploy them
  deploy:solution              Deploy a solution
 migrate
  migrate:all                  Migrate all solutions
  migrate:one                  Migrate one database
  migrate:status               Get status for migration
 service
  service:run                  Run deploy service that interacts with ShopFactory API
  service:test                 Send a test deploy
 shopfactory
  shopfactory:cluster-get      View detailed info about a cluster
  shopfactory:cluster-list     View all clusters
  shopfactory:jobs-status      See status for jobs
  shopfactory:solution-create  Create a solution
  shopfactory:solution-delete  Deletes a solution. OBS This cannot be undone. Deleting a solution will delete all files and the database for the solution!
  shopfactory:solution-list    Get information about a solution
  shopfactory:status-update    Change the status for a solution
  shopfactory:vhost-create     Create a Vhost
  shopfactory:vhost-delete     Deleting a vhost
 sync
  sync:change-version          Change smartweb version
  sync:run                     Syncing files to servers
  sync:servers                 Syncing files between to servers
  sync:symlinks                Creates legacy symlinks

How to update sw-deploy on codedeploy1.shopfactory.io

When a new feature is merged into master a new artifact is made. The cli have a self-update command but needs to be runned as root. The self-update just downloads the new artifact and swap its own binary. 

$ ssh zcdn@codedeploy1.shopfactory.io                                     
Last login: Thu Jan 27 11:05:33 2022

$ [zcdn@codedeploy1.shopfactory.io ~]$ s
$ [sudo] password for zcdn:
Last login: Tue Jan 25 14:05:41 CET 2022 on pts/0

$ [root@codedeploy1.shopfactory.io ~]# STORAGE_FACTORY_ACCESS_KEY=[[https://netadmin.zitcom.dk/passwords/12876]](https://netadmin.zitcom.dk/passwords/12876]) STORAGE_FACTORY_SECRET_KEY=[[https://netadmin.zitcom.dk/passwords/12876]](https://netadmin.zitcom.dk/passwords/12876]) sw-deploy self-update

# Rollback
[root@codedeploy1.shopfactory.io ~]# sw-deploy self-update --rollback

How to update demo deployers

See Demo Deployment