DOPS-602: Change how mmctl gets packaged and locally fetched. (#18335)

* DOPS-602: Change how mmctl gets packaged and locally fetched.
This commit is contained in:
Elisabeth Kulzer
2021-11-02 14:45:02 +01:00
committed by GitHub
parent fc1e11c3d7
commit 5ede63badc
3 changed files with 88 additions and 35 deletions

View File

@@ -14,7 +14,7 @@ executors:
COMPOSE_PROJECT_NAME: "circleci"
jobs:
setup:
setup-webapp:
working_directory: ~/mattermost/mattermost-server
docker:
- image: mattermost/mattermost-build-webapp:20210524_node-16
@@ -55,6 +55,24 @@ jobs:
- mattermost-webapp
- mattermost-server
setup-mmctl:
working_directory: ~/mattermost/mattermost-server
docker:
- image: mattermost/mattermost-build-server:20210810_golang-1.16.7
steps:
- checkout
- run: |
cd ../
git clone --depth=1 --no-single-branch https://github.com/mattermost/mmctl.git
cd mmctl
git checkout $CIRCLE_BRANCH || git checkout master
make package
cd -
- persist_to_workspace:
root: ~/mattermost
paths:
- mmctl/build
check-deps:
parameters:
cve_data_directory:
@@ -485,21 +503,22 @@ workflows:
version: 2
untagged-build:
jobs:
- setup:
- setup-webapp:
filters:
branches:
ignore:
- master
- /^release-.*/
- setup-mmctl:
filters:
branches:
ignore:
- master
- /^release-.*/
# Disabling check-deps since the new version is not on bintray and all builds will fail
# we've are on top of this, and it's going to be temporary.
#- check-deps:
# context: sast-webhook
# requires:
# - setup
# - check-i18n:
# requires:
# - setup
# - setup-webapp
# - setup-mmctl
- check-golangci-lint:
filters:
branches:
@@ -508,25 +527,32 @@ workflows:
- /^release-.*/
- check-app-layers:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-store-layers:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-mocks:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-migrations:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-email-templates:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-mattermost-vet:
requires:
- setup
- setup-webapp
- setup-mmctl
- build-api-spec:
requires:
- setup
- setup-webapp
- setup-mmctl
- build:
requires:
- check-app-layers
@@ -580,22 +606,24 @@ workflows:
- check-email-templates
release-build:
jobs:
- setup:
- setup-webapp:
filters:
branches:
only:
- master
- /^release-.*/
- cloud
- setup-mmctl:
filters:
branches:
only:
- master
- /^release-.*/
- cloud
# Disabling check-deps since the new version is not on bintray and all builds will fail
# we've are on top of this, and it's going to be temporary.
#- check-deps:
# context: sast-webhook
# requires:
# - setup
# - check-i18n:
# requires:
# - setup
# - setup-webapp
# - setup-mmctl
- check-golangci-lint:
filters:
branches:
@@ -605,25 +633,32 @@ workflows:
- cloud
- check-app-layers:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-store-layers:
requires:
- setup
- setup-webapp
- setup-mmctl
- build-api-spec:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-mocks:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-migrations:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-email-templates:
requires:
- setup
- setup-webapp
- setup-mmctl
- check-mattermost-vet:
requires:
- setup
- setup-webapp
- setup-mmctl
- sentry:
context: matterbuild-sentry
requires:

View File

@@ -164,8 +164,7 @@ ifeq ("darwin_arm64","$(CURRENT_PACKAGE_ARCH)")
else ifeq ("linux_arm64","$(CURRENT_PACKAGE_ARCH)")
echo "No plugins or mmctl yet for $(CURRENT_PACKAGE_ARCH) platform, skipping..."
else
#Download MMCTL for $(MMCTL_PLATFORM)
scripts/download_mmctl_release.sh $(MMCTL_PLATFORM) $(DIST_PATH_GENERIC)/bin
tar xf ../mmctl/build/$(CURRENT_PACKAGE_ARCH).tar -C $(DIST_PATH_GENERIC)/bin
@# Prepackage plugins
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
ARCH=$(PLUGIN_ARCH); \
@@ -228,8 +227,7 @@ ifeq ($(BUILDER_GOOS_GOARCH),"windows_amd64")
else
cp $(GOBIN)/windows_amd64/mattermost.exe $(DIST_PATH_WIN)/bin # from cross-compiled bin dir
endif
#Download MMCTL for Windows
scripts/download_mmctl_release.sh "Windows" $(DIST_PATH_WIN)/bin
unzip -o ../mmctl/build/windows_amd64.zip -d $(DIST_PATH_WIN)/bin
@# Prepackage plugins
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
ARCH="windows-amd64"; \

20
scripts/mmctl-dev.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -xe
if [[ "$(basename "$PWD")" != "mattermost-server" ]]; then
echo "please run this script from the root project folder of mattermost-server with ./scripts/mmctl-dev.sh"
exit 1
fi
if [ ! -d "../mmctl" ]; then
echo "please clone mmctl as a companion repository on the same level next to mattermost-server (git@github.com:mattermost/mmctl.git)"
exit 1
fi
cd ../mmctl
make build
cd -
cp ../mmctl/mmctl bin/mmctl
./bin/mmctl version