I have a gitlab repo with CI/CD pipeline. It has deploy.sh script, which runs smoothly until envsubst command:
#!/bin/bash
set -e
<...>
# deploy via ssh
SSH="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR -l $SSH_USER
$HOST"
echo "create project dir"
$SSH "mkdir -p $PROJECT_ROOT"
echo "create env file"
envsubst < $CI_ENVIRONMENT_NAME.tmpl.env | $SSH "cat > ${PROJECT_ROOT}/${CI_ENVIRONMENT_NAME}.env"
Job fails with error:
create env file
./deploy.sh: line 65: envsubst: command not found
Headers of '.gitlab-ci.yml' file:
image: docker:latest
services:
- docker:dind
As DavidMaze pointed out, I added 'gettext' package to '.gitlab-ci.yml' file:
deploy-on-server:
stage: deploy
when: manual
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- apk update && apk add bash
- apk update && apk add gettext
<...>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With