summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/note/openshift/dbg-mem-issues.txt2
-rw-r--r--doc/note/qemu/qemu.txt10
-rw-r--r--src/main/lua/git/GitflowChangelogGen.lua17
-rw-r--r--src/main/nodejs/paisa-nonslim/README.txt3
-rw-r--r--src/main/nodejs/paisa-nonslim/foo.js252
5 files changed, 280 insertions, 4 deletions
diff --git a/doc/note/openshift/dbg-mem-issues.txt b/doc/note/openshift/dbg-mem-issues.txt
index ef69f7a..c730629 100644
--- a/doc/note/openshift/dbg-mem-issues.txt
+++ b/doc/note/openshift/dbg-mem-issues.txt
@@ -113,7 +113,7 @@ true `# Get made heap dump` \
true `# Probe` \
&& stage=prod \
- && logFile="houston-ready-${stage:?}-$(date -u +%Y%m%d-%H%M%SZ).log" \
+ && logFile="houston-${stage:?}-ready-$(date -u +%Y%m%d-%H%M%SZ).log" \
&& printf 'c; when ;rspCode; connectSec; trsfSec; totlSec; curlExit\n' | tee -a "${logFile:?}" \
&& while true; do true \
&& printf 'r;%s;%7d;%11.3f;%8.3f;%8.3f;%9d\n' \
diff --git a/doc/note/qemu/qemu.txt b/doc/note/qemu/qemu.txt
index 13dc325..d4bc3aa 100644
--- a/doc/note/qemu/qemu.txt
+++ b/doc/note/qemu/qemu.txt
@@ -63,7 +63,7 @@ qemu-system-x86_64 \
`# USB pass-through` \
-usb -device usb-host,id=myUsbQemuId,vendorid=0xFFFF,productid=0xFFFF \
`# Choose ONE of those for graphic output` \
- -nographic \
+ -nographic -serial stdio \
-device VGA \
-display sdl,grab-mod=rctrl \
-display gtk,show-menubar=on \
@@ -73,6 +73,7 @@ qemu-system-x86_64 \
## Broken systems likely need some of those too
`# Fix broken hosts` \
-L "${QEMU_HOME:?}/Bios" -bios "${QEMU_HOME:?}/Bios/bios-256k.bin" \
+ -accel whpx,kernel-irqchip=off `# "https://github.com/Tech-FZ/EmuGUI/issues/72#issuecomment-1940933918"` \
`# Fix broken guests` \
-device usb-ehci,id=usb,bus=pci.0,addr=0x4 -device usb-tablet \
@@ -238,6 +239,9 @@ NOTE: Couldn't yet test any of those commands.
## Alpine PostInstall
true \
+ && `# HINT: environ setup does not work autmoatically during login. has to be sourced manually.` \
+ && P="http://10.0.2.2:3128/" \
+ && printf 'export no_proxy=127.0.0.1,10.0.2.*\nexport http_proxy=%s\nexport https_proxy=%s\n' "${P:?}" "${P:?}" >> '/etc/environment' \
&& apk add openssh-server \
&& rc-update add sshd \
&& sed -i -E 's;^# *(PermitRootLogin).+$;\1 yes;' /etc/ssh/sshd_config \
@@ -254,9 +258,9 @@ NOTE: Couldn't yet test any of those commands.
TODO: move this to a better place. Eg: debian/setup.txt or whatever.
true \
- && http_proxy= \
- && https_proxy= \
&& no_proxy=127.0.0.1,10.0.2.* \
+ && http_proxy=http://10.0.2.2:3128 \
+ && https_proxy=http://10.0.2.2:3128 \
&& SUDO= \
&& true \
&& if [ -n "$http_proxy" ]; then true \
diff --git a/src/main/lua/git/GitflowChangelogGen.lua b/src/main/lua/git/GitflowChangelogGen.lua
index 519d12b..3b44ac3 100644
--- a/src/main/lua/git/GitflowChangelogGen.lua
+++ b/src/main/lua/git/GitflowChangelogGen.lua
@@ -16,6 +16,9 @@ function printHelp()
.." --remote <str>\n"
.." Name of the git remote to use. Defaults to 'upstream'.\n"
.." \n"
+ .." --no-fetch\n"
+ .." Do NOT update refs from remote. Just use what we have local.\n"
+ .." \n"
)
end
@@ -34,6 +37,8 @@ function parseArgs( app )
iA = iA + 1; arg = _ENV.arg[iA]
if not arg then log:write("EINVAL: --remote needs value\n")return end
app.remoteName = arg
+ elseif arg == "--no-fetch" then
+ app.isFetch = false
elseif arg == "--help" then
app.isHelp = true; return 0
else
@@ -107,6 +112,17 @@ end
function run( app )
local snk = io.stdout
+ if app.isFetch then
+ -- Make sure refs are up-to-date
+ local gitFetch = "git fetch \"".. app.remoteName .."\""
+ log:write("[DEBUG] ".. gitFetch .."\n")
+ local gitFetch = io.popen(gitFetch)
+ while true do
+ local buf = gitFetch:read(1<<16)
+ if not buf then break end
+ log:write(buf)
+ end
+ end
-- Collect input
local git = "git log --date-order --first-parent --decorate --since \"".. app.since.."\""
.." \"".. app.remoteName .."/master\""
@@ -163,6 +179,7 @@ function main()
local app = {
since = false,
remoteName = false,
+ isFetch = true,
fullHistory = {},
fullHistoryRdBeg = 1,
commits = {},
diff --git a/src/main/nodejs/paisa-nonslim/README.txt b/src/main/nodejs/paisa-nonslim/README.txt
new file mode 100644
index 0000000..e3a94f7
--- /dev/null
+++ b/src/main/nodejs/paisa-nonslim/README.txt
@@ -0,0 +1,3 @@
+
+Created 20240419 as it seems we need some automation for those tasks.
+
diff --git a/src/main/nodejs/paisa-nonslim/foo.js b/src/main/nodejs/paisa-nonslim/foo.js
new file mode 100644
index 0000000..ac424c6
--- /dev/null
+++ b/src/main/nodejs/paisa-nonslim/foo.js
@@ -0,0 +1,252 @@
+;(function(){ "use-strict";
+
+ const child_process = require("child_process");
+ const promisify = require("util").promisify;
+ const zlib = require("zlib");
+ const noop = function(){};
+ const log = process.stderr;
+
+ setImmediate(main);
+
+
+ function parseArgs( argv, app ){
+ log.write("[WARN ] TODO impl parseArgs()\n");
+ return 0;
+ }
+
+
+ function workdirOfSync( app, thingyName ){
+ if( typeof thingyName !== "string" || !/^[a-z-]+$/.test(thingyName) ) throw TypeError(thingyName);
+ return "C:/work/projects/isa-svc/"+ thingyName;
+ }
+
+
+ function isWorktreeClean( app, thingyName, onDone ){
+ if( typeof onDone != "function" ) throw TypeError("onDone");
+ var child = child_process.spawn(
+ "sh", [ "-c", "git status --porcelain | grep ." ],
+ { cwd: workdirOfSync(app, thingyName), windowsHide: true, }
+ );
+ child.on("error", console.error.bind(console));
+ child.stdout.on("data", noop);
+ child.stderr.on("data", function( buf ){ log.write(buf.toString()); });
+ child.on("close", function( code, signal ){
+ if( signal !== null ){
+ throw Error("code "+ code +", signal "+ signal +"");
+ }else{
+ onDone(null, code !== 0);
+ }
+ });
+ }
+
+
+ function getDropSlimArtifactsTagInPlatformPatch( app, onDone ){
+ if( typeof onDone != "function" ) throw TypeError("onDone");
+ /* patch which empties the <slimArtifacts> tag in
+ * "poms/service/paisa-service-superpom/pom.xml" as described in
+ * SDCISA-15648 */
+ var patch = ""
+ +"tVnNcuMoEL7nKbTXzUKc2WRmQk1tZav2Ppd9AYRaEgoCCpBj79NvI0u2E9uJxUg+CJDpr4Fu+k+F"
+ +"LMuMkEqGjN9Z0/o7D24tBdxZLj0nw4j4zoLD/+McumlVlk+ZfSN1AZssL+9L8fj9cUXpt+JhxfFR"
+ +"Zver1deHhxtCyLQV3Nze3k5cxfNzRp5W9398f8puY/ste36+yT77/birDFf+rytmCqNLWXWOB2n0"
+ +"FQQ9kXUG1xkkIAtyFUmk8kq2fyNVyUWYQhh/3FiulORaADvq//iNkH9//vOTZRrW4LJCOhBBbbPO"
+ +"Q5FJnVnFQ2lcS8hEhqKm1vhAZaC9iChXMvJWvZgGce0ODxsHC6AXpuVSL4WOMhTg/VLwylSV1Iud"
+ +"zSvkCdDGVZR7iyrSsKF9BY6K0+uR49rLINcw6k++zbx1cRe7yX6yFp1h6MKCSotWo+Q+gEPbwYTi"
+ +"3rc8wMXd1TIHp3EGWePxFjwYl8RTG1DSeOrABwWBnXlHYRNolB72L66naaWWm6WWMDvbg6Iit9Zo"
+ +"GjWS7fq9dpIWAsdj5ZP3gwie5MB1F6Ty7OTNAkfYMxCmAMHejFKBlEKtRqfi2Zl3aaClVNBZZXjB"
+ +"Tl+lQUrDDt00CMV1xY4HiTA7i8nejWcFI9zK2QHZ0xNdobcCT7QJBDbSh2lMNNoHX1KoBRc1sKFN"
+ +"MPAj0H+tcbZmQzv3ZYlWfW866d50sjPm9FeAG77mG4qBlscDhRj5HBg0lpMv9H66PHuPZOPx0joE"
+ +"i+K0RoMOnvVDJbE/K2Kak76I18p2ajxx7BTxUMWLH031MCBco+LyNMP0GXZCAPQ5aPQpOWYocwBH"
+ +"rLC1b8HjC9J49+f96nJsVEOhjHhJuj9VDE5K6WuKoRzbqTqoaTgj1Z58+nXYUR7kz96/SLKY1Hea"
+ +"YpYj1yPoC3eBH71KWWUUWhQ6wm3y9HW9hUlTz1Mc2dqJ0ota0OTGezr6ln40epZFg9bI26vyoWGN"
+ +"UMRgFE764XKheb/b3t2wXTNRA0zBSUDbx/a9JM/YxAuuJN64obNELF4ZUymgMXqkJWpI3lWeRWOy"
+ +"epwGJg2tZKi7vPeFBIWOa0QkPzEoPRJ3p0gw54U9i4wHzzUocWyRa/9MzVcvAyY5/zFBOur3uRkK"
+ +"3wgZtksES2d4XmRzJnFL4GmQl1kw4RsqExj8DuleeoD9AWjMl9E0zYPpt+j5W+LRr3V+3nVimuuk"
+ +"mAkTheSIgwqDXpfqgs/hrqGWQqFi6Rdizet851pzBwUap7Ws5lzvESDezDmRY1kRE4pYQCUmj0qW"
+ +"iH6wq/0zEaAvsZWOt/Bq3AsbS27GflaVw8ixXYs053+B6a7ONxterNdcrtUctjHnHoRB4W4SkriP"
+ +"8eK3CWvcnLgp7vACGGwsOgs/ObL+ADLA1DLGB2Ao4zmxUO1TMoghYI4pyaH7SzWEMWpgn4YP0OZQ"
+ +"FGgom3YT4oTEEHpHTEc4doKbvJehtLUvcVlj1JcF9xND8igX4bo293RMp9k+r97Je2bQtKJa3inV"
+ +"47Yo52LLDt3Ee9w4g8kj2zXTU4xQm66qQ7wWnm4wUgDesqGd8Eny7t03ydurKd8SngBdyf74Q+qV"
+ +"fE3nBFw5O/4wMUer3RsAqjGhigVz+vvN/wsTxCQ="
+ ;
+ patch = Buffer.from(patch, 'base64');
+ patch = zlib.inflateRaw(patch, function( ex, patch ){
+ if( ex ){ throw ex; }
+ setImmediate(onDone, null, patch);
+ });
+ }
+
+
+ function getJettyServiceNamesAsArray( app, onDone ){
+ setImmediate(onDone, null, [ /*TODO get via args/file */
+ TODO_1zwCAF4NAgAfcAIA628CAJE4AgDnRgIA
+ ]);
+ }
+
+
+ function dropSlimFromAllJenkinsfiles( app, onDone ){
+ var iSvc = -1;
+ var jettyServices;
+ var jettyService;
+ getJettyServiceNamesAsArray(app, function( ex, jettyServices_ ){
+ if( ex ){ throw ex; }
+ jettyServices = jettyServices_;
+ nextJettyService();
+ });
+ function nextJettyService(){
+ if( ++iSvc >= jettyServices.length ){ onNoMoreJettyServices(); return; }
+ jettyService = jettyServices[iSvc];
+ isWorktreeClean(app, jettyService, onIsWorktreeCleanRsp);
+ }
+ function onIsWorktreeCleanRsp( ex, isClean ){
+ if( ex ) throw ex;
+ if( !isClean ){
+ log.write("[WARN ] Worktree not clean. Will skip: "+ jettyService +"\n");
+ nextJettyService();
+ return;
+ }
+ log.write("[DEBUG] Patching \""+ jettyService +"/Jenkinsfile\"\n");
+ var child = child_process.spawn(
+ "sed", [ "-i", "-E", "s_^(.*?buildMaven.*?),? *slim: *true,? *(.*?)$_\\1\\2_", "Jenkinsfile" ],
+ { cwd: workdirOfSync(app, jettyService) },
+ );
+ child.on("error", console.error.bind(console));
+ child.stderr.on("data", function( buf ){ log.write(buf.toString()); });
+ child.on("close", function(){
+ nextJettyService();
+ });
+ }
+ function onNoMoreJettyServices( app ){
+ onDone(null, null);
+ }
+ }
+
+
+ function checkoutUpstreamDevelop( app, thingyName, onDone){
+ var child;
+ child = child_process.spawn(
+ "sh", ["-c", "git checkout upstream/develop || git checkout origin/develop"],
+ { cwd: workdirOfSync(app, thingyName), });
+ child.on("error", console.error.bind(console));
+ child.stderr.on("data", function( buf ){ log.write(buf); });
+ child.on("close", function( code, signal ){
+ if( code !== 0 || signal !== null ){
+ onDone(Error("code "+ code +", signal "+ signal));
+ }else{
+ onDone(null, null);
+ }
+ });
+ }
+
+
+ function checkoutUpstreamDevelopForAllJettyServices( app, onDone){
+ if( typeof onDone != "function" ) throw TypeError("onDone");
+ var iSvc = -1, jettyServices, jettyService;
+ getJettyServiceNamesAsArray(app, function( ex, ret ){
+ if( ex ) throw ex;
+ jettyServices = ret;
+ nextJettyService();
+ });
+ function nextJettyService( ex ){
+ if( ex ) throw ex;
+ if( ++iSvc >= jettyServices.length ){ onDone(null, null); return; }
+ jettyService = jettyServices[iSvc];
+ log.write("[DEBUG] git checkout "+ jettyService +"\n");
+ checkoutUpstreamDevelop(app, jettyService, nextJettyService);
+ }
+ }
+
+
+ function fetchChangesFromGitit( app, thingyName, onDone ){
+ var child;
+ child = child_process.spawn(
+ "sh", ["-c", "git fetch upstream || git fetch origin"],
+ { cwd: workdirOfSync(app, thingyName), });
+ child.on("error", console.error.bind(console));
+ child.stderr.on("data", function( buf ){ log.write(buf); });
+ child.on("close", function( code, signal ){
+ if( code !== 0 || signal !== null ){
+ onDone(Error("code "+ code +", signal "+ signal));
+ }else{
+ onDone(null, null);
+ }
+ });
+ }
+
+
+ function fetchChangesFromGititForAllJettyServices( app, onDone ){
+ var iSvc = -1, jettyServices, jettyService;
+ getJettyServiceNamesAsArray(app, function( ex, ret ){
+ if( ex ) throw ex;
+ jettyServices = ret;
+ nextJettyService();
+ });
+ function nextJettyService( ex ){
+ if( ex ) throw ex;
+ if( ++iSvc >= jettyServices.length ){ onDone(null, null); return; }
+ jettyService = jettyServices[iSvc];
+ log.write("[DEBUG] git fetch "+ jettyService +"\n");
+ fetchChangesFromGitit(app, jettyService, nextJettyService);
+ }
+ }
+
+
+ function patchAwaySlimPackagingInPlatform( app, onDone ){
+ isWorktreeClean(app, "platform", function( ex, isClean ){
+ if( ex ){ throw ex; }
+ if( !isClean ){ onDone(Error("Platform worktree not clean")); return; }
+ getDropSlimArtifactsTagInPlatformPatch(app, onPatchBufReady);
+ });
+ function onPatchBufReady( ex, patch ){
+ if( ex ){ throw ex; }
+ var gitApply = child_process.spawn(
+ "sh", ["-c", "git apply"],
+ { cwd: workdirOfSync(app, "platform"), });
+ gitApply.on("error", console.error.bind(console));
+ gitApply.stderr.on("data", function( buf ){ log.write(buf.toString()); });
+ gitApply.stdout.on("data", noop);
+ gitApply.on("close", function( code, signal ){
+ if( code !== 0 || signal !== null ){ throw Error(""+ code +", "+ signal +""); }
+ onDone(null, null);
+ });
+ gitApply.stdin.write(patch);
+ gitApply.stdin.end();
+ }
+ }
+
+
+ function run( app ){
+ patchAwaySlimPackagingInPlatform(app, onPatchAwaySlimPackagingInPlatformDone);
+ function onPatchAwaySlimPackagingInPlatformDone( ex, ret ){
+ if( ex ){ log.write("[WARN ] "+ ex.message +"\n"); /*throw ex;*/ }
+ fetchChangesFromGititForAllJettyServices(app,
+ onFetchChangesFromGititForAllJettyServicesDone);
+ }
+ function onFetchChangesFromGititForAllJettyServicesDone( ex ){
+ if( ex ){ throw ex; }
+ checkoutUpstreamDevelopForAllJettyServices(app,
+ onCheckoutUpstreamDevelopForAllJettyServicesDone);
+ }
+ function onCheckoutUpstreamDevelopForAllJettyServicesDone( ex ){
+ if( ex ) throw ex;
+ dropSlimFromAllJenkinsfiles(app, onDropSlimFromAllJenkinsfilesDone);
+ }
+ function onDropSlimFromAllJenkinsfilesDone( ex ){
+ if( ex ){ throw ex; }
+ log.write("[INFO ] App done\n");
+ }
+ }
+
+
+ function main(){
+ const app = Object.seal({
+ isHelp: false,
+ maxParallel: 1,
+ });
+ if( parseArgs(process.argv, app) !== 0 ){ os.exit(1); }
+ if( app.isHelp ){ printHelp(); return; }
+ run(app);
+ }
+
+
+}());