Re-added fetching via the drone netrc logic
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
3c1bba7ccc
commit
6096932859
26
plugin.sh
26
plugin.sh
@ -1,7 +1,31 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
# git fetch --tags
|
|
||||||
|
if [[ ! -z "${DRONE_NETRC_MACHINE}" ]]; then
|
||||||
|
cat <<EOF > ${HOME}/.netrc
|
||||||
|
machine ${DRONE_NETRC_MACHINE}
|
||||||
|
login ${DRONE_NETRC_USERNAME}
|
||||||
|
password ${DRONE_NETRC_PASSWORD}
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${DRONE_COMMIT_AUTHOR_NAME}" ]]; then
|
||||||
|
export DRONE_COMMIT_AUTHOR_NAME=drone
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${DRONE_COMMIT_AUTHOR_EMAIL}" ]]; then
|
||||||
|
export DRONE_COMMIT_AUTHOR_EMAIL=drone@localhost
|
||||||
|
fi
|
||||||
|
|
||||||
|
export GIT_AUTHOR_NAME=${DRONE_COMMIT_AUTHOR_NAME}
|
||||||
|
export GIT_AUTHOR_EMAIL=${DRONE_COMMIT_AUTHOR_EMAIL}
|
||||||
|
export GIT_COMMITTER_NAME=${DRONE_COMMIT_AUTHOR_NAME}
|
||||||
|
export GIT_COMMITTER_EMAIL=${DRONE_COMMIT_AUTHOR_EMAIL}
|
||||||
|
|
||||||
|
git init
|
||||||
|
git remote add origin ${DRONE_REMOTE_URL}
|
||||||
|
git fetch --tags
|
||||||
|
|
||||||
CURRENTTAG=$(git tag --sort=-taggerdate | head -n 1)
|
CURRENTTAG=$(git tag --sort=-taggerdate | head -n 1)
|
||||||
PREVIOUSTAG=$(git tag --sort=-taggerdate | head -n 2 | tail -n 1)
|
PREVIOUSTAG=$(git tag --sort=-taggerdate | head -n 2 | tail -n 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user