Synchronization from Stash to GitHub#
To perform one-way synchronization use the
Repository Mirror Plugin for Bitbucket Server fork.
Synchronize the develop branch, release branches, and all tags.
How to configure Mirror Hook#
The synchronization plugin is configured in the Hooks tab of the avito-android-tools repository settings.
- Mirror Repo URL:
https://github.com/avito-tech/avito-android.git - Username: GitHub Username of the token creator
- Password: You need to use fine-grained GitHub token with
Contents write permissions in one GitHub repo only. Also,
token user should be in exceptions for
Allow specific actors to bypass required pull requests. You can request the token from the Speed Android Tech Lead or create it yourself if you have enough GitHub permissions. - Refspecs:
+refs/heads/develop:refs/heads/develop +refs/heads/20*:refs/heads/20* - Tags:
true - Notes:
false - Atomic:
true
How to debug problems#
In case of synchronization issues you can get logs through a task or the atlassian channel in the corporate messenger.
Ask search for com.englishtown in the Stash logs.
How to test the plugin#
- Create a test repository in GitHub
- Create a test repository in Stash
- For local testing you can use BitBucket Server Docker image
- You can also test in staging Stash. Just ask admins to install the plugin and restart staging
Stash - After the plugin is installed, you can configure the synchronization in the Hooks tab of the test repository settings in
Stash. - Push some changes to the test repository in Stash and check if they are synchronized to the test repository in GitHub
How to update the plugin#
- Open a task
- Choose
Stashin Service dropdown menu - Enter the task title:
Plugin Update - Describe the problem in the task body
- Attach the plugin jar file
stash-hook-mirror-*.jar, which you can obtain by using the commandmvn install. You can find the code at stash-hook-mirror. Note that update plugin requireStashrestart.