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 Move build-submodules script to monorepo #3184

Merged
merged 2 commits into from
Aug 28, 2024
Merged
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
44 changes: 21 additions & 23 deletions build/scripts/build-submodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#!/bin/bash
set -o errexit

git submodule update --init --jobs 10
git submodule status

if [ -s ci.yml ]; then
sudo rm -rf results tmp || :
if [ -f /home/ec2-user/venv/bin/activate ]; then
source /home/ec2-user/venv/bin/activate
fi
python3 ci.py
cat .git-sources
. ./.git-sources
echo $pmm_commit > apiCommitSha
echo $pmm_branch > apiBranch
Expand All @@ -13,30 +19,22 @@ if [ -s ci.yml ]; then
echo $pmm_ui_tests_branch > pmmUITestBranch
echo $pmm_ui_tests_commit > pmmUITestsCommitSha
else
sudo rm -rf results tmp || :
git reset --hard
git clean -fdx
git submodule foreach --recursive git reset --hard
git submodule foreach --recursive git clean -fdx
git submodule status
export commit_sha=$(git submodule status | grep 'pmm-managed' | awk -F ' ' '{print $1}')
export api_tests_commit_sha=$(git submodule status | grep 'pmm' | awk -F ' ' '{print $1}')
export api_tests_branch=$(git config -f .gitmodules submodule.pmm.branch)
export api_tests_url=$(git config -f .gitmodules submodule.pmm.url)
echo $api_tests_commit_sha > apiCommitSha
echo $api_tests_branch > apiBranch
echo $api_tests_url > apiURL
cat apiBranch
cat apiURL
export pmm_qa_commit_sha=$(git submodule status | grep 'pmm-qa' | awk -F ' ' '{print $1}')
export pmm_qa_branch=$(git config -f .gitmodules submodule.pmm-qa.branch)
# Define variables using git queries, i.e. w/o python
pmm_commit=$(git submodule status | grep 'sources/pmm/src' | awk -F ' ' '{print $1}')
echo $pmm_commit > apiCommitSha
pmm_branch=$(git config -f .gitmodules submodule.pmm.branch)
echo $pmm_branch > apiBranch
pmm_url=$(git config -f .gitmodules submodule.pmm.url)
echo $pmm_url > apiURL
pmm_qa_branch=$(git config -f .gitmodules submodule.pmm-qa.branch)
echo $pmm_qa_branch > pmmQABranch
echo $pmm_qa_commit_sha > pmmQACommitSha
export pmm_ui_tests_commit_sha=$(git submodule status | grep 'pmm-ui-tests' | awk -F ' ' '{print $1}')
export pmm_ui_tests_branch=$(git config -f .gitmodules submodule.pmm-ui-tests.branch)
pmm_qa_commit=$(git submodule status | grep 'pmm-qa' | awk -F ' ' '{print $1}')
echo $pmm_qa_commit > pmmQACommitSha
pmm_ui_tests_branch=$(git config -f .gitmodules submodule.pmm-ui-tests.branch)
echo $pmm_ui_tests_branch > pmmUITestBranch
echo $pmm_ui_tests_commit_sha > pmmUITestsCommitSha
pmm_ui_tests_commit=$(git submodule status | grep 'pmm-ui-tests' | awk -F ' ' '{print $1}')
echo $pmm_ui_tests_commit > pmmUITestsCommitSha
fi

export fb_commit_sha=$(git rev-parse HEAD)
fb_commit_sha=$(git rev-parse HEAD)
echo $fb_commit_sha > fbCommitSha
Loading