Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute script on a self hosted server

김주희 October 24, 2023

Hi.

I'am running a self hosted runner.

I want to execute script in a host server, not container.

 

docker volumes - <host-server ssh-key Path>:/mnt

when i run command in a host server, docker gateway = "172.17.0.1"

docker inspect --format='{{json .NetworkSettings.Networks.bitbucket_new_default.Gateway}}' runner-name | jq

 

How can i execute command in a host server using pipelines script?

 

```

image: atlassian/default-image:4
pipelines:
  default:
    name: deploy
    runs-on: 
      - self.hosted
      - linux
      - test
    script:
      - ssh -i /mnt/id_ed25519 ubuntu@172.17.0.1 "echo test"
```

1 answer

1 accepted

0 votes
Answer accepted
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 24, 2023

G'day, @김주희 

Welcome to the community!

I assume you are using Linux docker based on the Yaml above. If yes, a limitation in Linux docker prevents the runner from accessing the host file system.

If you wish to, the options would be via SCP or Rsync if necessary.

For more information on limitations, please check our documentation:

Runner limitation 

Regards,
Syahrul

김주희 November 1, 2023

I solved.

docker volumes mount !

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events