Skip to content

Commit

Permalink
Merge branch 'v3' into PMM-5086-12634-agent-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka authored Dec 4, 2024
2 parents 7586fe8 + 1719cf6 commit a47d1ae
Show file tree
Hide file tree
Showing 19 changed files with 80 additions and 180 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build/pmm-server-docker/RPMS/
build/
*.swp
*~
tmp/
Expand Down
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# PMM Client and Server Components
[submodule "pmm"]
path = sources/pmm/src/github.com/percona/pmm
url = https://github.com/percona/pmm
branch = v3

# PMM Client

[submodule "node_exporter"]
path = sources/node_exporter/src/github.com/prometheus/node_exporter
url = https://github.com/percona/node_exporter.git
branch = main
branch = v3
[submodule "mysqld_exporter"]
path = sources/mysqld_exporter/src/github.com/percona/mysqld_exporter
url = https://github.com/percona/mysqld_exporter.git
Expand Down Expand Up @@ -39,7 +39,6 @@
branch = release-v3.5.2

# PMM Server

[submodule "grafana-dashboards"]
path = sources/grafana-dashboards
url = https://github.com/percona/grafana-dashboards
Expand All @@ -52,6 +51,10 @@
path = sources/pmm-dump
url = https://github.com/percona/pmm-dump
branch = v3
[submodule "watchtower"]
path = sources/watchtower/src/github.com/percona/watchtower
url = https://github.com/percona/watchtower
branch = main

## PMM Tests
[submodule "pmm-qa"]
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ help: ## Display this help message.
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \
awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}'

submodules: ## Update all sumodules .
submodules: ## Update all sumodules.
git submodule update --init --remote --jobs 10
git submodule status

deps: ## Get deps from repos
deps: ## Get deps from repos.
python3 ci.py

trigger:
git commit -m 'Trigger FB' --allow-empty
trigger: ## Make an empty commit to trigger the build.
git commit -m 'chore: trigger FB' --allow-empty
git push

prepare: ## Create new FB (new style)
prepare: ## Create a new FB (new style).
python3 ci.py -g --prepare $(RUN_ARGS)

clean: ## Clean build results.
Expand All @@ -36,8 +36,8 @@ purge: ## Clean cache and leftovers. Please run this when s
git submodule update
git submodule foreach 'git reset --hard && git clean -xdff'

fb: ## Creates feature build branch.
# Usage: make fb mainBranch=v3 featureBranch=PMM-XXXX-name submodules="pmm pmm-managed"
fb: ## Create a feature build branch.
# Usage: make fb mainBranch=v3 featureBranch=PMM-XXXX-branch-name submodules="pmm pmm-managed"
$(eval MAIN_BRANCH = $(or $(mainBranch),v3))
git checkout $(MAIN_BRANCH)
make purge
Expand Down
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ to our build system managed by Jenkins as it helps pull the right branches from

# Installation of dependencies

If you build with Python's script then you need to install the dependencies:
If you intend to build PMM with 'ci.py' Python script, then you need to install the dependencies:

```
```shell
pip install -r requirements.txt
```

Expand All @@ -18,29 +18,29 @@ To create a feature build (FB) you have to edit `ci.yml` and specify the branche
```yaml
deps:
- name: pmm
branch: PMM-0000-fix-everything
branch: PMM-0000-feature-branch
- name: pmm-qa
branch: PMM-0000-fix-everything-and-even-more
branch: PMM-0000-bugfix-branch
```
To build from a fork, you need to specify `url` for the dependency, for example:
To build from a fork, you need to additionally specify `url` for the dependency, for example:

```yaml
deps:
- name: pmm-server
url: https://github.com/<your-account>/pmm-server
branch: PMM-0000-fix-everything
branch: PMM-0000-feature-branch
```

Next, you will commit changes to git and push them to the repo:
Next, commit your changes to git and push them to the repo:

```
```shell
git add ci.yml
git commit -m 'use custom branches'
git push
```

Whenever you commit and push to a feature branch, a Jenkins job will be triggered and it will start building your feature. You can follow its progress right from the PR's actions (at the bottom of each PR).
Whenever you commit and push to a feature branch, a Jenkins job will be triggered, which will start building your feature. You can follow its progress by following a github workflow link displayed at the bottom of each PR.

## Using a Personal Access Token (PAT)

Expand All @@ -54,21 +54,23 @@ The token requires the following permissions:

It is recommended to set an expiration date for your token.

if you use zsh:
To make the Github token available to `ci.py`, add the following lines to your shell script:

if you use `zsh` shell:

```console
echo 'export GITHUB_API_TOKEN=********' >> ~/.zshrc
source ~/.zshrc
```

if you use bash:
if you use `bash` shell:

```console
echo 'export GITHUB_API_TOKEN=********' >> ~/.bash_profile
source ~/.bash_profile
```

NOTE: Please make sure you don't commit your PAT to github. Should the PAT accidentally leak out, please revoke it asap and re-create it.
NOTE: Please make sure you DO NOT commit your PAT to github. Should the PAT accidentally leak out, please revoke it asap and re-create it.

## FAQ

Expand All @@ -77,15 +79,15 @@ NOTE: Please make sure you don't commit your PAT to github. Should the PAT accid
If you use the same branch name in all repos then you can run:

```console
make prepare <you branch name>
make prepare <your-branch-name>
```

Branches with "you branch name" will be used for all repos or the default branch (usually called `main`) if the branch with this name isn't found in the repo.
Branch "your-branch-name" will be used for every submodule repo. If not found, the repo's default branch (usually `main`) will be used.

If you want to create a FB from a fork, you can pass an environment variable "FORK_OWNER" which should be equal to your username in github and run:
If you want to create a FB from a fork, you can pass an environment variable "FORK_OWNER", which should be set to your github username:

```console
FORK_OWNER=<your username> make prepare <you branch name>
FORK_OWNER=<your username> make prepare <your-branch-name>
```

### I got an error "...branch has no upstream branch"
Expand Down
89 changes: 0 additions & 89 deletions ci-default.yml

This file was deleted.

Loading

0 comments on commit a47d1ae

Please sign in to comment.