From dabb683955b0645c61462089af89bf022072eca9 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 22 Apr 2022 16:30:11 -0400 Subject: [PATCH] allow for running the upgrade initialization in Docker by providing a data dir --- tests/e2e/upgrade/init-e2e.Dockerfile | 2 +- tests/e2e/upgrade/main.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/e2e/upgrade/init-e2e.Dockerfile b/tests/e2e/upgrade/init-e2e.Dockerfile index 320445f85a7..34f68bd3125 100644 --- a/tests/e2e/upgrade/init-e2e.Dockerfile +++ b/tests/e2e/upgrade/init-e2e.Dockerfile @@ -20,4 +20,4 @@ COPY --from=build /osmosis/build/upgrade /bin/upgrade ENV HOME /osmosis WORKDIR $HOME -CMD [ "upgrade" ] +ENTRYPOINT [ "upgrade" ] diff --git a/tests/e2e/upgrade/main.go b/tests/e2e/upgrade/main.go index 849647edbdc..054469b1e84 100644 --- a/tests/e2e/upgrade/main.go +++ b/tests/e2e/upgrade/main.go @@ -1,6 +1,7 @@ package main import ( + "flag" "fmt" "io/ioutil" @@ -8,6 +9,14 @@ import ( ) func main() { + var dataDir string + flag.StringVar(&dataDir, "data-dir", "", "chain data directory") + flag.Parse() + + if len(dataDir) == 0 { + panic("data-dir is required") + } + tmpDir, err := ioutil.TempDir("", "osmosis-e2e-testnet-") if err != nil { panic(err)