GitLab CI/CD – how to use variable in command?

I wrote following pipeline: image: maven:3-openjdk-11 variables: TARGET_LOCATION: "/tmp/uploads/" stages: – deploy deploy-job: stage: deploy before_script: – export MAVEN_ARTIFACT_VERSION=$(mvn –non-recursive help:evaluate -Dexpression=project.version | grep -v ‘\[.*’| tail -1) – export MAVEN_ARTIFACT=app-${MAVEN_ARTIFACT_VERSION:+$MAVEN_ARTIFACT_VERSION.jar} script: – eval $(ssh-agent -s) (SSH STUFF HERE…) – scp -o HostKeyAlgorithms=ssh-rsa -p /builds/xxxxx/app/target/$MAVEN_ARTIFACT user@host:${TARGET_LOCATION} I expected the $MAVEN_ARTIFACT in scp command change to… Read More GitLab CI/CD – how to use variable in command?

Is there a way to provide some option to SCP to show host name or IP address while prompting for pasword

For eg: In my machine the pwd prompt is always displayed as "Password" $ scp sources/update_git.sh root@xx.213.xx.xx:/sds Password: But I need something like below $ scp sources/update_git.sh root@xx.213.xx.xx:/sds root@xx.213.xx.xx’s password: >Solution : Make sure password authentication is enabled on the server. In /etc/ssh/sshd_config: PasswordAuthentication yes On the client side, set password as the preferred method… Read More Is there a way to provide some option to SCP to show host name or IP address while prompting for pasword

Why does subprocess.call() not execute scp unless "shell=True" is included?

My program securely copies in this manner: subprocess.run(scp -P 22 username@address.com:path/to/file $HOME/Downloads). But it gives me the following error: FileNotFoundError: [Errno 2] No such file or directory: ‘scp -P 22 username@address.com:path/to/file $HOME/Downloads. However, adding shell=True like so subprocess.run(scp -P 22 username@address.com:path/to/file $HOME/Downloads, shell=True) fixes it. Why is that? Is there a way around it or… Read More Why does subprocess.call() not execute scp unless "shell=True" is included?

SCP not recognizing destination file path

I want to copy my environment files in the dir .env/ from my local machine to my remote machine. According to this answer, I tried the following but got an error: stephen@desktop:~/Projects/finance$ scp -r .env root@<MY_IP_INSTANCE>:/finance scp: /finance/.env: Not a directory I verified the directory exists on my local machine: stephen@desktop:~/Projects/finance$ ls -al | grep… Read More SCP not recognizing destination file path