git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/1] ci: facilitate dev to mimic a CI environment
@ 2021-03-26 17:05 Σταύρος Ντέντος
  2021-03-26 17:05 ` [PATCH v1 1/1] " Σταύρος Ντέντος
  0 siblings, 1 reply; 4+ messages in thread
From: Σταύρος Ντέντος @ 2021-03-26 17:05 UTC (permalink / raw)
  To: git
  Cc: Σταύρος
	Ντέντος,
	gitster, Stavros Ntentos

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.

Stavros Ntentos (1):
  ci: facilitate dev to mimic a CI environment

 .../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

--
2.31.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/1] ci: facilitate dev to mimic a CI environment
  2021-03-26 17:05 [PATCH v1 0/1] ci: facilitate dev to mimic a CI environment Σταύρος Ντέντος
@ 2021-03-26 17:05 ` Σταύρος Ντέντος
  2021-03-27  6:52   ` Bagas Sanjaya
  0 siblings, 1 reply; 4+ messages in thread
From: Σταύρος Ντέντος @ 2021-03-26 17:05 UTC (permalink / raw)
  To: git
  Cc: Σταύρος
	Ντέντος,
	gitster, Stavros Ntentos

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] ci: facilitate dev to mimic a CI environment
  2021-03-26 17:05 ` [PATCH v1 1/1] " Σταύρος Ντέντος
@ 2021-03-27  6:52   ` Bagas Sanjaya
  2021-03-27  9:08     ` Stavros Ntentos
  0 siblings, 1 reply; 4+ messages in thread
From: Bagas Sanjaya @ 2021-03-27  6:52 UTC (permalink / raw)
  To: Σταύρος
	Ντέντος
  Cc: Σταύρος
	Ντέντος,
	gitster, git

On 27/03/21 00.05, Σταύρος Ντέντος wrote:
> 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
Wait, why did you make this documentation /bin/false script? I think
it is better to be in Asciidoc format (.txt)
> +# 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
> 

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] ci: facilitate dev to mimic a CI environment
  2021-03-27  6:52   ` Bagas Sanjaya
@ 2021-03-27  9:08     ` Stavros Ntentos
  0 siblings, 0 replies; 4+ messages in thread
From: Stavros Ntentos @ 2021-03-27  9:08 UTC (permalink / raw)
  To: bagasdotme; +Cc: git, gitster, stdedos+git

> > 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
> Wait, why did you make this documentation /bin/false script? I think
> it is better to be in Asciidoc format (.txt)

My full intention was to actually _create_ a script that would put a
wanna-be developer (me) from (a) looking at my terminal inside git/,
to (b) have a ci-like environment, inside an abstraction layer (docker)
with linked sources (i.e. the "${PWD}:/usr/src/git" part).

However, the way sources and docker invocation are defined, I find it hard
to create "the script". Also because (again) my docker knowledge is limited.

I want future nitpick-fixers (hopefully with more docker experience),
to look at this script with such agenda in mind - and not to "just"
document their findings alongside mine.

`#!/bin/false` is simply my way of saying "it's not ready to be run yet",
and I used `.sh` to get formatting / syntax highlighting cheaper than
running a fully-fledged .md file.

If you still insist it's no good as a ".sh",
my intention would be to make it .md (to get some formatting in it).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-27  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 17:05 [PATCH v1 0/1] ci: facilitate dev to mimic a CI environment Σταύρος Ντέντος
2021-03-26 17:05 ` [PATCH v1 1/1] " Σταύρος Ντέντος
2021-03-27  6:52   ` Bagas Sanjaya
2021-03-27  9:08     ` Stavros Ntentos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).