commands:
make: !Command
description: Build the library and executables
container: xenial
run: [cargo, build]
cargo: !Command
description: Run arbitrary cargo command
container: xenial
symlink-name: cargo
run: [cargo]
test: !Command
description: Run tests
container: xenial
run: [cargo, test]
server: !Command
description: Run the server
container: xenial
run: [cargo, run, --bin, ciruela-server, "--"]
client: !Command
description: Run the client
container: xenial
run: [cargo, run, --bin, ciruela, "--"]
_example-server-dirs: !Command
description: Create dirs for example server
container: xenial
run: |
mkdir -p ./tmp/db
mkdir -p ./tmp/dest/dir1
example-server: !Command
description: Run the server
container: xenial
prerequisites: [make, _example-server-dirs]
environ: &exenv
RUST_LOG: "debug,tokio_core=warn,\
ciruela_server::peers::gossip=info,\
ciruela_server::named_mutex=info,\
tk_http::websocket::dispatcher=info"
run:
- ./target/debug/ciruela-server
- --config-base-dir=./example-configs
- --db-dir=./tmp/db
- --override-machine-id=77985419c732412ea38b94db00000001
example-upload: !Command
description: Run the upload command with example key
container: xenial
prerequisites: [make]
environ: *exenv
run:
- ./target/debug/ciruela
- upload
- --identity=ciruela-example.key
example-upload-with-env-key: !Command
description: Run the upload command with example key
container: xenial
prerequisites: [make]
accepts-arguments: true
environ: *exenv
run: |
export CIRUELA_KEY="$(cat ciruela-example.key)"
exec ./target/debug/ciruela upload "$@"
doc: !Command
description: Build documentation
container: doc
run: [make, html]
work-dir: doc
epilog: |
--------------------------------------------------------
Documentation is built under doc/_build/html/index.html
_bulk: !Command
description: Run any bulk command
container: xenial
run: [bulk]
_package-trusty: !Command
container: trusty
run: &package |
set -e
version=$(git describe --dirty)
codename=$(lsb_release --codename --short)
rm -rf pkg
rm -rf target/release/ciruela*
bulk with-version "${version}" cargo install --root=/work/pkg/usr --path=.
rm pkg/usr/.crates.toml
bulk pack --package-version="${version}+${codename}1"
_package-precise: !Command
container: precise
run: *package
_package-xenial: !Command
container: xenial
run: *package
packages: !Command
container: xenial
description: Build packages and repostories (mostly for CI)
prerequisites: [_package-trusty, _package-precise, _package-xenial]
accepts_arguments: true
run: |
bulk repo-add --config bulk.yaml --repository-base dist/repos \
dist/ciruela-[0-9]*.deb "$@"
_trio-dirs: !Command
description: Create dirs for example server
container: xenial
run: |
mkdir -p ./tmp/db1
mkdir -p ./tmp/dest1/dir1
mkdir -p ./tmp/db2
mkdir -p ./tmp/dest2/dir1
mkdir -p ./tmp/db3
mkdir -p ./tmp/dest3/dir1
trio: !Supervise
description: Runs three ciruela servers to simulate cluster
prerequisites: [make, _trio-dirs]
children:
n1: !Command
container: xenial
environ: *exenv
work-dir: tmp/dest1
network:
ip: 172.23.0.1
ports: {20001: 24783}
run:
- "/work/target/debug/ciruela-server"
- --config-base-dir=/work/example-configs3
- --db-dir=/work/tmp/db1
- --override-machine-id=77985419c732412ea38b94db00000001
- --override-hostname=n1
- --log-machine-id
n2: !Command
container: xenial
environ: *exenv
work-dir: tmp/dest2
network:
ip: 172.23.0.2
ports: {20002: 24783}
run:
- "/work/target/debug/ciruela-server"
- --config-base-dir=/work/example-configs3
- --db-dir=/work/tmp/db2
- --override-machine-id=77985419c732412ea38b94db00000002
- --override-hostname=n2
- --log-machine-id
n3: !Command
container: xenial
environ: *exenv
work-dir: tmp/dest3
network:
ip: 172.23.0.3
ports: {20003: 24783}
run:
- "/work/target/debug/ciruela-server"
- --config-base-dir=/work/example-configs3
- --db-dir=/work/tmp/db3
- --override-machine-id=77985419c732412ea38b94db00000003
- --override-hostname=n3
- --log-machine-id
containers:
xenial:
setup:
- !Ubuntu xenial
- &pkgs !Install
- ca-certificates
- git
- build-essential
- pkg-config - libssl-dev - libssh-dev - cmake - git - lsb-release - vim - gdb
- &rust !TarInstall
url: "https://static.rust-lang.org/dist/rust-1.21.0-x86_64-unknown-linux-gnu.tar.gz"
script: "./install.sh --prefix=/usr \
--components=rustc,rust-std-x86_64-unknown-linux-gnu,cargo"
- !Sh cargo install --root=/usr cargo-outdated
- &bulk !Tar
url: "https://github.com/tailhook/bulk/releases/download/v0.4.9/bulk-v0.4.9.tar.gz"
sha256: 23471a9986274bb4b7098c03e2eb7e1204171869b72c45385fcee1c64db2d111
path: /
- !EnsureDir /cargo
environ: &environ
CARGO_HOME: /cargo
RUST_BACKTRACE: 1
volumes: &volumes
/cargo: !Persistent cargo
trusty:
setup:
- !Ubuntu trusty
- *pkgs
- *rust
- *bulk
- !EnsureDir /cargo
environ: *environ
volumes: *volumes
precise:
setup:
- !Ubuntu precise
- *pkgs
- *rust
- *bulk
- !EnsureDir /cargo
environ: *environ
volumes: *volumes
doc:
setup:
- !Alpine v3.6
- !Install [alpine-base, py-sphinx, py-requests, make]