4 Commits

Author SHA1 Message Date
e0812f28aa Output json logs except when running through cargo
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m25s
2025-04-17 16:54:37 +02:00
62a85230a9 Fixed conflict with service links
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m31s
2025-04-17 15:59:03 +02:00
13f27ef878 Improved error message when failing to parse ports
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m28s
2025-04-17 15:04:53 +02:00
6d70187560 Manifests latest tag now tracks latest tagged release instead of latest build 2025-04-17 14:32:56 +02:00
5 changed files with 22 additions and 13 deletions

View File

@@ -76,11 +76,11 @@ jobs:
- name: Push manifests
run: |
flux push artifact oci://$OCI_REPO/manifests:latest \
flux push artifact oci://$OCI_REPO/manifests:${{ gitea.head_ref || gitea.ref_name }} \
--path="./manifests.yaml" \
--source="$(git config --get remote.origin.url)" \
--revision="$(git rev-parse HEAD)" \
$(echo "${{ steps.meta.outputs.labels }}" | sed -e 's/^/-a /')
flux tag artifact oci://$OCI_REPO/manifests:latest \
flux tag artifact oci://$OCI_REPO/manifests:${{ gitea.head_ref || gitea.ref_name }} \
$(echo "${{ steps.meta.outputs.tags }}" | sed -e 's/^.*:/--tag /')

View File

@@ -17,6 +17,8 @@ spec:
annotations:
kubectl.kubernetes.io/default-container: siranga
spec:
# Service links cause issues with the HTTP_PORT and SSH_PORT env variables
enableServiceLinks: false
containers:
- name: siranga
image: git.huizinga.dev/dreaded_x/siranga@${DIGEST}

View File

@@ -10,6 +10,6 @@ spec:
kind: Rule
services:
- name: http
port: 3000
port: http
tls:
secretName: tunnel-tls

View File

@@ -4,9 +4,8 @@ metadata:
name: http
spec:
ports:
- name: "3000"
- name: http
port: 3000
targetPort: 3000
selector:
app: siranga
---
@@ -19,7 +18,7 @@ metadata:
spec:
type: LoadBalancer
ports:
- name: "2222"
- name: ssh
port: 22
targetPort: 2222
selector:

View File

@@ -24,11 +24,19 @@ async fn main() -> color_eyre::Result<()> {
let env_filter = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?;
if std::env::var("CARGO").is_ok() {
let logger = tracing_subscriber::fmt::layer().compact();
tracing_subscriber::Registry::default()
.with(logger)
.with(env_filter)
.init();
} else {
let logger = tracing_subscriber::fmt::layer().json();
tracing_subscriber::Registry::default()
.with(logger)
.with(env_filter)
.init();
}
info!(
"Starting {} ({})",
@@ -45,10 +53,10 @@ async fn main() -> color_eyre::Result<()> {
};
let http_port = std::env::var("HTTP_PORT")
.map(|port| port.parse())
.map(|port| port.parse().wrap_err_with(|| format!("HTTP_PORT={port}")))
.unwrap_or(Ok(3000))?;
let ssh_port = std::env::var("SSH_PORT")
.map(|port| port.parse())
.map(|port| port.parse().wrap_err_with(|| format!("SSH_PORT={port}")))
.unwrap_or(Ok(2222))?;
let domain =