Created
August 10, 2015 01:54
-
-
Save mnutt/64b641ca0f62e73f864e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # By default, this script does nothing. You'll have to modify it as | |
| # appropriate for your application. | |
| cd /opt/app | |
| echo "LAUNCHER STARTING" | |
| PORT=8000 node app.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @0x931fbb8c04377a42; | |
| using Spk = import "/sandstorm/package.capnp"; | |
| # This imports: | |
| # $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp | |
| # Check out that file to see the full, documented package definition format. | |
| const pkgdef :Spk.PackageDefinition = ( | |
| # The package definition. Note that the spk tool looks specifically for the | |
| # "pkgdef" constant. | |
| id = "xartmy74xuhfw2spz61vnpwfcy5mm8ncedu1fk5mt28ku1p8jnyh", | |
| # Your app ID is actually its public key. The private key was placed in | |
| # your keyring. All updates must be signed with the same key. | |
| manifest = ( | |
| # This manifest is included in your app package to tell Sandstorm | |
| # about your app. | |
| appTitle = (defaultText = "Davros"), | |
| appVersion = 0, # Increment this for every release. | |
| appMarketingVersion = (defaultText = "0.0.1"), | |
| # Human-readable representation of appVersion. Should match the way you | |
| # identify versions of your app in documentation and marketing. | |
| actions = [ | |
| # Define your "new document" handlers here. | |
| ( title = (defaultText = "New Instance"), | |
| command = .myCommand | |
| # The command to run when starting for the first time. (".myCommand" | |
| # is just a constant defined at the bottom of the file.) | |
| ) | |
| ], | |
| continueCommand = .myCommand | |
| # This is the command called to start your app back up after it has been | |
| # shut down for inactivity. Here we're using the same command as for | |
| # starting a new instance, but you could use different commands for each | |
| # case. | |
| ), | |
| sourceMap = ( | |
| # Here we defined where to look for files to copy into your package. The | |
| # `spk dev` command actually figures out what files your app needs | |
| # automatically by running it on a FUSE filesystem. So, the mappings | |
| # here are only to tell it where to find files that the app wants. | |
| searchPath = [ | |
| ( sourcePath = "." ), # Search this directory first. | |
| ( sourcePath = "/", # Then search the system root directory. | |
| hidePaths = [ "home", "proc", "sys", | |
| "etc/passwd", "etc/hosts", "etc/host.conf", | |
| "etc/nsswitch.conf", "etc/resolv.conf" ] | |
| # You probably don't want the app pulling files from these places, | |
| # so we hide them. Note that /dev, /var, and /tmp are implicitly | |
| # hidden because Sandstorm itself provides them. | |
| ) | |
| ] | |
| ), | |
| fileList = "sandstorm-files.list", | |
| # `spk dev` will write a list of all the files your app uses to this file. | |
| # You should review it later, before shipping your app. | |
| alwaysInclude = [] | |
| # Fill this list with more names of files or directories that should be | |
| # included in your package, even if not listed in sandstorm-files.list. | |
| # Use this to force-include stuff that you know you need but which may | |
| # not have been detected as a dependency during `spk dev`. If you list | |
| # a directory here, its entire contents will be included recursively. | |
| ); | |
| const myCommand :Spk.Manifest.Command = ( | |
| # Here we define the command used to start up your server. | |
| argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"], | |
| environ = [ | |
| # Note that this defines the *entire* environment seen by your app. | |
| (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin") | |
| ] | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| » vagrant-spk dev | |
| Calling 'vagrant' 'ssh' '-c' '/opt/app/.sandstorm/build.sh && cd /opt/app/.sandstorm && spk dev --pkg-def=/opt/app/.sandstorm/sandstorm-pkgdef.capnp:pkgdef' in /Users/michael/p/personal/davros/.sandstorm | |
| App is now available from Sandstorm server. Ctrl+C to disconnect. | |
| WriteResult({ "nInserted" : 1 }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment