Skip to content

Commit e1fc46c

Browse files
authored
Merge branch 'main' into main
2 parents 16b0c65 + 94f0313 commit e1fc46c

26 files changed

+789
-325
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[[shell]]
12+
binary_next_line = true
13+
switch_case_indent = true
14+
15+
[*.{yaml,yml}]
16+
indent_size = 2
17+
18+
[*.md]
19+
indent_size = 2
20+
max_line_length = 80
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Build and push `main` image
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v5
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Log in to GHCR
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Build and push Docker image
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: .
33+
push: true
34+
pull: true
35+
tags: ghcr.io/${{ github.repository }}:main
36+
cache-from: type=gha
37+
cache-to: type=gha,mode=max
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Cleanup closed PR images
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
types: [closed]
9+
10+
jobs:
11+
cleanup:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
packages: write
15+
steps:
16+
- id: get-version-id
17+
name: Get PR image version-id
18+
env:
19+
GH_TOKEN: ${{ github.token }}
20+
run: |
21+
VERSION_ID=$(gh api '/orgs/zulip/packages/container/docker-zulip/versions' | jq '.[] | select(.metadata.container.tags | any(index("pr-${{github.event.pull_request.number }}"))) | .id')
22+
echo "VERSION_ID=$VERSION_ID" >> $GITHUB_OUTPUT
23+
24+
- name: Delete PR image
25+
uses: actions/delete-package-versions@v5
26+
if: steps.get-version-id.outputs.VERSION_ID != ''
27+
with:
28+
package-name: "docker-zulip"
29+
package-type: "container"
30+
package-version-ids: ${{ steps.get-version-id.outputs.VERSION_ID }}
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Delete untagged images from GHCR
34+
uses: actions/delete-package-versions@v5
35+
with:
36+
package-name: "docker-zulip"
37+
package-type: "container"
38+
min-versions-to-keep: 0
39+
delete-only-untagged-versions: true
40+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dockerfile.yaml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
name: Dockerfile lint and build
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
16+
- uses: hadolint/[email protected]
17+
18+
build:
19+
runs-on: ubuntu-latest
20+
needs: lint
21+
permissions:
22+
contents: read
23+
packages: write
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v5
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Log in to GHCR
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Build and push Docker image
39+
uses: docker/build-push-action@v5
40+
with:
41+
context: .
42+
push: true
43+
tags: ghcr.io/${{ github.repository }}:pr-${{ github.event.pull_request.number }}
44+
cache-from: type=gha
45+
cache-to: type=gha,mode=max
46+
47+
helm-docs:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v5
52+
53+
- name: Run helm-docs
54+
uses: losisin/helm-docs-github-action@v1
55+
56+
- name: Run prettier over the re-generated docs
57+
uses: creyD/[email protected]
58+
with:
59+
prettier_options: --write kubernetes/chart/zulip/README.md
60+
no_commit: True
61+
62+
- name: Check for any diff
63+
run: |
64+
if ! git diff --exit-code; then
65+
echo "Changes found!"
66+
git status
67+
git diff
68+
exit 1
69+
fi
70+
71+
helm-test:
72+
runs-on: ubuntu-latest
73+
needs:
74+
- helm-docs
75+
- build
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v5
79+
with:
80+
fetch-depth: 0
81+
82+
- name: Set up Helm
83+
uses: azure/[email protected]
84+
with:
85+
version: v3.17.0
86+
87+
- uses: actions/[email protected]
88+
with:
89+
python-version: "3.x"
90+
check-latest: true
91+
92+
- name: Set up chart-testing
93+
uses: helm/[email protected]
94+
with:
95+
version: 3.14.0
96+
yamllint_version: 1.37.1
97+
yamale_version: 6.0.0
98+
99+
- name: Set up helm repos
100+
run: |
101+
helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/
102+
103+
- name: Run chart-testing (list-changed)
104+
id: list-changed
105+
run: |
106+
changed=$(ct list-changed --chart-dirs kubernetes/chart \
107+
--target-branch ${{ github.event.repository.default_branch }})
108+
if [[ -n "$changed" ]]; then
109+
echo "changed=true" >> "$GITHUB_OUTPUT"
110+
fi
111+
112+
- name: Run chart-testing (lint)
113+
if: steps.list-changed.outputs.changed == 'true'
114+
run: |
115+
ct lint --github-groups \
116+
--chart-dirs kubernetes/chart \
117+
--target-branch ${{ github.event.repository.default_branch }} \
118+
--lint-conf lintconf.yaml
119+
120+
- name: Create kind cluster
121+
uses: helm/kind-action@v1
122+
123+
- name: Log in to GHCR
124+
uses: docker/login-action@v3
125+
with:
126+
registry: ghcr.io
127+
username: ${{ github.actor }}
128+
password: ${{ secrets.GITHUB_TOKEN }}
129+
130+
- name: Load image into kind
131+
run: |
132+
docker pull ghcr.io/${{ github.repository }}:pr-${{ github.event.pull_request.number }}
133+
kind load docker-image ghcr.io/${{ github.repository }}:pr-${{ github.event.pull_request.number }} --name chart-testing
134+
135+
- name: Run chart-testing (install)
136+
id: chart-testing-install
137+
run: |
138+
ct install --github-groups \
139+
--chart-dirs kubernetes/chart \
140+
--all \
141+
--helm-extra-set-args "--set image.tag=pr-${{ github.event.pull_request.number }}" \
142+
--skip-clean-up
143+
144+
- name: Fetch logs
145+
if: success() || failure()
146+
continue-on-error: true
147+
run: |
148+
namespace=$(helm list --all-namespaces --output json \
149+
| jq -r '[.[] | select(.namespace | startswith("zulip-"))][0].namespace')
150+
kubectl get pods -n "$namespace"
151+
for pod in $(kubectl get pods -n "$namespace" -o name); do
152+
kubectl describe "$pod" -n "$namespace"
153+
done
154+
pod=$(kubectl get pods -n "$namespace" -l app.kubernetes.io/name=zulip --output name)
155+
kubectl -n "$namespace" logs "$pod"
156+
kubectl -n "$namespace" exec "$pod" -c zulip -- cat /var/log/zulip/errors.log

.github/workflows/prettier.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Lint markdown files prettier
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
prettier:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v5
15+
- uses: creyD/[email protected]
16+
with:
17+
dry: true
18+
prettier_options: "--write **/*.md"
19+
- name: Check for any diff
20+
run: |
21+
if ! git diff --exit-code; then
22+
echo "Changes found!"
23+
git status
24+
git diff
25+
exit 1
26+
fi

.github/workflows/shell-test.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Shell check and lint
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
shellcheck:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v5
14+
- uses: luizm/action-sh-checker@master

.github/workflows/spelling.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Spelling
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
spelling:
11+
name: Spellcheck with Typos
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
- name: Spell Check Repo
16+
uses: crate-ci/[email protected]

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
88

99
Examples of behavior that contributes to creating a positive environment include:
1010

11-
* Using welcoming and inclusive language
12-
* Being respectful of differing viewpoints and experiences
13-
* Gracefully accepting constructive criticism
14-
* Focusing on what is best for the community
15-
* Showing empathy towards other community members
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
1616

1717
Examples of unacceptable behavior by participants include:
1818

19-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20-
* Trolling, insulting/derogatory comments, and personal or political attacks
21-
* Public or private harassment
22-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23-
* Other conduct which could reasonably be considered inappropriate in a professional setting
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
2424

2525
## Our Responsibilities
2626

Dockerfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ENV LANG="C.UTF-8"
99

1010
ARG UBUNTU_MIRROR
1111

12+
# hadolint ignore=DL3005,DL3008,DL3009
1213
RUN { [ ! "$UBUNTU_MIRROR" ] || sed -i "s|http://\(\w*\.\)*archive\.ubuntu\.com/ubuntu/\? |$UBUNTU_MIRROR |" /etc/apt/sources.list; } && \
1314
apt-get -q update && \
1415
apt-get -q dist-upgrade -y && \
@@ -27,15 +28,12 @@ WORKDIR /home/zulip
2728
# You can specify these in docker-compose.yml or with
2829
# docker build --build-arg "ZULIP_GIT_REF=git_branch_name" .
2930
ARG ZULIP_GIT_URL=https://github.com/zulip/zulip.git
30-
ARG ZULIP_GIT_REF=11.2
31+
ARG ZULIP_GIT_REF=11.4
3132

32-
RUN git clone "$ZULIP_GIT_URL" -b "$ZULIP_GIT_REF" && \
33-
cd zulip
33+
RUN git clone "$ZULIP_GIT_URL" -b "$ZULIP_GIT_REF"
3434

3535
WORKDIR /home/zulip/zulip
3636

37-
ARG CUSTOM_CA_CERTIFICATES
38-
3937
# Finally, we provision the development environment and build a release tarball
4038
RUN SKIP_VENV_SHELL_WARNING=1 ./tools/provision --build-release-tarball-only && \
4139
uv run --no-sync ./tools/build-release-tarball docker && \
@@ -51,14 +49,12 @@ ENV DATA_DIR="/data"
5149
COPY --from=build /tmp/zulip-server-docker.tar.gz /root/
5250
COPY custom_zulip_files/ /root/custom_zulip
5351

54-
ARG CUSTOM_CA_CERTIFICATES
55-
52+
WORKDIR /root
5653
RUN \
5754
# Make sure Nginx is started by Supervisor.
5855
dpkg-divert --add --rename /etc/init.d/nginx && \
5956
ln -s /bin/true /etc/init.d/nginx && \
6057
mkdir -p "$DATA_DIR" && \
61-
cd /root && \
6258
tar -xf zulip-server-docker.tar.gz && \
6359
rm -f zulip-server-docker.tar.gz && \
6460
mv zulip-server-docker zulip && \

0 commit comments

Comments
 (0)