From 2e21956de3f974b96d2c4f29764dd91433fa0c38 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Wed, 9 Jan 2019 19:44:37 +1100 Subject: [PATCH 1/8] Added Dockerfile and Jenkinsfile. --- Dockerfile | 4 ++++ Jenkinsfile | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..891bfaeb7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM rust:latest + +RUN apt-get update && apt-get install -y clang libclang-dev + diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..1bb877a3d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,10 @@ +pipeline { + agent { dockerfile true } + stages { + stage('build') { + steps { + sh 'cargo build' + } + } + } +} From 9a0df6a9f51d4ca928ce529bb60161cb46a81df5 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Tue, 29 Jan 2019 01:05:03 +1100 Subject: [PATCH 2/8] Added a test stage to the jenkins build. --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1bb877a3d..4f4683941 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,15 @@ pipeline { agent { dockerfile true } stages { - stage('build') { + stage('Build') { steps { sh 'cargo build' } } + stage('Test') { + steps { + sh 'cargo test --all' + } + } } } From c6d3636d0d889cc79035b41be267885760b56816 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Thu, 7 Feb 2019 17:45:47 +1100 Subject: [PATCH 3/8] Included 'cmake' in Dockerfile, as it is a dependency for compiling protoc-grpcio --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 891bfaeb7..a1de57d24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM rust:latest -RUN apt-get update && apt-get install -y clang libclang-dev +RUN apt-get update && apt-get install -y clang libclang-dev cmake From b6fcb8da9431d02054d71bf000c8b09bf3112f14 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Thu, 7 Feb 2019 18:31:28 +1100 Subject: [PATCH 4/8] Added gRPC installation to the Dockerfile, as it is needed to compile. --- Dockerfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a1de57d24..162620b4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,15 @@ FROM rust:latest -RUN apt-get update && apt-get install -y clang libclang-dev cmake +RUN apt-get update && apt-get install -y clang libclang-dev cmake build-essential git unzip autoconf libtool + +RUN git clone https://github.com/google/protobuf.git && \ + cd protobuf && \ + ./autogen.sh && \ + ./configure && \ + make && \ + make install && \ + ldconfig && \ + make clean && \ + cd .. && \ + rm -r protobuf From a88e6ddbf787d504e4694e10bfe717cacef737a2 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Thu, 7 Feb 2019 22:49:51 +1100 Subject: [PATCH 5/8] Added a cargo cache to the dockerfile, so that everything isn't re-downloaded every build. --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4f4683941..42755d5f7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,10 @@ pipeline { - agent { dockerfile true } + agent { + dockerfile { + filename 'Dockerfile' + args '-v cargo-cache:/cargocache:rw -e "CARGO_HOME=/cargocache"' + } + } stages { stage('Build') { steps { From 6a68b10e02cbbd99fff8582026f40bb5624ca202 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Thu, 7 Feb 2019 22:55:26 +1100 Subject: [PATCH 6/8] Added the /cargocache file to Dockerfile to fix permissions. --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 162620b4c..be1496c00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,3 +13,5 @@ RUN git clone https://github.com/google/protobuf.git && \ cd .. && \ rm -r protobuf + +RUN mkdir /cargocache && chmod 777 /cargocache From e673ee8ce6bb6461acbb383d070f0f80d29f9a0d Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Thu, 7 Feb 2019 23:19:41 +1100 Subject: [PATCH 7/8] Updated permissions on /cargocache in Dockerfile. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index be1496c00..1c74c6716 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,4 @@ RUN git clone https://github.com/google/protobuf.git && \ rm -r protobuf -RUN mkdir /cargocache && chmod 777 /cargocache +RUN mkdir /cargocache && chmod -r ugo+rwX /cargocache From f5dae6c31aeb139e4cf62ca120393d25c6a2cc98 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Thu, 7 Feb 2019 23:22:39 +1100 Subject: [PATCH 8/8] Updated permissions on /cargocache in Dockerfile, again. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1c74c6716..063ece3cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,4 @@ RUN git clone https://github.com/google/protobuf.git && \ rm -r protobuf -RUN mkdir /cargocache && chmod -r ugo+rwX /cargocache +RUN mkdir /cargocache && chmod -R ugo+rwX /cargocache