Skip to content

Commit

Permalink
Fix rtcd CI (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 authored Sep 16, 2024
1 parent e15d468 commit 3e1e123
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ endif
start-mm: ## start MM server
ifeq (${CI}, true)
@$(INFO) starting up MM server...
docker-compose -p mmserver -f ./build/test/docker-compose.yaml up -d
docker compose -p mmserver -f ./build/test/docker-compose.yaml up -d
else
@$(INFO) skipping start-mm target, not on CI
endif
Expand All @@ -338,7 +338,7 @@ endif
stop-mm: ## stop MM server
ifeq (${CI}, true)
@$(INFO) stopping up MM server...
docker-compose -p mmserver -f ./build/test/docker-compose.yaml down
docker compose -p mmserver -f ./build/test/docker-compose.yaml down
else
@$(INFO) skipping stop-mm target, not on CI
endif
Expand Down
1 change: 1 addition & 0 deletions build/test/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ services:
MM_SERVICESETTINGS_ENABLEONBOARDINGFLOW: "false"
MM_FEATUREFLAGS_ONBOARDINGTOURTIPS: "false"
MM_SERVICEENVIRONMENT: "test"
MM_CALLS_GROUP_CALLS_ALLOWED: "true"
volumes:
- "server-config:/mattermost/config"
depends_on:
Expand Down
24 changes: 13 additions & 11 deletions build/test/prepare-plugin.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/bin/bash
set -x
set -xe

GIT_DEFAULT_BRANCH="main"
GIT_REPO="https://github.com/mattermost/mattermost-plugin-calls"
Expand All @@ -14,27 +14,29 @@ else
fi

# Build
cd .. && git clone -b ${GIT_BRANCH} https://github.com/mattermost/mattermost-plugin-calls --depth 1 && \
cd mattermost-plugin-calls &&
cd .. && git clone -b ${GIT_BRANCH} https://github.com/mattermost/mattermost-plugin-calls && \
cd mattermost-plugin-calls && \
git fetch --tags && \
cd standalone && npm ci && cd .. && \
cd webapp && npm ci && cd .. && \
echo 'replace github.com/mattermost/rtcd => ../rtcd' >> go.mod && \ # We need to make sure we compile the plugin with the rtcd changes.
echo "replace github.com/mattermost/rtcd => ../rtcd" >> go.mod && \
go mod tidy && \
make dist MM_SERVICESETTINGS_ENABLEDEVELOPER=true

# Installation
PLUGIN_BUILD_PATH=$(realpath dist/*.tar.gz)
PLUGIN_FILE_NAME=$(basename ${PLUGIN_BUILD_PATH})

docker cp ../rtcd/build/test/config_patch.json mmserver_server_1:/mattermost && \
docker exec mmserver_server_1 bin/mmctl --local config patch config_patch.json && \
docker cp ${PLUGIN_BUILD_PATH} mmserver_server_1:/mattermost && \
docker exec mmserver_server_1 bin/mmctl --local plugin delete ${PLUGIN_ID} && \
docker exec mmserver_server_1 bin/mmctl --local plugin add ${PLUGIN_FILE_NAME} && \
docker exec mmserver_server_1 bin/mmctl --local plugin enable ${PLUGIN_ID} && \
docker ps -a && \
docker cp ../rtcd/build/test/config_patch.json mmserver-server-1:/mattermost && \
docker exec mmserver-server-1 bin/mmctl --local config patch config_patch.json && \
docker cp ${PLUGIN_BUILD_PATH} mmserver-server-1:/mattermost && \
docker exec mmserver-server-1 bin/mmctl --local plugin delete ${PLUGIN_ID} && \
docker exec mmserver-server-1 bin/mmctl --local plugin add ${PLUGIN_FILE_NAME} && \
docker exec mmserver-server-1 bin/mmctl --local plugin enable ${PLUGIN_ID} && \
sleep 5s

STATUS_CODE=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:8065/plugins/com.mattermost.calls/version)
if [ "$STATUS_CODE" != "200" ]; then
echo "Status code check for plugin failed" && docker logs mmserver_server_1 && exit 1
echo "Status code check for plugin failed" && docker logs mmserver-server-1 && exit 1
fi

0 comments on commit 3e1e123

Please sign in to comment.