Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-7 fix psmdb setup #56

Merged
merged 9 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading