Giter VIP home page Giter VIP logo

docker-stitch-cli's Introduction

Dockerised MongoDB Stitch CLI

Introduction

This is a Dockerised version of the Mongo Stitch console.

This project will compile the Stitch binary and let you run it without any Go or NPM dependency issues. It also offers the security isolation of containers.

Usage

To build the image:

docker build -t stitch-cli .

To run the image:

docker run -it --rm stitch-cli --help

You will need to add a volume statement to the run command for the import/export commands, so that your project can be read or written.

The command saves authentication data in ~/.config/stitch/stitch, so you will need to set up a folder volume for that too.

So, a workflow could look like this (uses Bash backticks - amend this on other operating systems):

# Log in
docker run --rm -it --volume=`echo $HOME`/.config/stitch:/root/.config/stitch stitch-cli login [email protected] --api-key=01234567-abcd-efgh-ijkl-mnopqrstuvwx

# Check you're logged in
docker run --rm -it --volume=`echo $HOME`/.config/stitch:/root/.config/stitch stitch-cli whoami

# Import to Stitch, assumes you're in a local Stitch project folder
docker run --rm -it --volume=`echo $HOME`/.config/stitch:/root/.config/stitch --volume=`pwd`:/project stitch-cli import --strategy=merge

# Export from Stitch, this will copy it to `pwd`/export/app on the host
docker run --rm -it --volume=`echo $HOME`/.config/stitch:/root/.config/stitch --volume=`pwd`/export:/export stitch-cli export --app-id=stackwatcher-prod-keysc --output /export/app

Status

This has not been through much testing, but I will update these docs as I make use of it. I am also not a Go programmer, so there are undoubtedly better ways to build.

Future expansion

Some use of Docker Compose would be nice here, to remove the need to add volume specs on everything.

Also the export should really overwrite the on-host project automatically. That's possible with some shell scripting; on its own, the export command requires the output folder to not exist.

docker-stitch-cli's People

Contributors

halfer avatar mwmahlberg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.