mirror of
https://github.com/SmartHoneybee/ubiquitous-memory
synced 2025-10-24 23:33:48 +02:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79bcde5f55 | ||
|
|
a0c00708b5 | ||
|
|
598db95863 | ||
|
|
bdacb84580 | ||
|
|
b7c03a36af | ||
|
|
22102fdefc | ||
|
|
acc0ef08cd | ||
|
|
860b28b652 | ||
|
|
1b49e25db7 | ||
|
|
542f871d30 | ||
|
|
b4bf8fc00e | ||
|
|
404ed7f60c | ||
|
|
890eb1c602 | ||
|
|
476501913c | ||
|
|
d5c44dd9a8 | ||
|
|
a624e66742 | ||
|
|
5d1eec08f2 | ||
|
|
b4bfed6058 | ||
|
|
155ef473dd | ||
|
|
69dda8131e | ||
|
|
a02a6b4386 | ||
|
|
3aec2b6302 | ||
|
|
cef04b0488 | ||
|
|
f3aa038f93 | ||
|
|
ce52eca004 | ||
|
|
06ac371c53 |
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -9,7 +9,7 @@ env:
|
||||
DEBIAN_RELEASE: buster
|
||||
DOCKER_PWD: /root
|
||||
DOCKER_IMAGE: debian:${DEBIAN_RELEASE}
|
||||
GO_VERSION: 1.16.7
|
||||
GO_VERSION: 1.18.1
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -55,7 +55,9 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set environment from runtime properties
|
||||
run: echo "MATTERMOST_RELEASE=$(grep 'mattermost' dependabot/go.mod | cut -d' ' -f3)" >> $GITHUB_ENV
|
||||
run: |
|
||||
echo "MATTERMOST_RELEASE=$(grep 'mattermost-server' dependabot/go.mod | cut -d' ' -f2)" >> $GITHUB_ENV
|
||||
echo "MMCTL_RELEASE=v7.5.2" >> $GITHUB_ENV
|
||||
|
||||
- name: Pull docker image
|
||||
run: 'docker pull "${{ env.DOCKER_IMAGE }}"'
|
||||
@@ -64,7 +66,7 @@ jobs:
|
||||
env:
|
||||
GOOS: ${{ matrix.os }}
|
||||
GOARCH: ${{ matrix.arch }}
|
||||
run: docker run --mount="type=bind,source=$PWD,destination=${{ env.DOCKER_PWD }}" --rm=true --tty=true --workdir="${{ env.DOCKER_PWD }}" -e DEBIAN_RELEASE -e MATTERMOST_RELEASE -e GOOS -e GOARCH "${{ env.DOCKER_IMAGE }}" ./build.sh
|
||||
run: docker run --mount="type=bind,source=$PWD,destination=${{ env.DOCKER_PWD }}" --rm=true --tty=true --workdir="${{ env.DOCKER_PWD }}" -e DEBIAN_RELEASE -e MATTERMOST_RELEASE -e MMCTL_RELEASE -e GOOS -e GOARCH "${{ env.DOCKER_IMAGE }}" ./build.sh
|
||||
|
||||
- name: Tag release
|
||||
if: github.ref == 'refs/heads/master'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/build/release.mk b/build/release.mk
|
||||
index 1530e75c6..befe5c9b7 100644
|
||||
index faa027239..df40f0c68 100644
|
||||
--- a/build/release.mk
|
||||
+++ b/build/release.mk
|
||||
@@ -76,7 +76,7 @@ package:
|
||||
@@ -99,7 +99,7 @@ package-prep:
|
||||
@# Resource directories
|
||||
mkdir -p $(DIST_PATH)/config
|
||||
cp -L config/README.md $(DIST_PATH)/config
|
||||
@@ -11,39 +11,14 @@ index 1530e75c6..befe5c9b7 100644
|
||||
cp -RL fonts $(DIST_PATH)
|
||||
cp -RL templates $(DIST_PATH)
|
||||
rm -rf $(DIST_PATH)/templates/*.mjml $(DIST_PATH)/templates/partials/
|
||||
@@ -98,7 +98,7 @@ package:
|
||||
cp -RL $(BUILD_WEBAPP_DIR)/dist/* $(DIST_PATH)/client
|
||||
|
||||
@#Download MMCTL
|
||||
- scripts/download_mmctl_release.sh "" $(DIST_PATH)/bin
|
||||
+ #scripts/download_mmctl_release.sh "" $(DIST_PATH)/bin
|
||||
|
||||
@# Help files
|
||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||
@@ -127,7 +127,7 @@ endif
|
||||
|
||||
|
||||
@# ----- PLATFORM SPECIFIC -----
|
||||
-
|
||||
+_:
|
||||
@# Make osx package
|
||||
@# Copy binary
|
||||
ifeq ($(BUILDER_GOOS_GOARCH),"darwin_amd64")
|
||||
@@ -197,7 +197,7 @@ endif
|
||||
rm -f $(DIST_PATH)/bin/platform.exe
|
||||
rm -f $(DIST_PATH)/bin/mmctl.exe
|
||||
rm -f $(DIST_PATH)/prepackaged_plugins/*
|
||||
-
|
||||
+package-linux: package
|
||||
@# Make linux package
|
||||
@# Copy binary
|
||||
ifeq ($(BUILDER_GOOS_GOARCH),"linux_amd64")
|
||||
@@ -208,7 +208,7 @@ else
|
||||
cp $(GOBIN)/linux_amd64/platform $(DIST_PATH)/bin # from cross-compiled bin dir
|
||||
@@ -159,8 +159,8 @@ else
|
||||
cp $(GOBIN)/$(CURRENT_PACKAGE_ARCH)/$(MM_BIN_NAME) $(DIST_PATH_GENERIC)/bin # from cross-compiled bin dir
|
||||
endif
|
||||
#Download MMCTL for Linux
|
||||
- scripts/download_mmctl_release.sh "Linux" $(DIST_PATH)/bin
|
||||
+ #scripts/download_mmctl_release.sh "Linux" $(DIST_PATH)/bin
|
||||
@# Prepackage plugins
|
||||
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
|
||||
ARCH="linux-amd64"; \
|
||||
|
||||
- #Download MMCTL for $(MMCTL_PLATFORM)
|
||||
- scripts/download_mmctl_release.sh $(MMCTL_PLATFORM) $(DIST_PATH_GENERIC)/bin
|
||||
+ @#Copy cross-compiled MMCTL
|
||||
+ cp "${HOME}/go/src/github.com/mattermost/mmctl/mmctl" $(DIST_PATH_GENERIC)/bin
|
||||
|
||||
ifeq ("darwin_arm64","$(CURRENT_PACKAGE_ARCH)")
|
||||
echo "No plugins yet for $(CURRENT_PACKAGE_ARCH) platform, skipping..."
|
||||
|
||||
57
build.sh
57
build.sh
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
# build user
|
||||
BUILD_USER_HOME="${BUILD_USER_HOME:-/build}"
|
||||
@@ -6,12 +6,10 @@ BUILD_USER_NAME="${BUILD_USER_NAME:-build}"
|
||||
# Debian release used during build
|
||||
DEBIAN_RELEASE="${DEBIAN_RELEASE:-stretch}"
|
||||
# Mattermost version to build
|
||||
MATTERMOST_RELEASE="${MATTERMOST_RELEASE:-v5.4.0}"
|
||||
# node key id and release
|
||||
NODE_KEY="${NODE_KEY:-9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280}"
|
||||
NODE_RELEASE="${NODE_RELEASE:-10}"
|
||||
MATTERMOST_RELEASE="${MATTERMOST_RELEASE:-v5.26.0}"
|
||||
MMCTL_RELEASE="${MMCTL_RELEASE:-v5.26.0}"
|
||||
# golang version
|
||||
GO_VERSION="${GO_VERSION:-1.16.7}"
|
||||
GO_VERSION="${GO_VERSION:-1.18.1}"
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then # as root user
|
||||
# create build user, if needed
|
||||
@@ -34,20 +32,16 @@ if [ "$(id -u)" -eq 0 ]; then # as root user
|
||||
# dependencies to setup repositories
|
||||
apt-get install --quiet \
|
||||
gnupg2 dirmngr apt-transport-https ca-certificates curl
|
||||
# receive missing key
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
|
||||
# add required additional repositories
|
||||
printf 'deb-src http://deb.debian.org/debian %s main' "${DEBIAN_RELEASE}" \
|
||||
> "/etc/apt/sources.list.d/${DEBIAN_RELEASE}-source.list"
|
||||
printf 'deb http://deb.debian.org/debian %s-backports main' "${DEBIAN_RELEASE}" \
|
||||
> "/etc/apt/sources.list.d/${DEBIAN_RELEASE}-backports.list"
|
||||
printf 'deb https://deb.nodesource.com/node_%s.x %s main' "${NODE_RELEASE}" "${DEBIAN_RELEASE}" \
|
||||
> '/etc/apt/sources.list.d/nodesource.list'
|
||||
# update repositories
|
||||
apt-get update
|
||||
# install dependencies
|
||||
apt-get install --quiet \
|
||||
wget build-essential patch git nodejs
|
||||
wget build-essential patch git python2
|
||||
# install 'pngquant' build dependencies (required by node module)
|
||||
apt-get build-dep --quiet \
|
||||
pngquant
|
||||
@@ -60,7 +54,7 @@ if [ "$(id -u)" -eq 0 ]; then # as root user
|
||||
# FIXME go (executed by build user) writes to GOROOT
|
||||
install --directory --owner="${BUILD_USER_NAME}" \
|
||||
"$(go env GOROOT)/pkg/$(go env GOOS)_$(go env GOARCH)"
|
||||
# switch to build user
|
||||
# Re-invoke this build.sh script with the 'build' user
|
||||
runuser -u "${BUILD_USER_NAME}" -- "${0}"
|
||||
# salvage build artifacts
|
||||
cp --verbose \
|
||||
@@ -73,6 +67,12 @@ fi
|
||||
export GOROOT=/usr/local/go
|
||||
export PATH=$GOROOT/bin:$PATH
|
||||
cd "${HOME}"
|
||||
|
||||
# install NVM
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
|
||||
# download and extract Mattermost sources
|
||||
for COMPONENT in server webapp; do
|
||||
install --directory "${HOME}/go/src/github.com/mattermost/mattermost-${COMPONENT}"
|
||||
@@ -81,6 +81,33 @@ for COMPONENT in server webapp; do
|
||||
tar --directory="${HOME}/go/src/github.com/mattermost/mattermost-${COMPONENT}" \
|
||||
--strip-components=1 --extract --file="mattermost-${COMPONENT}.tar.gz"
|
||||
done
|
||||
|
||||
# install mattermost-webapp's required version of nodejs
|
||||
pushd "${HOME}/go/src/github.com/mattermost/mattermost-webapp"
|
||||
nvm install
|
||||
popd
|
||||
|
||||
# prepare the go build environment
|
||||
install --directory "${HOME}/go/bin"
|
||||
if [ "$(go env GOOS)_$(go env GOARCH)" != 'linux_amd64' ]; then
|
||||
ln --symbolic \
|
||||
"${HOME}/go/bin/$(go env GOOS)_$(go env GOARCH)" \
|
||||
"${HOME}/go/bin/linux_amd64"
|
||||
fi
|
||||
# build mmctl
|
||||
install --directory "${HOME}/go/src/github.com/mattermost/mmctl"
|
||||
wget --quiet --continue --output-document="mmctl.tar.gz" \
|
||||
"https://github.com/mattermost/mmctl/archive/${MMCTL_RELEASE}.tar.gz"
|
||||
tar --directory="${HOME}/go/src/github.com/mattermost/mmctl" \
|
||||
--strip-components=1 --extract --file="mmctl.tar.gz"
|
||||
find "${HOME}/go/src/github.com/mattermost/mmctl/" -type f -name '*.go' | xargs \
|
||||
sed -i \
|
||||
-e 's#//go:build linux || darwin#//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd#' \
|
||||
-e 's#// +build linux darwin#// +build linux darwin dragonfly freebsd netbsd openbsd#'
|
||||
make --directory="${HOME}/go/src/github.com/mattermost/mmctl" \
|
||||
BUILD_NUMBER="dev-$(go env GOOS)-$(go env GOARCH)-${MMCTL_RELEASE}" \
|
||||
ADVANCED_VET=0 \
|
||||
GO="GOARCH= GOOS= $(command -v go)"
|
||||
# build Mattermost webapp
|
||||
npm set progress false
|
||||
sed -i -e 's#--verbose#--display minimal#' \
|
||||
@@ -88,12 +115,6 @@ sed -i -e 's#--verbose#--display minimal#' \
|
||||
make --directory="${HOME}/go/src/github.com/mattermost/mattermost-webapp" \
|
||||
build
|
||||
# build Mattermost server
|
||||
install --directory "${HOME}/go/bin"
|
||||
if [ "$(go env GOOS)_$(go env GOARCH)" != 'linux_amd64' ]; then
|
||||
ln --symbolic \
|
||||
"${HOME}/go/bin/$(go env GOOS)_$(go env GOARCH)" \
|
||||
"${HOME}/go/bin/linux_amd64"
|
||||
fi
|
||||
patch --directory="${HOME}/go/src/github.com/mattermost/mattermost-server" \
|
||||
--strip=1 -t < "${HOME}/build-release.patch"
|
||||
sed -i \
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package main
|
||||
import _ "github.com/mattermost/mattermost-server/v5/model"
|
||||
func main() {/* dummy file */}
|
||||
|
||||
import _ "github.com/mattermost/mattermost-server/v6/model"
|
||||
import _ "github.com/mattermost/mmctl/commands"
|
||||
|
||||
func main() { /* dummy file */ }
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
module github.com/SmartHoneybee/ubiquitous-memory/dependabot
|
||||
|
||||
go 1.16
|
||||
go 1.18
|
||||
|
||||
require github.com/mattermost/mattermost-server/v5 v5.39.0
|
||||
require (
|
||||
github.com/mattermost/mattermost-server/v6 v7.5.2
|
||||
github.com/mattermost/mmctl v0.0.0-20211221153052-1bb2fec4c15e
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user