forked from freudenreichan/EinfuehrungInDocker_Pipeline2
This commit is contained in:
parent
c1610ac12e
commit
8d6faa5657
12
.drone.yml
12
.drone.yml
@ -42,18 +42,20 @@ steps:
|
||||
- git config --global user.email "drone@ci.local"
|
||||
- git config --global user.name "Drone CI"
|
||||
|
||||
# Variable für die URL mit Token definieren (erleichtert Wartung)
|
||||
- export REPO_URL="https://oauth2:$$GITEA_TOKEN@git.efi.th-nuernberg.de/gitea/katzenbergeran87461/EinfuehrungInDocker_Pipeline2.git"
|
||||
|
||||
# Remote setzen
|
||||
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/katzenbergeran87461/EinfuehrungInDocker_Pipeline2
|
||||
|
||||
# Repo clonen
|
||||
- git clone https://git.efi.th-nuernberg.de/gitea/katzenbergeran87461/EinfuehrungInDocker_Pipeline2.git
|
||||
- git clone $REPO_URL
|
||||
- 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 ersetzen bzw. neu hinzufügen
|
||||
- cp $DRONE_WORKSPACE/image.tar .
|
||||
- git add image.tar
|
||||
|
||||
@ -61,7 +63,7 @@ steps:
|
||||
- git commit -m "Add built Docker image [skip ci]" || echo "Nothing to commit"
|
||||
|
||||
# Pull vor Push (um Konflikte zu vermeiden)
|
||||
- git pull || true
|
||||
- git pull $REPO_URL drone-artifacts || true
|
||||
|
||||
# Push
|
||||
- git push https://$GITEA_TOKEN@git.efi.th-nuernberg.de/katzenbergeran87461/EinfuehrungInDocker_Pipeline2.git
|
||||
- git push $REPO_URL drone-artifacts
|
||||
Loading…
x
Reference in New Issue
Block a user