ci: fix Drone parse error from empty ${} in comment
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
1 parent
083a1d5619
commit
e6f216a63d
1 file changed
+6
-7
+6
-7
@@ -164,20 +164,19 @@ steps:
|
||||
- apk add --no-cache openssh-client
|
||||
- mkdir -p /root/.ssh && chmod 700 /root/.ssh
|
||||
- printenv SSH_KEY > /root/.ssh/id_ed25519 && chmod 600 /root/.ssh/id_ed25519
|
||||
# Drone pre-expands ${VAR} (empty for secrets). Use $$ so the shell
|
||||
# reads the from_secret environment at runtime. DRONE_* stay as ${}.
|
||||
# Escape secrets as $$… so Drone does not pre-expand them to empty.
|
||||
- |
|
||||
ssh -i /root/.ssh/id_ed25519 \
|
||||
-p "$${SSH_PORT:-22}" \
|
||||
-p "$$SSH_PORT" \
|
||||
-o StrictHostKeyChecking=accept-new \
|
||||
-o BatchMode=yes \
|
||||
"$${SSH_USER}@$${SSH_HOST}" \
|
||||
"export DRONE_COMMIT_SHA='${DRONE_COMMIT_SHA}' REGISTRY_USERNAME='$${REGISTRY_USERNAME}' REGISTRY_PASSWORD='$${REGISTRY_PASSWORD}'; bash -s" <<'EOS'
|
||||
"$$SSH_USER@$$SSH_HOST" \
|
||||
"export DRONE_COMMIT_SHA='${DRONE_COMMIT_SHA}' REGISTRY_USERNAME='$$REGISTRY_USERNAME' REGISTRY_PASSWORD='$$REGISTRY_PASSWORD'; bash -s" <<'EOS'
|
||||
set -euo pipefail
|
||||
cd /opt/iled-shop
|
||||
git fetch origin
|
||||
git checkout "$${DRONE_COMMIT_SHA}"
|
||||
echo "$${REGISTRY_PASSWORD}" | docker login registry.zea.lt -u "$${REGISTRY_USERNAME}" --password-stdin
|
||||
git checkout "$$DRONE_COMMIT_SHA"
|
||||
echo "$$REGISTRY_PASSWORD" | docker login registry.zea.lt -u "$$REGISTRY_USERNAME" --password-stdin
|
||||
cd docker
|
||||
docker compose pull
|
||||
docker compose up -d --remove-orphans
|
||||
|
||||
Reference in new issue
Block a user