From 59a649defdb2defe5c0a3d536e03caf88e3f7f78 Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Mon, 24 Feb 2020 22:51:43 -0800 Subject: [PATCH 1/6] Try setting up GitPod --- .gitpod.Dockerfile | 2 ++ .gitpod.yml | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000000..bc472872aca --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,2 @@ +FROM gitpod/workspace-full + diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000..f9e3a097b41 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +tasks: + - init: cargo build && cargo test +image: + file: .gitpod.Dockerfile +github: + prebuilds: + addCheck: true + addComment: true From 658e8106c2d9b2781cc6e446efdd1d4db31965eb Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Tue, 25 Feb 2020 07:18:36 +0000 Subject: [PATCH 2/6] Try pre-building nearcore in Docker image --- .gitpod.Dockerfile | 3 +++ .gitpod.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index bc472872aca..5e310b085e0 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,2 +1,5 @@ FROM gitpod/workspace-full +RUN rustup default nightly +RUN git clone https://github.com/nearprotocol/nearcore.git --depth 1 /nearcore +RUN cd /nearcore && cargo build \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml index f9e3a097b41..c42bd7586f2 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,5 +1,5 @@ tasks: - - init: cargo build && cargo test + - init: cp -R /nearcore/target ./target && cargo build && cargo test image: file: .gitpod.Dockerfile github: From 4a28b62c5c4263331429cb2e43f01bbe6dee20aa Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Mon, 24 Feb 2020 23:23:00 -0800 Subject: [PATCH 3/6] Remove rustup command (nightly should already be available) --- .gitpod.Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 5e310b085e0..10f58d0c147 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,5 +1,4 @@ FROM gitpod/workspace-full -RUN rustup default nightly RUN git clone https://github.com/nearprotocol/nearcore.git --depth 1 /nearcore -RUN cd /nearcore && cargo build \ No newline at end of file +RUN cd /nearcore && cargo build From 436e8cbd3fc1449649048b77bf10a63b5e5e626e Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Mon, 24 Feb 2020 23:27:18 -0800 Subject: [PATCH 4/6] Update location for nearcore prebuild --- .gitpod.Dockerfile | 4 ++-- .gitpod.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 10f58d0c147..1b1e931b73e 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full -RUN git clone https://github.com/nearprotocol/nearcore.git --depth 1 /nearcore -RUN cd /nearcore && cargo build +RUN git clone https://github.com/nearprotocol/nearcore.git --depth 1 /home/gitpod/nearcore +RUN cd /home/gitpod/nearcore && cargo build diff --git a/.gitpod.yml b/.gitpod.yml index c42bd7586f2..5f2b2a330ea 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,5 +1,5 @@ tasks: - - init: cp -R /nearcore/target ./target && cargo build && cargo test + - init: cp -R /home/gitpod/nearcore/target ./target && cargo build && cargo test image: file: .gitpod.Dockerfile github: From c1b81cf315be2603426768a429d587009e34f369 Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Mon, 24 Feb 2020 23:38:19 -0800 Subject: [PATCH 5/6] Fix the way cargo is executed in Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 1b1e931b73e..00d1a8bebaa 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full RUN git clone https://github.com/nearprotocol/nearcore.git --depth 1 /home/gitpod/nearcore -RUN cd /home/gitpod/nearcore && cargo build +RUN bash -cl "cd /home/gitpod/nearcore && cargo build" From 2314571c292253e3ca881b59e505058eb8d9174d Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Mon, 24 Feb 2020 23:46:08 -0800 Subject: [PATCH 6/6] Do cargo test as well when building docker image --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 00d1a8bebaa..b94a2d6f7ec 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full RUN git clone https://github.com/nearprotocol/nearcore.git --depth 1 /home/gitpod/nearcore -RUN bash -cl "cd /home/gitpod/nearcore && cargo build" +RUN bash -cl "cd /home/gitpod/nearcore && cargo build && cargo test"