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