Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

2 changed files with 18 additions and 23 deletions

View File

@ -20,7 +20,6 @@ steps:
SIZE=$(stat -c%s image.tar)
SIZE_MB=$((SIZE / 1024 / 1024))
echo "Image size: ${SIZE_MB}MB"
if [ "$SIZE_MB" -gt 150 ]; then
echo "Image too large!"
exit 1
@ -33,11 +32,9 @@ steps:
- name: push-artifact
image: alpine:latest
environment:
GITEA_TOKEN:
from_secret: GITEA_TOKEN
commands:
- apk add --no-cache git
@ -45,28 +42,26 @@ steps:
- git config --global user.email "drone@ci.local"
- git config --global user.name "Drone CI"
# Eigenes Repository mit Token clonen
- git clone https://oauth2:$GITEA_TOKEN@git.efi.th-nuernberg.de/gitea/spiesol91009/EinfuehrungInDocker_Pipeline2_OS.git
# Remote setzen
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
# In Repository wechseln
- cd EinfuehrungInDocker_Pipeline2_OS
# Repo clonen
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline
# Branch wechseln oder erstellen
- git checkout drone-artifacts || git checkout -b drone-artifacts
# Vorhandenes Artifact entfernen (falls vorhanden)
- git rm image.tar || true
# Neues Artifact kopieren
# Artifact löschen und neu hinzufügen
- git rm image.tar
- cp $DRONE_WORKSPACE/image.tar .
# Datei hinzufügen
- git add image.tar
# Commit nur bei Änderungen
# Commit nur wenn Änderungen vorhanden
- git commit -m "Add built Docker image [skip ci]" || echo "Nothing to commit"
# Branch pushen
- git push --set-upstream origin drone-artifacts
# Pull vor Push (um Konflikte zu vermeiden)
- git pull || true
# Push
- git push

View File

@ -1,8 +1,9 @@
# ---------- Build Stage ----------
FROM alpine:latest AS build
# Base-Image
FROM ubuntu:latest
# Pakete installieren
RUN apk add --no-cache build-base gcc curl vim net-tools
RUN apt-get update
RUN apt-get install -y build-essential gcc curl vim net-tools
# Arbeitsverzeichnis setzen
WORKDIR /app
@ -17,6 +18,5 @@ RUN gcc -o deployment deployment.c
RUN mkdir /output
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]