From da5bbf715a9646707216307c362babc22e8ae977 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Wed, 23 Nov 2022 10:52:07 +0100 Subject: [PATCH] fix(ping/rust): Don't set PR ref for master build (#79) When building the `master` image we would previously mistakingly set the ref to the PR commit hash. This surfaced when testing a pull request from a fork. `master` would be pointed at the forks HEAD commit hash, but not the fork URL. Thus the build could not find the commit and would fail. See https://github.com/libp2p/rust-libp2p/pull/3154 --- ping/_compositions/rust-cross-versions.toml | 2 +- ping/rust/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ping/_compositions/rust-cross-versions.toml b/ping/_compositions/rust-cross-versions.toml index bc0829a..4f18e47 100644 --- a/ping/_compositions/rust-cross-versions.toml +++ b/ping/_compositions/rust-cross-versions.toml @@ -25,7 +25,7 @@ [groups.build_config.build_args] BINARY_NAME = '{{ .BinaryName }}' - GIT_REF = '{{ $.Env.GitReference }}' + GIT_REF = "master" {{ end }} {{ if $.Env.GitReference }} diff --git a/ping/rust/Dockerfile b/ping/rust/Dockerfile index b9455b2..238cdb5 100644 --- a/ping/rust/Dockerfile +++ b/ping/rust/Dockerfile @@ -11,7 +11,7 @@ ARG GIT_TARGET="" RUN if [ ! -z "${GIT_TARGET}" ]; then sed -i "s,^git.*,git = \"https://${GIT_TARGET}\"," ./plan/Cargo.toml; fi ARG GIT_REF="" -RUN if [ ! -z "${GIT_REF}" ]; then sed -i "s/^rev.*/rev = \"${GIT_REF}\"/" ./plan/Cargo.toml; fi +RUN if [ ! -z "${GIT_REF}" ]; then sed -i "s/^rev.*/branch = \"${GIT_REF}\"/" ./plan/Cargo.toml; fi # Build the requested binary: Cargo will update lockfile on changed manifest (i.e. if one of the above `sed`s patched it). ARG BINARY_NAME