Skip to content

Commit

Permalink
PMM-7 fix psmdb setup (#56)
Browse files Browse the repository at this point in the history
* PMM-7 fix psmdb setup

* PMM-7 fix psmdb setup

* PMM-7 fix psmdb setup

* PMM-7 fix psmdb setup

* PMM-7 fix psmdb setup

* PMM-7 fix psmdb setup

* PMM-7 fix psmdb setup

* PMM-7 fix psmdb setup

* PMM-7 fix psmdb setup
  • Loading branch information
yurkovychv committed May 14, 2024
1 parent 55eca0a commit b234eed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
10 changes: 5 additions & 5 deletions pmm_psmdb-pbm_setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ RUN set -ex; \
percona-server-mongodb-server-${PSMDB_VERSION}.el9 \
percona-server-mongodb-mongos-${PSMDB_VERSION}.el9 ; \
fi && \
if [ $PBM_VERSION == "latest" ]; then \
if [ "$PBM_VERSION" == "latest" ]; then \
yum -y install percona-backup-mongodb ; \
else \
yum -y install percona-backup-mongodb-${PBM_VERSION}.el9 ; \
fi

RUN if [[ $PMM_CLIENT_VERSION == http* ]]; then \
RUN if [[ "$PMM_CLIENT_VERSION" == http* ]]; then \
yum -y install pmm-client && \
curl -Lf -o /tmp/pmm-client.tar.gz $PMM_CLIENT_VERSION && \
cd /tmp && tar -xvf pmm-client.tar.gz --transform 's,^/*[^/]*,/pmm-client,S' && \
cd /tmp/pmm-client && ./install_tarball && cd ../ && rm -rf pmm* ;\
elif [[ "$PMM_CLIENT_VERSION" =~ 3-dev-latest|latest ]]; then \
yum -y install pmm-client ; \
elif [[ $PMM_CLIENT_VERSION =~ pmm3-rc ]]; then \
percona-release enable original testing \
yum update --refresh -y \
elif [[ "$PMM_CLIENT_VERSION" = "pmm3-rc" ]]; then \
percona-release enable original testing && \
yum update --refresh -y && \
yum -y install pmm-client ; \
else \
yum -y install pmm-client-${PMM_CLIENT_VERSION}-6.el9 ; \
Expand Down
17 changes: 5 additions & 12 deletions pmm_qa/pmm-framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def execute_shell_scripts(shell_scripts, project_relative_scripts_dir, env_vars,

# Execute each shell script
for script in shell_scripts:
result = ''
result: subprocess.CompletedProcess
try:
print(f'running script {script}')
# Change directory to where the script is located
Expand All @@ -355,20 +355,13 @@ def execute_shell_scripts(shell_scripts, project_relative_scripts_dir, env_vars,
result = subprocess.run(['bash', script], capture_output=True, text=True, check=True)
print("Output:")
print(result.stdout)
print(f"Shell script '{script}' executed successfully.")
except subprocess.CalledProcessError as e:
print("Error:")
print(e.stderr)
print(f"Shell script '{script}' failed with return code: {e.returncode}! \n {e.stderr} \n Output: \n {e.stdout} ")
exit(e.returncode)
except Exception as e:
print("Unexpected error occurred:", e)
finally:
# Get the return code of the process
return_code = result.returncode
if return_code == 0:
print(f"Shell script '{script}' executed successfully.")
else:
print(f"Shell script '{script}' failed with return code: {return_code}! \n {result.stderr}")
exit(return_code)

# Return to the original working directory
os.chdir(original_dir)

Expand Down Expand Up @@ -639,4 +632,4 @@ def setup_database(db_type, db_version=None, db_config=None, args=None):
except Exception as e:
print("An unexpected error occurred:", e)
parser.print_help()
exit(1)
exit(1)

0 comments on commit b234eed

Please sign in to comment.