forked from freudenreichan/EinfuehrungInDocker_Pipeline2
This commit is contained in:
parent
c9420bf68c
commit
13ef874674
22
.drone.yml
22
.drone.yml
@ -42,26 +42,22 @@ steps:
|
||||
- git config --global user.email "drone@ci.local"
|
||||
- git config --global user.name "Drone CI"
|
||||
|
||||
# Remote setzen
|
||||
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
|
||||
|
||||
# Repo clonen
|
||||
- git clone https://git.efi.th-nuernberg.de/gitea/niegratschkato95684/EinfuehrungInDocker_Pipeline2.git
|
||||
# Repo clonen mit Token für Schreibrechte beim Push
|
||||
- git clone https://niegratschkato95684:$${GITEA_TOKEN}@git.efi.th-nuernberg.de/gitea/niegratschkato95684/EinfuehrungInDocker_Pipeline2.git
|
||||
- cd EinfuehrungInDocker_Pipeline2
|
||||
|
||||
# Branch wechseln oder erstellen
|
||||
- git checkout drone-artifacts || git checkout -b drone-artifacts
|
||||
|
||||
# Artifact löschen und neu hinzufügen
|
||||
- git rm image.tar
|
||||
# Artifact löschen (ignoriert Fehler, falls Datei noch nicht existiert)
|
||||
- git rm image.tar || echo "image.tar not found, skipping rm"
|
||||
|
||||
# Neue Datei kopieren und hinzufügen
|
||||
- cp $DRONE_WORKSPACE/image.tar .
|
||||
- git add image.tar
|
||||
|
||||
# Commit nur wenn Änderungen vorhanden
|
||||
# Commit (ignoriert Fehler, falls keine Änderungen vorhanden sind)
|
||||
- git commit -m "Add built Docker image [skip ci]" || echo "Nothing to commit"
|
||||
|
||||
# Pull vor Push (um Konflikte zu vermeiden)
|
||||
- git pull || true
|
||||
|
||||
# Push
|
||||
- git push
|
||||
# Push explizit auf den Branch
|
||||
- git push origin drone-artifacts
|
||||
Loading…
x
Reference in New Issue
Block a user