Simplify artifact step
This commit is contained in:
parent
09f88c1463
commit
e7eaab444c
32
.drone.yml
32
.drone.yml
@ -32,36 +32,38 @@ steps:
|
|||||||
|
|
||||||
- name: push-artifact
|
- name: push-artifact
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
environment:
|
#environment:
|
||||||
GITEA_TOKEN:
|
#GITEA_TOKEN:
|
||||||
from_secret: GITEA_TOKEN
|
#from_secret: GITEA_TOKEN
|
||||||
commands:
|
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 konfigurieren
|
||||||
- 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
|
||||||
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
|
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
|
||||||
|
|
||||||
# Repo clonen
|
# Repo clonen
|
||||||
- git clone https://oauth2:${GITEA_TOKEN}@git.efi.th-nuernberg.de/gitea/schrammlu92345/EinfuehrungInDocker_Pipeline2.git
|
#- git clone https://oauth2:${GITEA_TOKEN}@git.efi.th-nuernberg.de/gitea/schrammlu92345/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 und neu hinzufügen
|
||||||
- git rm -f image.tar || true
|
#- git rm -f image.tar || true
|
||||||
- cp /drone/src/image.tar .
|
#- cp /drone/src/image.tar .
|
||||||
- git add image.tar
|
#- git add image.tar
|
||||||
|
|
||||||
# Commit nur wenn Änderungen vorhanden
|
# 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)
|
# Pull vor Push (um Konflikte zu vermeiden)
|
||||||
- git pull || true
|
#- git pull || true
|
||||||
|
|
||||||
# Push
|
# 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