forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Simplify artifact step
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
09f88c1463
commit
e7eaab444c
32
.drone.yml
32
.drone.yml
@ -32,36 +32,38 @@ steps:
|
||||
|
||||
- name: push-artifact
|
||||
image: alpine:latest
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
from_secret: GITEA_TOKEN
|
||||
#environment:
|
||||
#GITEA_TOKEN:
|
||||
#from_secret: GITEA_TOKEN
|
||||
commands:
|
||||
- apk add --no-cache git
|
||||
- ls -lh image.tar
|
||||
- echo "Artifact image.tar wurde erfolgreich erzeugt."
|
||||
#- apk add --no-cache git
|
||||
|
||||
# Git konfigurieren
|
||||
- git config --global user.email "drone@ci.local"
|
||||
- git config --global user.name "Drone CI"
|
||||
#- 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://oauth2:${GITEA_TOKEN}@git.efi.th-nuernberg.de/gitea/schrammlu92345/EinfuehrungInDocker_Pipeline2.git
|
||||
- cd EinfuehrungInDocker_Pipeline2
|
||||
#- git clone https://oauth2:${GITEA_TOKEN}@git.efi.th-nuernberg.de/gitea/schrammlu92345/EinfuehrungInDocker_Pipeline2.git
|
||||
#- cd EinfuehrungInDocker_Pipeline2
|
||||
|
||||
# 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
|
||||
- git rm -f image.tar || true
|
||||
- cp /drone/src/image.tar .
|
||||
- git add image.tar
|
||||
#- git rm -f image.tar || true
|
||||
#- cp /drone/src/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)
|
||||
- git pull || true
|
||||
#- git pull || true
|
||||
|
||||
# Push
|
||||
- git push https://oauth2:${GITEA_TOKEN}@git.efi.th-nuernberg.de/gitea/schrammlu92345/EinfuehrungInDocker_Pipeline2.git drone-artifacts
|
||||
#- git push https://oauth2:${GITEA_TOKEN}@git.efi.th-nuernberg.de/gitea/schrammlu92345/EinfuehrungInDocker_Pipeline2.git drone-artifacts
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user