Skip to content

Commit

Permalink
Move the .sh to the .yaml workflow for pmm_ps
Browse files Browse the repository at this point in the history
  • Loading branch information
panchal-yash committed Aug 7, 2023
1 parent 057d86f commit c4ad603
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 44 deletions.
47 changes: 42 additions & 5 deletions .github/workflows/PMM_PS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,24 @@ jobs:
MS_VERSION: ${{ github.event.inputs.ms_version || '8.0.32' }}
MS_GLIBC: ${{ github.event.inputs.ms_glibc || '2.12' }}
PMM_IMAGE: ${{ github.event.inputs.pmm_image || 'perconalab/pmm-server:dev-latest' }}

steps:
- uses: actions/checkout@v2


- name: Concatenate values to environment file
run: |
echo "PS_TARBALL_PATH=https://downloads.percona.com/downloads/TESTING/ps-${{env.PS_VERSION}}/Percona-Server-${{env.PS_VERSION}}-Linux.x86_64.glibc${{env.PS_GLIBC}}.tar.gz}}" >> $GITHUB_ENV
echo "MS_TARBALL_PATH=https://dev.mysql.com/get/Downloads/MySQL-8/mysql-${{env.MS_VERSION}}-linux-glibc${{env.MS_GLIBC}}-x86_64.tar.xz" >> $GITHUB_ENV
echo "PMM_QA_REPO_URL=https://github.com/percona/pmm-qa/" >> $GITHUB_ENV
echo "PMM_QA_REPO_BRANCH=main" >> $GITHUB_ENV
- name: Check environment variable is available
run: |
echo "${{ env.PS_TARBALL_PATH }}"
echo "${{ env.MS_TARBALL_PATH }}"
echo "${{ env.PMM_QA_REPO_URL }}"
echo "${{ env.PMM_QA_REPO_BRANCH }}"
- name: Install Ansible and update the node
run: sudo apt-get update -y && sudo apt-get install ansible -y

Expand All @@ -44,7 +59,29 @@ jobs:
- name: Install PMM Client
run: sudo apt update -y && sudo apt-get upgrade -y && sudo apt-get install -y pmm2-client

- name: test-pmm-ps
run: |
chmod +x start-pmm-ps.sh && ./start-pmm-ps.sh
working-directory: ./pmm_ps_setup
- name: Delete if the Repo already checked out
run: sudo rm -r pmm-qa || true

- name: Clone the PMM_QA repo
run: git clone -b ${{ env.PMM_QA_REPO_BRANCH }} ${{ env.PMM_QA_REPO_URL }}

- name: Give write perimssion to the bash script
run: chmod +x ./pmm-tests/pmm-framework.sh
working-directory: pmm-qa

- name: Run the pmm container in backgrounds
run: docker run --detach --restart always -p 443:443 -p 80:80 --name pmm-server ${{ env.PMM_IMAGE }}

- name: setup pmm-admin config
run: sudo pmm-admin config --server-url="https://admin:admin@localhost:443" --force --log-level=debug --server-insecure-tls

- name: Run for PS tests
run: ./pmm-framework.sh --ms-version ms-${{ env.PS_VERSION }} --addclient=ms,1 --pmm2 --ms-tarball ${{ env.MS_TARBALL_PATH }}
working-directory: pmm-qa/pmm-tests

# #Run for ms version and ms client 1



# #Run for ps version and ps client 1
# ./pmm-framework.sh --ps-version ps-${{ env.PS_VERSION }} --addclient=ps,1 --pmm2 --ms-tarball ${{ env.PS_TARBALL_PATH}}
39 changes: 0 additions & 39 deletions pmm_ps_setup/start-pmm-ps.sh
Original file line number Diff line number Diff line change
@@ -1,39 +0,0 @@
#!/bin/bash

#Fetch PMM-QA Repo, this contains pmm-framework script, playbook required for the tests
#$PS_VERSION Variable will be fetched from the github actions env variable.

echo $PS_VERSION

PS_TARBALL_PATH=https://downloads.percona.com/downloads/TESTING/ps-$PS_VERSION/Percona-Server-$PS_VERSION-Linux.x86_64.glibc$PS_GLIBC.tar.gz

MS_TARBALL_PATH=https://dev.mysql.com/get/Downloads/MySQL-8/mysql-$MS_VERSION-linux-glibc$MS_GLIBC-x86_64.tar.xz

PMM_QA_REPO_URL=https://github.com/percona/pmm-qa/

PMM_QA_REPO_BRANCH=main

# Delete if the Repo already checkedout
sudo rm -r pmm-qa || true

git clone -b $PMM_QA_REPO_BRANCH $PMM_QA_REPO_URL

cd pmm-qa

# Give write perimssion to the bash script
chmod +x ./pmm-tests/pmm-framework.sh

#Run the pmm container in backgrounds
docker run --detach --restart always -p 443:443 -p 80:80 --name pmm-server $PMM_IMAGE

sudo pmm-admin config '--server-url=https://admin:admin@localhost:443' --force --log-level=debug --server-insecure-tls

#Change directory to pmm-tests
cd pmm-tests

#Run for ms version and ms client 1
./pmm-framework.sh --ms-version ms-$PS_VERSION --addclient=ms,1 --pmm2 --ms-tarball $MS_TARBALL_PATH


#Run for ps version and ps client 1
./pmm-framework.sh --ps-version ps-$PS_VERSION --addclient=ps,1 --pmm2 --ms-tarball $PS_TARBALL_PATH

0 comments on commit c4ad603

Please sign in to comment.