Skip to content

Commit 1b81071

Browse files
author
custarpy
committed
fixed issues
1 parent 138fada commit 1b81071

3 files changed

Lines changed: 49 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build Mattermost
2+
3+
on:
4+
push:
5+
branches:
6+
- deploy
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build Mattermost Tarball
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
20+
- name: Build Mattermost
21+
uses: docker/build-push-action@v5
22+
with:
23+
context: .
24+
file: ./Containerfile
25+
target: builder
26+
platforms: linux/amd64
27+
cache-from: type=gha
28+
cache-to: type=gha,mode=max
29+
outputs: type=local,dest=./output
30+
31+
- name: Find and copy tarball
32+
run: |
33+
find ./output -name "mattermost-team-linux-amd64.tar.gz" -exec cp {} ./mattermost.tar.gz \;
34+
35+
- name: Upload artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: mattermost-tarball
39+
path: mattermost.tar.gz
40+
retention-days: 7

.gitlab-ci.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@ mattermost_deploy:
2828
script:
2929
- chmod og= $ID_ED25519
3030
- echo "COPYING THE TARBALL.."
31+
- scp -i $ID_ED25519 -o StrictHostKeyChecking=no ./mattermost.tar.gz root@$DEPLOY_HOST:/root
32+
- echo "BACKING UP THE MATTERMOST WORKDIR.."
33+
- >
34+
ssh -i $ID_ED25519 -o StrictHostKeyChecking=no root@$DEPLOY_HOST
35+
cp -ra /opt/mattermost/ ~/mattermost-back-$(date +'%F-%H-%M')
36+
- echo "BACKING UP THE MATTERMOST DB.."
3137
- >
32-
scp -i $ID_ED25519 -o StrictHostKeyChecking=no
33-
./mattermost.tar.gz root@$DEPLOY_HOST:/root
38+
ssh -i $ID_ED25519 -o StrictHostKeyChecking=no root@$DEPLOY_HOST
39+
pg_dump -U mmuser -Fc mattermost > ~/mattermost.sql
3440
- echo "UNPACKING THE TARBALL.."
3541
- >
3642
ssh -i $ID_ED25519 -o StrictHostKeyChecking=no root@$DEPLOY_HOST
@@ -39,14 +45,6 @@ mattermost_deploy:
3945
- >
4046
ssh -i $ID_ED25519 -o StrictHostKeyChecking=no root@$DEPLOY_HOST
4147
systemctl stop mattermost.service
42-
- echo "BACKING UP THE MATTERMOST WORKDIR.."
43-
- >
44-
ssh -i $ID_ED25519 -o StrictHostKeyChecking=no root@$DEPLOY_HOST
45-
cp -ra /opt/mattermost/ ~/mattermost-back-$(date +'%F-%H-%M')
46-
- echo "BACKING UP THE MATTERMOST DB.."
47-
- >
48-
ssh -i $ID_ED25519 -o StrictHostKeyChecking=no root@$DEPLOY_HOST
49-
pg_dump -U mmuser -Fc mattermost > ~/mattermost.sql
5048
- echo "REMOVING OLD FILES.."
5149
- >
5250
ssh -i $ID_ED25519 -o StrictHostKeyChecking=no root@$DEPLOY_HOST

Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM nexus.almaz-rpe.ru/mattermost/mattermost-build-server:1.24.13 AS builder
3+
FROM mattermost/mattermost-build-server:1.24.13 AS builder
44

55
RUN mkdir /work
66
WORKDIR /work

0 commit comments

Comments
 (0)