Logging
All checks were successful
ci / build (push) Successful in 1m0s

This commit is contained in:
Christopher Hase 2025-03-25 15:04:48 +01:00
parent 7df9ac874e
commit a4856d9619
3 changed files with 17 additions and 7 deletions

View file

@ -1,6 +1,8 @@
# 1. Node.js Build-Stage
FROM node:20.18.1 AS build
RUN echo "Stage 1 startet"
WORKDIR /app
COPY package*.json ./
@ -10,17 +12,24 @@ RUN npm install
RUN npx tsc # TypeScript Code kompilieren
# 2. Rust Build-Stage
RUN echo "Stage 2 startet"
FROM rust:1.74.0 AS rust-build
RUN cargo install iching
# 3. Final Node.js Runtime-Stage
FROM node:20.18.1
RUN echo "Stage 3 startet"
WORKDIR /app
# 4 Copy previous builds
COPY --from=build /app .
COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching
RUN echo "Calling Broker"
CMD ["npx", "ts-node", "broker.ts"]
#CMD ["npx", "ts-node", "mailsender.ts"]

View file

@ -4,11 +4,10 @@ const nodemailer = require('nodemailer');
exec('iching divine', (error, stdout, stderr) => {
console.log(`Beginn`);
console.log(`Begin`);
if (error) {
console.error(`Fehler: ${error.message}`);
console.error(`Error: ${error.message}`);
return;
}
@ -19,6 +18,8 @@ exec('iching divine', (error, stdout, stderr) => {
//console.log(`Ergebnis:\n${stdout}`);
console.log(`Send E-Mail`);
sendEmail(stdout); //TODO: param
});
@ -28,7 +29,7 @@ const transporter = nodemailer.createTransport({
host: "mailhog.mailhog.svc.cluster.local", // MailHog ClusterIP
port: 1025, // Standard-MailHog SMTP-Port
secure: false // MailHog benötigt keine Verschlüsselung
});
});
// E-Mail senden
async function sendEmail(content: string) { //TODO: param
@ -41,9 +42,9 @@ const transporter = nodemailer.createTransport({
html: "<p> ${content} </p>"
});
console.log("E-Mail gesendet: ", info.messageId);
console.log("E-Mail sent: ", info.messageId);
} catch (error) {
console.error("Fehler beim Senden der E-Mail:", error);
console.error("Error Sending E-Mail:", error);
}
}

View file

@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: iching-broker-0-0-2
name: iching-broker-0-0-1
namespace: default
spec:
selector: