1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00
Commit Graph

87 Commits

Author SHA1 Message Date
bors[bot]
08be233607
Merge #2058
2058: Implement versioning for CI/CD workflow. r=mergify[bot] a=Diman0

## What type of PR?

Feature!

## What does this PR do?
This PR introduces 3 things
- Add versioning (tagging) for branch x.y (1.8). E.g. 1.8.0, 1.8.1 etc.
  - docker repo will contain x.y (latest) and x.y.z (pinned version) images.
  - The X.Y.Z tag is incremented automatically. E.g. if 1.8.0 already exists, then the next merge on 1.8 will result in the new tag 1.8.1 being used.
- Make the version available in the image.
  -  For X.Y and X.Y.Z write the version (X.Y.Z) into /version on the image and add a label with version=X.Y.Z
	  -  This means that the latest X.Y image shows the pinned version (X.Y.Z e.g. 1.8.1) it was based on. Via the tag X.Y.Z you can see the commit hash that triggered the built.
  -  For master write the commit hash into /version on the image and add a label with version={commit hash}
-  Automatic releases. For x.y triggered builts (e.g. merge on 1.9) do a new github release for the pinned x.y.z (e.g. 1.9.2). 
  -  Release shows a static message (see RELEASE_TEMPLATE.md) that explains how to reach the newsfragments folder and change the branch to the tag (x.y.z) mentioned in the release. Now you can get the changelog by reading all newsfragment files in this folder.

This PR does not change anything to our workflow (what we (human persons) do). Our processes are still exactly the same. The above introduced logic is automatic. When we backport to X.Y all the magic for creating the pinned version X.Y.Z is handled by the CI/CD workflow.

### Related issue(s)
- closes #1182

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [x] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.

## Testing
Suggested testing steps. This should cover all situations including BORS. It does require that you use your own docker repo or temporarily create a new one.
Suggested testing steps.
1. Create new github repo.
2. Add the required docker secrets to the project (see beginning of CI.yml for the secret names), DOCKER_UN, DOCKER_PW, DOCKER_ORG, DOCKER_ORG_TESTS.
3. Clone the project.
4. Copy the contents of the PR to the cloned project.
5. Push to your new github repo.
6. Now master images are built. Check that images with tag master are pushed to your docker repo
7. Check with docker inspect nginx:master that it has the label version={commit hash}.
8. Run an image, run `docker-compose exec <name> cat /version`. Note that /version also contains the pinned version. For master the pinned version is the commit hash.
9. Create branch 1.8. 
10. Push branch 1.8 to repo.
11. Note that tags 1.8 and 1.8.0 are built and pushed to docker repo
12. Inspect label and /version. Note that 1.8 and 1.8.0 both show version 1.8.0.
13. Push another commit to branch 1.8.
14. Note that tags 1.8 and 1.8.1 are built and pushed to docker repo
15. Inspect label and /version. Note that 1.8 and 1.8.1 both show version 1.8.1.
16. Let's check BORS stuff.
17. Create branch testing.
18. Push the commit with the exact commit text (IMPORTANT!!): `Try #1234:`'.
19. Note that images are built and pushed for tag `pr-1234`.
20. Inspect label and /version. Note that the version is `pr-1234`.
20. Create branch staging.
21. Push the commit with commit text: `Merge #1234`.
22. Note that this image is not pushed to docker (as expected).

but you could also check the GH repo and docker repo I used:
https://github.com/Diman0/Mailu_Fork
https://hub.docker.com/r/diman/rainloop/tags

Co-authored-by: Dimitri Huisman <diman@huisman.xyz>
2021-12-15 09:29:08 +00:00
Dimitri Huisman
15e64e8e50 Add concurrency to ensure that only a single workflow can run for a branch. 2021-12-06 15:22:42 +00:00
Dimitri Huisman
9eba2feae2 Remove Mailu PostgreSQL from CI.yml. 2021-12-01 16:26:44 +00:00
Dimitri Huisman
6cb8f101d9 Update stale bot with clearer message why an issue is marked stale. 2021-11-23 18:20:35 +00:00
Dimitri Huisman
f7677543c6 Process code review remarks
- Moved run to bottom of Dockerfile to allow using unmodified / cached states.
- Simplified bash code in deploy.sh.
- Improved the large bash one-liner in CI.yml. It could not handle >9 for 1.x.
2021-11-18 17:21:56 +00:00
Dimitri Huisman
56dd70cf4a Implement versioning for CI/CD workflow (see #1182). 2021-11-17 20:00:04 +00:00
Dimitri Huisman
b20d0a83d5 Doh! 2021-11-15 16:17:31 +00:00
Dimitri Huisman
b391692698 It is handy to close strings. 2021-11-15 15:44:31 +00:00
Dimitri Huisman
e2512c7cdc Testing images are pushed to DOCKER_ORG_TESTS again. 2021-11-15 15:34:38 +00:00
Diman0
3157fc3623 Give docker containers in each test one more minute for starting. 2021-08-07 09:27:47 +02:00
Dimitri Huisman
609e0f9f7c
Env vars are not shared between jobs 2021-08-05 00:12:37 +02:00
Dimitri Huisman
c3f47f1ca0 Forgot that env var set in job 1 is not shared with job 2. Added logic for deriving MAILU_VERSION to deploy job. 2021-07-05 17:44:10 +00:00
Dimitri Huisman
58e751415c Yet another small typo. One day computers will understand I meant env.MAILU_BRANCH instead of MAILU_BRANCH. 2021-07-05 17:21:28 +00:00
Dimitri Huisman
7aa9b496fa Moved logic for building testing images from deploy job to build job. This should save time. Test number for ci workflow #1234 2021-07-05 17:09:48 +00:00
Dimitri Huisman
1566dfb077
Forgot to add condition to load docker images step 2021-06-29 08:58:44 +02:00
Dimitri Huisman
b2840fed26
Update CI.yml 2021-06-28 22:51:23 +02:00
Dimitri Huisman
cf894dae03
Merge branch 'Mailu:master' into test-ci-parallel 2021-06-28 22:50:34 +02:00
Dimitri Huisman
75ee2cd1f7
Added manual trigger for workflow
Workflow file only triggers if it resides in the branch. If an old PR based on the mailu repo without CI.yml is tested, then the workflow run will not trigger. The merged commit on TESTING/STAGING branch does not contain the required CI.yml workflow file after all. In these cases simply run the workflow manually on the TESTING or STAGING branch,
2021-06-28 22:38:01 +02:00
Dimitri Huisman
c2b1f23652 It helps to also load the docker images for the tests. 2021-06-27 09:44:38 +00:00
Dimitri Huisman
c6da021106 Forgot to adapt all creat folder steps 2021-06-27 09:31:39 +00:00
Dimitri Huisman
782ffc084f Fixed typo 2021-06-27 09:26:11 +00:00
Dimitri Huisman
0468fb2064 Forgot to set permissions on images folder. Added changelog. 2021-06-27 09:24:17 +00:00
Dimitri Huisman
2f51fe6688 using != uses 2021-06-27 09:07:41 +00:00
Dimitri Huisman
a6ec14b42a Fixed spacing in CI.yml 2021-06-27 08:56:59 +00:00
Dimitri Huisman
e16e9f19fd Run test jobs in parallel for CI/CD. 2021-06-27 08:54:17 +00:00
Dimitri Huisman
24200ddb67 Forgot to remove duplicate steps when switching back to sequential workflow 2021-06-26 21:49:37 +00:00
Dimitri Huisman
606c039a6f Switch back to sequential workflow 2021-06-26 21:00:51 +00:00
Dimitri Huisman
006da4c5e4
My mistake. A typo 2021-06-26 21:52:51 +02:00
Dimitri Huisman
fb30a62629
Create CI.yml 2021-06-26 21:52:09 +02:00
Dimitri Huisman
c6a38bbbcc
Update CI.yml 2021-06-26 21:50:55 +02:00
Dimitri Huisman
54dd4cf224 Added new docker repo for test image. Adapted deploy script to use env var for test repo name. Modified travis references to github actions references in docs. Added changelog entry. 2021-06-26 19:16:56 +00:00
Dimitri Huisman
58235bcc44 Switch to github actions for CI/CD 2021-06-26 08:25:15 +00:00
Dimitri Huisman
b51d9eb58f
Update stale.yml
as discussed in chat https://matrix.to/#/!RJFCFtixHgPhzacdhW:tedomum.net/$160120578037UHNkM:huisman.xyz?via=ghostdub.de&via=matrix.org&via=tedomum.net
stalebot should only touch
- user support (issue with no label or issue with label type/question).
- issues we explicitly mark with a response_needed label (whatever the name will be of this label).
To give more time to respond when we mark issue with more info needed, we increase the daysUntilClose to 14
2020-09-27 13:30:11 +02:00
Dario Ernst
fd5e604cf1 Exempt status/wip label from stalebot 2020-09-26 09:40:36 +02:00
Dimitri Huisman
1d6321992a
Update stale.yml
Add label backlog to exempt labels. We will use label backlog to collect bugs/features that we want to consider for a future release. Thus we do not want to auto-close those issues.
2020-09-25 11:25:19 +02:00
Dario Ernst
8f49bb8d53 Add config file for the "stale" robot to clean up issues
With this, and the already activated github-app, the stale robot will
mark and subsequently close issues as specified in the config.

Currently we mark after 21 days, close after 7 more days, and ignore
issues with an assigned priority or milestone.
2020-09-23 21:04:50 +02:00
Tim Möhlmann
be91eae0d4
Create FUNDING.yml
Github will be done once contributors pass the wait list
2019-10-21 12:04:21 +03:00