DEV Community

Cover image for Hey Siri, Deploy development!
Peyman Salehi
Peyman Salehi

Posted on • Updated on

Hey Siri, Deploy development!

In our company, we have a development environment that we deploy code on it multiple times in a day, and each time we must SSH to our server and run "deploy" command. In iOS 13, a new Shortcuts application added and it has a lot of automation feature that you can use it.
In this post, I want to show you how you can use it to deploy your server with this application or just by calling Siri.

Requirements

Your deployment process must not have a lot of manual processes. For example, in our situation, we use Gitlab CI and Docker Swarm.
Every time we push new code to our development branch, Gitlab CI runs and build docker images and push it into our local docker repository.
Then we SSH into our development server and run Docker Swarm deploy command to deploy new images.

Set up Shortcuts

To set up the Shortcuts app on your phone, follow these simple steps:

  1. Open Shortcuts app on your iPhone.
  2. Tap on Create Shortcut.
  3. Tap on Add Action.
  4. Select Scripting from the list.
  5. Find Run Script Over SSH and select it.
  6. In this section, you must enter your host address, SSH port, username, password(you can use SSH key either), and your deploy command. In our example, It's docker stack deploy -c ~/development.yml develop Alt Text
  7. Select a name for your action, like: Deploy development.
  8. Then, a new action adds to your shortcuts list.

Now, Call Siri to deploy your server. Hey Siri, Deploy development.


More posts in my blog - peyman.blog

Top comments (0)