This commit is contained in:
parent
94e5dea293
commit
f9d668d8db
24
.drone.yml
24
.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
|
# Remote setzen: Jetzt aktiv und MIT dem nötigen Token für die Anmeldung!
|
||||||
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
|
- git remote set-url origin https://$${GITEA_TOKEN}@git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
|
||||||
|
|
||||||
# Repo clonen
|
# Das fertige Image kurz zwischenspeichern, damit Git es beim Branch-Wechsel nicht löscht
|
||||||
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
|
- cp image.tar /tmp/image.tar
|
||||||
- cd EinfuehrungInDocker_Pipeline2
|
|
||||||
|
|
||||||
# Branch wechseln oder erstellen
|
# Informationen vom Server holen und in den richtigen Branch wechseln
|
||||||
|
- git fetch origin
|
||||||
- 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
|
# Das Image aus dem Zwischenspeicher zurückholen
|
||||||
|
- cp /tmp/image.tar ./image.tar
|
||||||
|
|
||||||
- git rm image.tar || true
|
# Datei für Git bereitstellen und commiten
|
||||||
- cp $DRONE_WORKSPACE/image.tar .
|
|
||||||
- git add image.tar
|
- git add image.tar
|
||||||
# Commit nur wenn Änderungen vorhanden
|
|
||||||
- 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)
|
# Sicher und direkt in dein Repository pushen
|
||||||
- git pull || true
|
|
||||||
|
|
||||||
# Push
|
|
||||||
- git push origin drone-artifacts
|
- git push origin drone-artifacts
|
||||||
Loading…
x
Reference in New Issue
Block a user