From d537bac018f9ccba38569e48bd9659ae30c50b70 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 29 Aug 2018 17:56:35 +0200 Subject: [PATCH] Build some Rust code --- .gitignore | 1 + child-task.py | 1 - child-task.sh | 6 ++++++ decision-task.py | 2 +- something-rust/Cargo.lock | 14 ++++++++++++++ something-rust/Cargo.toml | 7 +++++++ something-rust/rust-toolchain | 1 + something-rust/src/main.rs | 3 +++ 8 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .gitignore delete mode 100644 child-task.py create mode 100755 child-task.sh create mode 100644 something-rust/Cargo.lock create mode 100644 something-rust/Cargo.toml create mode 100644 something-rust/rust-toolchain create mode 100644 something-rust/src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..eb5a316cbd1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target diff --git a/child-task.py b/child-task.py deleted file mode 100644 index 7387848f77e..00000000000 --- a/child-task.py +++ /dev/null @@ -1 +0,0 @@ -print("hello from a child task!") diff --git a/child-task.sh b/child-task.sh new file mode 100755 index 00000000000..24080bfd5d0 --- /dev/null +++ b/child-task.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y + +cd something-rust +rustup run --install cargo run diff --git a/decision-task.py b/decision-task.py index e5a4ee6bec5..dba40d7e238 100644 --- a/decision-task.py +++ b/decision-task.py @@ -30,7 +30,7 @@ payload = { git clone %(DECISION_TASK_CLONE_URL)s repo && cd repo && git checkout %(DECISION_TASK_COMMIT_SHA)s && - python2.7 child-task.py + ./child-task.sh """ % os.environ, ], }, diff --git a/something-rust/Cargo.lock b/something-rust/Cargo.lock new file mode 100644 index 00000000000..2dceb4c3e2e --- /dev/null +++ b/something-rust/Cargo.lock @@ -0,0 +1,14 @@ +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "something-rust" +version = "0.1.0" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" diff --git a/something-rust/Cargo.toml b/something-rust/Cargo.toml new file mode 100644 index 00000000000..5d54f7af454 --- /dev/null +++ b/something-rust/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "something-rust" +version = "0.1.0" +authors = ["Simon Sapin"] + +[dependencies] +matches = "0.1" diff --git a/something-rust/rust-toolchain b/something-rust/rust-toolchain new file mode 100644 index 00000000000..cfc730712d5 --- /dev/null +++ b/something-rust/rust-toolchain @@ -0,0 +1 @@ +1.28.0 diff --git a/something-rust/src/main.rs b/something-rust/src/main.rs new file mode 100644 index 00000000000..e7a11a969c0 --- /dev/null +++ b/something-rust/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}