gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated (8667f5752 -> f5c99c11e)


From: gnunet
Subject: [gnunet] branch master updated (8667f5752 -> f5c99c11e)
Date: Wed, 11 Oct 2023 22:56:36 +0200

This is an automated email from the git hooks/post-receive script.

dvn pushed a change to branch master
in repository gnunet.

    from 8667f5752 Merge branch 'master' of ssh://git.gnunet.org/gnunet
     new a694bb852 ci: add initial Containerfile for CI purposes
     new ea67f52d2 ci: add script for running CI locally
     new 482cbc11a ci: add build job
     new e8d3e9dd6 ci: add debian packaging job
     new f5c99c11e ci: add package deployment job

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ci/Containerfile                    | 43 +++++++++++++++++++++++++++++++++++++
 ci/ci.sh                            | 30 ++++++++++++++++++++++++++
 ci/jobs/0-build/build.sh            | 10 +++++++++
 ci/jobs/0-build/job.sh              |  6 ++++++
 ci/jobs/2-deb-package/job.sh        | 22 +++++++++++++++++++
 ci/jobs/2-deb-package/version.sh    | 12 +++++++++++
 ci/jobs/3-deploy-package/config.ini |  5 +++++
 ci/jobs/3-deploy-package/job.sh     | 14 ++++++++++++
 8 files changed, 142 insertions(+)
 create mode 100644 ci/Containerfile
 create mode 100755 ci/ci.sh
 create mode 100755 ci/jobs/0-build/build.sh
 create mode 100755 ci/jobs/0-build/job.sh
 create mode 100755 ci/jobs/2-deb-package/job.sh
 create mode 100755 ci/jobs/2-deb-package/version.sh
 create mode 100644 ci/jobs/3-deploy-package/config.ini
 create mode 100755 ci/jobs/3-deploy-package/job.sh

