Skip to content

Commit

Permalink
Minor sync release updates (#880)
Browse files Browse the repository at this point in the history
Minor sync release updates

Related to packit/packit#2297
RELEASE NOTES BEGIN
N/A
RELEASE NOTES END

Reviewed-by: Maja Massarini
Reviewed-by: Nikola Forró
Reviewed-by: Laura Barcziová
  • Loading branch information
2 parents 523ef27 + b724fbd commit 53abda5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
1 change: 1 addition & 0 deletions docs/configuration/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ Related to the `propose-downstream` and `pull-from-upstream` jobs.

* `PACKIT_UPSTREAM_REPO` — absolute path to cloned upstream git repo (main branch)
* `PACKIT_DOWNSTREAM_REPO` — absolute path to cloned downstream git repo (target branch)
* `PACKIT_PROJECT_VERSION` - version that is being proposed

List of actions that provide these environment variables:
* `post-upstream-clone`
Expand Down
41 changes: 24 additions & 17 deletions docs/configuration/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fix-spec-file:

</details>

### Custom archive creation
### Custom archive creation for SRPM
<details>
<summary>Creating archive with custom make target</summary>

Expand Down Expand Up @@ -107,40 +107,47 @@ create-archive:

</details>

### Custom changelog generation
### Custom archive creation for release syncing

If you need to generate local archive(s) during release syncing, you can utilise e.g. `pre-sync` action
to place the commands necessary for the creation. You also have to include the archive(s) in the list of files to
be moved to the dist-git repo so that it is then handled by Packit from there.


<details>
<summary>Using changelog entry from a file</summary>
<summary>Creating an archive using tito and syncing it to dist-git repo</summary>

```yaml
changelog-entry:
- cat .changelog_entry
actions:
pre-sync:
- tito build -o . --tgz
files_to_sync:
- src:
- "<my-package>-*.tar.gz"
dest: .
```

</details>


### Custom changelog generation
<details>
<summary>Using `git log` output as a changelog entry </summary>
<summary>Using file content as a changelog entry</summary>

```yaml
changelog-entry:
- bash -c 'git log --no-merges --pretty="format:- %s (%an)" $(git describe --tags --abbrev=0 ${PACKIT_PROJECT_UPSTREAM_TAG}^)..${PACKIT_PROJECT_UPSTREAM_TAG} --'
- cat .changelog_entry
```

</details>

### Creating source archive using 'tito' during release syncing
<details>
<summary>Using pre-sync for running tito</summary>
<summary>Using `git log` output as a changelog entry </summary>

```yaml
actions:
pre-sync:
- tito build -o . --tgz
files_to_sync:
- src:
- "<my-package>-*.tar.gz"
dest: .
changelog-entry:
- bash -c 'git log --no-merges --pretty="format:- %s (%an)" $(git describe --tags --abbrev=0 ${PACKIT_PROJECT_UPSTREAM_TAG}^)..${PACKIT_PROJECT_UPSTREAM_TAG} --'
```

</details>
Expand Down
3 changes: 2 additions & 1 deletion docs/fedora-releases-guide/dist-git-onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ jobs:
- fedora-branched # rawhide updates are created automatically
```

#### Actions
#### Actions - use your own commands/scripts
Actions are a way how to redefine or tweak the Packit's workflows.
These are user-defined commands that can replace a part of Packit's job (e.g. to get version, or to create a tarball)
or are run in a particular step as a hook (with no action run by default).

Take a look at the tables [here](/docs/configuration/actions/) to know what actions are available for each job.
You can also see some examples [here](./index.md#customization)

### 2. Monitoring of the package
Besides the configuration file, if you use the [`pull_from_upstream` job](#pull-from-upstream-job), you also need
Expand Down
9 changes: 6 additions & 3 deletions docs/fedora-releases-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,25 @@ you should specify the [`upstream_tag_template`](/docs/configuration/#upstream_t
via [`files_to_sync`](/docs/configuration/#files_to_sync) configuration key.
- By default, Packit downloads sources defined in the spec file that contain URLs.
You can override these URLs via [`sources`](/docs/configuration#sources) configuration key.

##### Actions - use your own commands/scripts
- You may utilise some of the [actions](/docs/configuration/actions/#syncing-the-release)
for overriding the Packit default behaviour, for example:
- for the changelog entry generation, if you do not want the default `Update to version <version>`, you can use your own command(s)
- for the **changelog entry generation**, if you do not want the default `Update to version <version>`, you can use your own command(s)
(here, the first one gets the git log between the corresponding tag and the tag before that one and the second
command links the bugzilla(s)):

changelog-entry:
- bash -c 'git log --no-merges --pretty="format:- %s (%an)" $(git describe --tags --abbrev=0 ${PACKIT_PROJECT_UPSTREAM_TAG}^)..${PACKIT_PROJECT_UPSTREAM_TAG} --'
- bash -c '[ -z "$PACKIT_RESOLVED_BUGS" ] || echo ${PACKIT_RESOLVED_BUGS} | tr " " "\n" | sed "s/^/- Resolves /"'

- for a custom commit message for commit created by Packit:
- for a **custom commit message** for commit created by Packit:

commit-message:
- bash -c 'echo -e "Rebase to new upstream release ${PACKIT_PROJECT_VERSION}\n"'
- bash -c '[ -z "$PACKIT_RESOLVED_BUGS" ] || echo ${PACKIT_RESOLVED_BUGS} | tr " " "\n" | sed "s/^/- Resolves /"'

- for **source archive(s) generation**, you can utilise e.g. `pre-sync` action, see
[this example](/docs/configuration/examples#custom-archive-creation-for-release-syncing)

#### Keeping dist-git branches non-divergent
Packit currently syncs the release in a way that the branches become divergent (you can follow
Expand Down

0 comments on commit 53abda5

Please sign in to comment.