I have this yml script for copying files to my window server:
pipelines:
default:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- pipe: atlassian/rsync-deploy:0.12.0
variables:
USER: $Ssh_Username
SERVER: $Server_Name
REMOTE_PATH: 'C:/Temp'
LOCAL_PATH: ${BITBUCKET_CLONE_DIR}
DEBUG: 'true'
EXTRA_ARGS:
- "--exclude=${BITBUCKET_CLONE_DIR}/.gitignore"
DELETE_FLAG: 'false'
I get the following error:
+ docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
--volume=/opt/atlassian/pipelines/bin/docker:/usr/local/bin/docker:ro \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/rsync-deploy:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/rsync-deploy \
--workdir=$(pwd) \
--label=org.bitbucket.pipelines.system=true \
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \
--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \
--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \
--env=BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID="$BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID" \
--env=BITBUCKET_SSH_KEY_FILE="$BITBUCKET_SSH_KEY_FILE" \
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \
--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \
--env=BITBUCKET_DEPLOYMENT_ENVIRONMENT="$BITBUCKET_DEPLOYMENT_ENVIRONMENT" \
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \
--env=CI="$CI" \
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \
--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \
--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \
--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/rsync-deploy" \
--env=DEBUG="true" \
--env=DELETE_FLAG="false" \
--env=EXTRA_ARGS_0="--exclude=${BITBUCKET_CLONE_DIR}/.gitignore" \
--env=EXTRA_ARGS_COUNT="1" \
--env=LOCAL_PATH="${BITBUCKET_CLONE_DIR}" \
--env=REMOTE_PATH="C:/Temp" \
--env=SERVER="$Server_Name" \
--env=USER="$Ssh_Username" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/rsync-deploy:0.12.0
Unable to find image 'bitbucketpipelines/rsync-deploy:0.12.0' locally
0.12.0: Pulling from bitbucketpipelines/rsync-deploy
c926b61bad3b: Pulling fs layer
3fa91154c8ba: Pulling fs layer
8b799e176331: Pulling fs layer
420363a78e8f: Pulling fs layer
420363a78e8f: Waiting
8b799e176331: Verifying Checksum
8b799e176331: Download complete
c926b61bad3b: Verifying Checksum
c926b61bad3b: Download complete
3fa91154c8ba: Verifying Checksum
3fa91154c8ba: Download complete
c926b61bad3b: Pull complete
420363a78e8f: Download complete
3fa91154c8ba: Pull complete
8b799e176331: Pull complete
420363a78e8f: Pull complete
Digest: sha256:fa49cfc31bd2a30b81a3ed79516caa198d81f27fc619920fdffca5ce6d878f67
Status: Downloaded newer image for bitbucketpipelines/rsync-deploy:0.12.0
INFO: Executing the pipe...
INFO: Enabling debug mode.
+ setup_ssh_dir
+ INJECTED_SSH_CONFIG_DIR=/opt/atlassian/pipelines/agent/ssh
+ IDENTITY_FILE=/opt/atlassian/pipelines/agent/ssh/id_rsa_tmp
+ KNOWN_HOSTS_FILE=/opt/atlassian/pipelines/agent/ssh/known_hosts
+ mkdir -p /root/.ssh
+ touch /root/.ssh/authorized_keys
+ '[' '' '!=' '' ']'
+ '[' '!' -f /opt/atlassian/pipelines/agent/ssh/id_rsa_tmp ']'
+ debug 'Using default ssh key'
+ [[ true == \t\r\u\e ]]
+ echo -e '\e[37mDEBUG: Using default ssh key\e[0m'
+ cp /opt/atlassian/pipelines/agent/ssh/id_rsa_tmp /root/.ssh/pipelines_id
DEBUG: Using default ssh key
+ '[' '!' -f /opt/atlassian/pipelines/agent/ssh/known_hosts ']'
+ cat /opt/atlassian/pipelines/agent/ssh/known_hosts
+ '[' -f /root/.ssh/config ']'
+ echo 'IdentityFile ~/.ssh/pipelines_id'
+ chmod -R go-rwx /root/.ssh/
INFO: Starting RSYNC deployment to $Server_name:C:/Temp...
+ run_pipe
+ info 'Starting RSYNC deployment to $Server_name:C:/Temp...'
+ echo -e '\e[36mINFO: Starting RSYNC deployment to $Server_name:C:/Temp...\e[0m'
+ [[ ! -z '' ]]
+ [[ ! -z '' ]]
+ run rsync -rp --exclude=./.gitignore . $Ssh_username@$Server_name:C:/Temp
++ date +%s
rsync -rp --exclude=./.gitignore . $Ssh_username@$Server_name:C:/Temp
+ output_file=/var/tmp/pipe-1708686818-32466
+ echo rsync -rp --exclude=./.gitignore . $Ssh_username@$Server_name:C:/Temp
+ set +e
+ rsync -rp --exclude=./.gitignore . $Ssh_username@$Server_name:C:/Temp
+ tee /var/tmp/pipe-1708686818-32466
'rsync' is not recognized as an internal or external command,
operable program or batch file.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.2.7]
+ status=12
+ set -e
✖ Deployment failed.
+ [[ 12 == \0 ]]
+ fail 'Deployment failed.'
+ echo -e '\e[31m✖ Deployment failed.\e[0m'
+ exit 1
112
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.