diff --git a/ci/Containerfile b/ci/Containerfile
new file mode 100644
index 000000000..e0778e7b7
--- /dev/null
+++ b/ci/Containerfile
@@ -0,0 +1,43 @@
+FROM docker.io/library/debian:bookworm
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update -yqq && \
+    apt-get upgrade -yqq && \
+    apt-get install -yqq \
+                   git \
+                  autoconf \
+                  libextractor-dev \
+                  libjansson-dev \
+                  libgcrypt-dev \
+                  libqrencode-dev \
+                  libpq-dev \
+                   libmicrohttpd-dev \
+                  pkg-config \
+                   libtool \
+                   recutils \
+                  make \
+                  python3-sphinx \
+                  python3-sphinx-book-theme \
+                   texinfo \
+                  autopoint \
+                  curl \
+                   libcurl4-openssl-dev \
+                   libsodium-dev \
+                  libidn11-dev \
+                  zlib1g-dev \
+                  libunistring-dev \
+                  iptables
+
+# Debian packaging tools
+RUN apt-get install -yqq \
+                   po-debconf \
+                   build-essential \
+                   debhelper-compat \
+                   devscripts \
+                   git-buildpackage \
+   && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /workdir
+
+CMD ["/bin/bash"]
diff --git a/ci/ci.sh b/ci/ci.sh
new file mode 100755
index 000000000..7dd3a957a
--- /dev/null
+++ b/ci/ci.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+set -evuo pipefail
+
+# Use podman if available, otherwise use docker.
+# Fails if neither is found in PATH
+OCI_RUNTIME=$(which podman || which docker)
+REPO_NAME=$(basename "${PWD}")
+JOB_NAME="${1}"
+JOB_CONTAINER=$((grep CONTAINER_NAME ci/jobs/${JOB_NAME}/config.ini | cut -d' 
' -f 3) || echo "${REPO_NAME}")
+
+echo "${JOB_CONTAINER}"
+
+if [ "${JOB_CONTAINER}" = "${REPO_NAME}" ] ; then
+       "${OCI_RUNTIME}" build \
+               -t "${JOB_CONTAINER}" \
+               -f ci/Containerfile .
+fi
+
+"${OCI_RUNTIME}" run \
+       --rm \
+       -ti \
+       --env CI_COMMIT_REF="$(git rev-parse HEAD)" \
+       --volume "${PWD}":/workdir \
+       --workdir /workdir \
+       "${JOB_CONTAINER}" \
+       ci/jobs/"${JOB_NAME}"/job.sh
+
+top_dir=$(dirname "${BASH_SOURCE[0]}")
+
+#"${top_dir}"/build.sh
diff --git a/ci/jobs/0-build/build.sh b/ci/jobs/0-build/build.sh
new file mode 100755
index 000000000..a5a89ca82
--- /dev/null
+++ b/ci/jobs/0-build/build.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -exuo pipefail
+
+./bootstrap
+./configure CFLAGS="-ggdb -O0" \
+           --enable-logging=verbose \
+           --disable-doc
+
+make -j $(nproc)
+make install
diff --git a/ci/jobs/0-build/job.sh b/ci/jobs/0-build/job.sh
new file mode 100755
index 000000000..8d79902c5
--- /dev/null
+++ b/ci/jobs/0-build/job.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -exuo pipefail
+
+job_dir=$(dirname "${BASH_SOURCE[0]}")
+
+"${job_dir}"/build.sh
diff --git a/ci/jobs/2-deb-package/job.sh b/ci/jobs/2-deb-package/job.sh
new file mode 100755
index 000000000..fc1f114f4
--- /dev/null
+++ b/ci/jobs/2-deb-package/job.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -exuo pipefail
+# This file is in the public domain.
+# Helper script to build the latest DEB packages in the container.
+
+
+unset LD_LIBRARY_PATH
+
+# Install build-time dependencies.
+# Update apt cache first
+apt-get update
+mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes 
--no-install-recommends --yes' debian/control
+
+export VERSION="$(./ci/jobs/2-deb-package/version.sh)"
+echo "Building gnunet packages version ${VERSION}"
+EMAIL=none gbp dch --ignore-branch --debian-tag="%(version)s" --git-author 
--new-version="${VERSION}"
+./bootstrap
+dpkg-buildpackage -rfakeroot -b -uc -us
+
+ls -alh ../*.deb
+mkdir -p /artifacts/gnunet/${CI_COMMIT_REF} # Variable comes from CI 
environment
+mv ../*.deb /artifacts/gnunet/${CI_COMMIT_REF}/
diff --git a/ci/jobs/2-deb-package/version.sh b/ci/jobs/2-deb-package/version.sh
new file mode 100755
index 000000000..74d0099a2
--- /dev/null
+++ b/ci/jobs/2-deb-package/version.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -ex
+
+git fetch origin $(git rev-parse --abbrev-ref HEAD) --depth=1000 --tags
+RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 
HEAD)
+
+commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
+if [ "${commits}" = "0" ]; then
+    git describe --tag HEAD
+else
+    echo $(echo ${RECENT_VERSION_TAG} | cut -d'v' -f2)-${commits}-$(git 
rev-parse --short=8 HEAD)
+fi
diff --git a/ci/jobs/3-deploy-package/config.ini 
b/ci/jobs/3-deploy-package/config.ini
new file mode 100644
index 000000000..8d6409a6e
--- /dev/null
+++ b/ci/jobs/3-deploy-package/config.ini
@@ -0,0 +1,5 @@
+[build]
+HALT_ON_FAILURE = True
+WARN_ON_FAILURE = True
+CONTAINER_BUILD = False
+CONTAINER_NAME = nixery.dev/shell/rsync
diff --git a/ci/jobs/3-deploy-package/job.sh b/ci/jobs/3-deploy-package/job.sh
new file mode 100755
index 000000000..d53588a0f
--- /dev/null
+++ b/ci/jobs/3-deploy-package/job.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -exuo pipefail
+
+ARTIFACT_PATH="/artifacts/gnunet/${CI_COMMIT_REF}/*.deb"
+
+RSYNC_HOST="taler.host.internal"
+RSYNC_PORT=424242
+RSYNC_PATH="incoming_packages/bookworm-taler-ci/"
+RSYNC_DEST="rsync://${RSYNC_HOST}/${RSYNC_PATH}"
+
+
+rsync -vP \
+      --port ${RSYNC_PORT} \
+      ${ARTIFACT_PATH} ${RSYNC_DEST}

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]