Forums

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

ssh-run command hangs

Karen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 9, 2023

Hello. I want to run postgres migration script with bitbucket using ssh-run pipe. Command hangs after SELECT query

here is my step example:

```

- step:
          name: Run miggartion
          script:
            - pipe: atlassian/ssh-run:0.7.0
              variables:
                DEBUG: "true"
                SSH_USER: $USERNAME
                SERVER: $HOST
                COMMAND: 'sudo su - postgres -c "psql -d test -f /tmp/test.sql && echo test"'
                SSH_KEY: $KEY

```

 

Here is my migration script example:

 

```

--
-- PostgreSQL database dump
--

-- Dumped from database version 15.3 (Debian 15.3-0+deb12u1)
-- Dumped by pg_dump version 15.3 (Debian 15.3-0+deb12u1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

SET default_tablespace = '';

SET default_table_access_method = heap;

```

 

Her is log output:

```

Warning: Permanently added '1.1.1.1' (EDxxxxx) to the list of known hosts.

dumb

SET

SET

SET

SET

SET

^[=

set_config

------------

 

(1 row)

 

-- INSERT --

```

1 answer

0 votes
Karen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 10, 2023

the step is passed when i run it with script

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events