git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v1 1/1] ci: facilitate dev to mimic a CI environment

From
ΣΝΣταύρος Ντέντος <stdedos@gmail.com>
Date
Mar 26, 2021, 17:05 UTC
Message-ID
<20210326170505.7771-2-stdedos+git@gmail.com>
In-Reply-To
<20210326170505.7771-1-stdedos+git@gmail.com>
From: Stavros Ntentos <133706+stdedos@users.noreply.github.com>

While trying to mimic a CI environment (to be able to locally run tests in isolation), I didn't find enough instructions how to do so - even though the project has CI set up.

Attempt to bridge the gap, by providing a starting/discussion point.
Leave instructions for people that want to
run a ci-like isolated environment locally.
---
 .../setup-local-dev-environment-docker.sh     | 43 +++++++++++++++++++
 ci/setup-local-dev-environment-docker.sh      |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 Documentation/howto/setup-local-dev-environment-docker.sh
 create mode 120000 ci/setup-local-dev-environment-docker.sh
diff --git a/Documentation/howto/setup-local-dev-environment-docker.sh b/Documentation/howto/setup-local-dev-environment-docker.sh
new file mode 100644
index 0000000000..265602ea55
--- /dev/null
+++ b/Documentation/howto/setup-local-dev-environment-docker.sh
@@ -0,0 +1,43 @@
+#!/bin/false
+
+# shellcheck shell=sh
+
+# Partially based on instructions from:
+# ci/run-docker.sh
+#
+# Note: Alpine (and consequently the other variant ["non-32-bit"]) complains of:
+# git-compat-util.h:  1139:	#error "Git requires REG_STARTEND support. Compile with NO_REGEX=NeedsStartEnd"
+# and no
+# ```bash
+# export NO_REGEX=NeedsStartEnd
+# /usr/src/git/ci/run-docker-build.sh 0
+# ```
+# helps
+
+docker run -itv "${PWD}:/usr/src/git" --entrypoint /bin/bash "daald/ubuntu32:xenial"
+
+# And then, inside, initialize with:
+
+export jobname=Linux32
+
+# Helpful initializations:
+
+cat >> ~/.gdbinit <<"EOF"
+# https://stackoverflow.com/a/3176802/2309247
+set history save on
+set history size -1
+set history filename ~/.gdb_history
+EOF
+chmod 600 ~/.gdbinit
+
+# cd to repo
+
+cd /usr/src/git/ || echo "cd error!"
+
+# In lieu of `$ make`:
+ci/run-docker-build.sh 0
+
+# # And then run a test with:
+# prove t/t6130-pathspec-noglob.sh
+# t/t6130-pathspec-noglob.sh
+# ci/run-docker-build.sh 0 && prove t/t6130-pathspec-noglob.sh
diff --git a/ci/setup-local-dev-environment-docker.sh b/ci/setup-local-dev-environment-docker.sh
new file mode 120000
index 0000000000..1c4bcc90a9
--- /dev/null
+++ b/ci/setup-local-dev-environment-docker.sh
@@ -0,0 +1 @@
+../Documentation/howto/setup-local-dev-environment-docker.sh
\ No newline at end of file
--
2.31.0
Previous: Σταύρος ΝτέντοςNext: Bagas Sanjaya
Message 2 of 4 in “ci: facilitate dev to mimic a CI environment”
  1. 0/1 ci: facilitate dev to mimic a CI environmentΣταύρος Ντέντος, Mar 26, 2021
  2. 1/1 ci: facilitate dev to mimic a CI environmentΣταύρος Ντέντος, Mar 26, 2021
  3. Bagas SanjayaMar 27, 2021
  4. Stavros NtentosMar 27, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.