Bitbucket CICD Pipeline to windows server failing

  Kiến thức lập trình

I have the following simple bitbucket-pipelines.yml script on my Pipelines Setup on Bitbucket repository:

image: node:14
pipelines:
default:
– step:
name: Install and Test
caches:
– node
script:
– npm install

- step:
    name: Deploy to Production
    deployment: production
    script:
      - pipe: atlassian/ssh-run:0.3.1
        variables:
          SSH_USER: 'User'
          SERVER: 'Server IP'
          PORT: '22'
          COMMAND: |
            ls

I just left one ‘ls’ command to test if the pipeline connects to the server and execute commands.
I successfully tested it to a linux server, but if fails when I do the same to a windows server:
. . .
3792abbfb652: Pull complete
7b3de5655a37: Pull complete
cf18df6b251d: Pull complete
Digest: sha256:ebf287d0e9559c0493b066a4429f72f5622c11b6608e002bd1d214e8c232316d
Status: Downloaded newer image for bitbucketpipelines/ssh-run:0.3.1
INFO: Executing the pipe…
INFO: Using default ssh key
INFO: Executing command on server_IP
ssh -A -tt -i /root/.ssh/pipelines_id -o StrictHostKeyChecking=no -p 22 User@Server_IP bash -c ‘ls

The file cannot be accessed by the system.
Connection to 94.200.81.190 closed.
]0;C:Windowssystem32conhost.exe✔ Execution finished.
. . .
The ssh connection is setup and there is no ssh connection or permission error.
Anyone experienced with CICD Pipeline from Bitbucket or Github to windows server machine that can help me with this challenge?

I tried various possibilities to overcome possible bash incompatibilities on windows, such as: powershell -Command,
cmd.exe /c “powershell -Command
etc.

New contributor

Dercio Anselmo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT