Hey Mr Postman, be on Every Windows Machine.

Postman is probably my favorite adhoc HTTP tool for exploring API’s, testing, debugging etc etc. Often I go to some other machine, and want to test something on there. Oups: Chrome nor Postman is installed =(.
Like SSMS, I want Postman at my finger tips, on many machines. Why can’t I just type turbo run postman? That would be lovely, no?!

With V8 and Chrome to Valhalla!

With V8 and Chrome to Valhalla!

Create a Postman container

Well, at the moment there is no packaged Postman on Turbo.net’s hub. But don’t worry, you can create your own image. Let’s start. First, we could start up Chrome, navigate to the store there etc: Oh wait, we can do better. On the command line, give it the URL to open up. That URL can be a Chrome store page. Just Google for “Postman Chrome Store”, copy and paste the site’s URL and there we go:

turbo run --name=postman-chrome chrome "https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en"

This pops open the extension add dialog. Confirm the installation.

add-extension

After that, we have Chrome with Postman installed in this container. When we start this container again, Postman is installed there.

Build a Postman Image

Now, we actually want a Postman image, not Chrome with Postman installed. We can commit the container to a image and change its launch parameters to start the Postman.

Let’s do it via a Turbo script. With Turbo scripts you can script building new images. Most images on the turbo hub are actually created this way. You can look at the source for most of the images in Github https://github.com/turboapps/turbome.

Our Postman creating script will be way simpler. It can be adopted for other Chrome apps without any problems. Here it is:

# First we base our image on Chrome.
layer chrome

# Let's give the image the name roman.stoffel@gamlor.info/postman by default
# Namespace should be your account name or turbo-org account you own.
meta namespace = "roman.stoffel@gamlor.info"
meta name = "postman"

# Let's start chrome, with the Store page open. Ready to add the Postman extension
# I didn't find out how to automattically 'Accept & Add' the extension. 
# You'll have to do it manually for now
cmd ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en") 

# Ok, let's start up the Postman Chrome app.
# The app-id is the same ID you see in the URL of the Chrome app you want to add
startup file ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "--profile-directory=Default", "--app-id=fhbjgbiflinjbdggehcddcbncdddomop") 

Now, we can run this script to create our Postman image:

turbo build --no-base --overwrite postman.turbo.me

Unfortunately, I did not find out how to automate Chrome to add an extension automatically. So, you have to click ‘Add to Chrome’ and wait until it is added. Then close Chrome to continue the script.

Anyway, now you have a Postman image. Push it to the hub, so you can use it in any computer. Now you can go to any box, type in turbo run [your-account/postman into the command line, and bang, Postman will fire up.

One Postman? More Postmen!

One Postman? More Postmen!

Make It Fancy

If the image is for personal use, then you are probably already happy with the result. If you want to share this image across an organization, you might want to add some meta data. You can go to the Turbo.net hub, go to the repository of the image you just pushed. There you can add a nice icon, some explanation etc.

Adding meta data

Adding meta data

You then can use the turbo installi/subscribe commands to add the Postman image to the start menu etc. That exercise is left for you, the reader ;). Like in my example, turbo installi roman.stoffel@gamlor.info/postman