rustyscreeps / cargo-screeps

Build tool for deploying Rust WASM code to Screeps game servers
MIT License
25 stars 13 forks source link

Add a 'copy' deployment mode for cargo-screeps #8

Closed jrobsonchase closed 5 years ago

jrobsonchase commented 6 years ago

I often find myself wanting to deploy to a local sandbox server that I'm running, and sometimes can't be bothered to set up the authentication mod that allows for the http upload functionality to work.

It would be nice to have an option to instead have the build artifacts copied to the directory that the screeps client watches and uploads for you.

The config could be something like:

mode = "copy" # Default: copy, valid: copy|upload
branch = "default"

[upload]
username = "user"
password = "pass"
# optional:
# ptr = false
# hostname = "localhost"
# ssl = true
# port = 443

[copy]
dest = "/path/to/screeps/client/scripts" # path to directory containing the branch 
                                         # directories, configured branch should be
                                         # appended
prune = true # whether or not to clear the destination of extra files

Edit: This is probably something that I'd be willing to work on myself.

daboross commented 6 years ago

Sounds like a good feature!

If we add this, I think we should still have one "deploy" per configuration file, and only support either copy or upload sections being present, not both. Does that sound alright to you?

I've been meaning to add support for multiple configuration files, and I think it would make it less awkward to have exactly one deploy option per file. We could rename --upload to --deploy to have it make sense deploying to a local directory as well.

Edited for clarity (original message I think this could work well with also adding the ability to use multiple configuration files. Assuming we add this, `[upload]` should be completely optional when `mode = "copy"` and `[copy]` is completely optional when we add `mode = "upload"`? I think we could rename the `upload` option to `deploy`, then, and just do the configured mode.