I would like some help running my bitbucket pipeline ci/cd, but I am having a serious problem with the .key certificate part to access the server.
this is the output of the error:
Digest: sha256:b9111f61b5824ca7ed1cb63689a6da55ca6d6e8985eb778c36a5dfc2ffe776a8
Status: Downloaded newer image for bitbucketpipelines/scp-deploy:1.2.1
INFO: Using passed SSH_KEY...
Traceback (most recent call last):
File "/pipe.py", line 108, in <module>
pipe.run()
File "/pipe.py", line 76, in run
self.setup_ssh_config()
File "/pipe.py", line 44, in setup_ssh_config
f.write(base64.b64decode(ssh_key).decode())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x97 in position 42: invalid start byte
I put the .key certificate into a variable called $DO_KEY_QA, which is set by the pipeline
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/scp-deploy" \
--env=LOCAL_PATH="output-$BITBUCKET_BUILD_NUMBER.tar.gz" \
--env=REMOTE_PATH="/opt/tmp/" \
--env=SERVER="144.22.196.99" \
--env=SSH_KEY="$DO_KEY_QA" \
--env=USER="deploy" \
I already transformed the certificate to base64 (makes no sense at all) and it generates another error, but wasn't it supposed to accept the certificate normally as a string when reading?