diff options
author | Andreas Fankhauser hiddenalpha.ch | 2024-09-30 18:49:24 +0200 |
---|---|---|
committer | Andreas Fankhauser hiddenalpha.ch | 2024-09-30 18:49:24 +0200 |
commit | 8abe4002c04c3e381d54ff57a2b7e2aaf551b7a3 (patch) | |
tree | 6f9c9e86f2731af3e5d414a16ae7e5d69aa0ceb8 /doc/note/setup/build-gateleen.txt | |
parent | 69782e8b126fdcd5b51e40773099c136e139a839 (diff) | |
parent | caf8fe34a85facf4edad8930015fbe9ae3d5f7b6 (diff) | |
download | UnspecifiedGarbage-8abe4002c04c3e381d54ff57a2b7e2aaf551b7a3.zip UnspecifiedGarbage-8abe4002c04c3e381d54ff57a2b7e2aaf551b7a3.tar.gz |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'doc/note/setup/build-gateleen.txt')
-rw-r--r-- | doc/note/setup/build-gateleen.txt | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/doc/note/setup/build-gateleen.txt b/doc/note/setup/build-gateleen.txt new file mode 100644 index 0000000..2763dae --- /dev/null +++ b/doc/note/setup/build-gateleen.txt @@ -0,0 +1,84 @@ + +Step-by-step shell snippets how to build gateleen +================================================= + + +## Alpine + + && PKGS_TO_ADD="curl maven nodejs npm redis openjdk11-jre-headless" \ + && SUDO="${HOME:?}/.local/bin/mysudo" \ + && PKGINIT=true \ + && PKGADD="$SUDO apk add" \ + && PKGCLEAN=true \ + && mkdir -p "${HOME:?}/.local/bin" \ + && printf '%s\n' '#!/bin/sh' 'printf "Sudo "' 'su root -c "$(echo "$@")"' > "${HOME:?}/.local/bin/mysudo" \ + && chmod u+x "${HOME:?}/.local/bin/mysudo" \ + + +## Generic + + && GATELEEN_GIT_TAG="v1.3.28" \ + && WORKDIR="/${HOME:?}/work" \ + && CACHE_DIR="/var/tmp" \ + + +## Setup Dependencies & get sources + + && ${PKGINIT:?} && ${PKGADD:?} $PKGS_TO_ADD \ + \ + && curl -sSL https://github.com/swisspush/gateleen/archive/refs/tags/"${GATELEEN_GIT_TAG:?}".tar.gz > "${CACHE_DIR:?}/gateleen-${GATELEEN_GIT_TAG:?}.tgz" \ + + +## Corporation specific setup + +- Configure proxy if needed. +- Configure "/home/user/.npmrc" if needed. +- Configure "/home/user/.m2/settings.xml" if needed. + + +## Make + + && mkdir -p "${WORKDIR:?}/gateleen" && cd "${WORKDIR:?}/gateleen" \ + && tar --strip-components 1 -xf "${CACHE_DIR:?}/gateleen-${GATELEEN_GIT_TAG:?}.tgz" \ + && (cd gateleen-hook-js && npm install) \ + && mkdir -p gateleen-hook-js/node/node_modules/npm/bin \ + && ln -s /usr/bin/node gateleen-hook-js/node/node \ + && printf "require('/usr/lib/node_modules/npm/lib/cli.js')\n" | tee gateleen-hook-js/node/node_modules/npm/bin/npm-cli.js >/dev/null \ + && mvn install -PpublicRepos -DskipTests -Dskip.installnodenpm -pl gateleen-hook-js \ + && mvn install -PpublicRepos -DfailIfNoTests=false \ + -pl '!gateleen-test,!gateleen-hook-js' \ + '-Dtest=!ReleaseLockLuaScriptTests,!RedisCacheStorageTest,!DeltaHandlerTest,!QueueCircuitBreakerCloseCircuitLuaScriptTests,!QueueCircuitBreakerGetAllCircuitsLuaScriptTests,!QueueCircuitBreakerHalfOpenCircuitsLuaScriptTests,!QueueCircuitBreakerReOpenCircuitLuaScriptTests,!QueueCircuitBreakerUpdateStatsLuaScriptTests,!RemoveExpiredQueuesLuaScriptTests,!StartQueueTimerLuaScriptTests' \ + && mkdir "${WORKDIR:?}/classpath" \ + && (cd gateleen-playground && mvn dependency:copy-dependencies \ + -DexcludeScope=provided -DoutputDirectory="${WORKDIR:?}/classpath/.") \ + && cp gateleen-playground/target/gateleen-playground-*.jar "${WORKDIR:?}/classpath/." \ + && mkdir "${WORKDIR:?}/etc" "${WORKDIR:?}/redis-state" \ + && printf >"${WORKDIR:?}/etc/redis.conf" '%s\n' \ + 'save ""' \ + 'appendonly yes' \ + 'appendfilename appendonly.aof' \ + && `# Squeeze those funny "static files" into redis` \ + && (cd "${WORKDIR:?}/redis-state" && redis-server "${WORKDIR:?}/etc/redis.conf" \ + & java -cp "${WORKDIR:?}/classpath/"'*' org.swisspush.gateleen.playground.Server \ + & sleep 3 \ + ) \ + && (cd "${WORKDIR:?}/gateleen" && mvn deploy -PuploadStaticFiles) \ + && (pkill -INT java || sleep 3 && pkill -TERM java || sleep 3 && pkill -9 java) \ + && pkill -INT redis-server \ + && $PKGDEL $PKGS_TO_DEL \ + && $PKGCLEAN \ + && sleep 3 \ + && (cd "${WORKDIR:?}/gateleen" && mvn clean) \ + && printf '\n DONE\n\n' \ + + +### Run + + && ip a | grep inet \ + && (true \ + && (cd "${WORKDIR:?}/redis-state" && redis-server "${WORKDIR:?}/etc/redis.conf") \ + & true \ + && cd ~ \ + && java -cp "${WORKDIR:?}/classpath/"'*' org.swisspush.gateleen.playground.Server \ + ) \ + |