1
0
mirror of https://github.com/SmartHoneybee/ubiquitous-memory synced 2025-10-24 23:33:48 +02:00

Compare commits

...

13 Commits

Author SHA1 Message Date
Bee
4f58e13ed1 docker pull debian:stretch (#35) 2018-10-16 14:16:10 +00:00
Bee
205431da5a Update .travis.yml (#34) 2018-09-19 09:51:35 +00:00
Bee
62ff5c6c21 Update .travis.yml (#33) 2018-09-14 15:47:08 +00:00
Bee
c602d86ba3 Update .travis.yml (#32) 2018-08-17 19:18:58 +02:00
Bee
f95c324df8 Update .travis.yml (#31) 2018-07-14 17:34:07 +02:00
Bee
27211d5341 Update .travis.yml (#30) 2018-07-11 09:19:47 +02:00
Bee
04a80b8c61 Update .travis.yml (#29) 2018-06-15 19:41:25 +02:00
Bee
cce9a5e9f6 Update .travis.yml (#28) 2018-06-02 17:36:34 +02:00
Bee
4338daa488 Update .travis.yml (#27) 2018-05-16 07:41:25 +02:00
Bee
adfadb5db1 Update .travis.yml (#26) 2018-05-03 23:51:58 +02:00
Bee
9ec2d52a6f Update .travis.yml (#25) 2018-04-27 08:30:19 +02:00
Bee
73a0247466 Update .travis.yml (#24) 2018-04-15 11:28:06 +02:00
Bee
8e48ad9fd6 Update .travis.yml (#23) 2018-03-16 07:59:56 +01:00
4 changed files with 90 additions and 80 deletions

View File

@@ -1,49 +1,69 @@
language: c
dist: trusty
addons:
apt:
sources:
- sourceline: 'deb https://dl.yarnpkg.com/debian/ stable main'
key_url: 'https://dl.yarnpkg.com/debian/pubkey.gpg'
- sourceline: 'deb https://deb.nodesource.com/node_9.x trusty main'
key_url: 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key'
packages:
- nodejs
- yarn
- build-essential
sudo: required
service:
- docker
env:
global:
- GOV=1.10
- GOSHA="b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33 go${GOV}.linux-amd64.tar.gz"
- GOPATH="${HOME}/go"
- GOROOT="${HOME}/${GOV}/go"
- PATH="${GOROOT}/bin:${PATH}:${GOPATH}/bin"
- SRCROOT="${GOPATH}/src/github.com/mattermost"
- GOARM=7
- APT_KEY_NODEJS='9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280'
- DEBIAN_RELEASE='stretch'
- DOCKER_BUILD_USER='build-user'
- DOCKER_PWD='/root'
- DOCKER_IMAGE="debian:${DEBIAN_RELEASE}"
- GOPATH='${HOME}/go'
- SRCROOT="${GOPATH}/src/github.com/mattermost"
matrix:
- V=4.7.2
- V=5.4.0
before_install:
- install -d "${GOPATH}" "${GOROOT}" "${SRCROOT}/mattermost-"{server,webapp}
- wget -q "https://storage.googleapis.com/golang/go${GOV}.linux-amd64.tar.gz"
- sha256sum --check <<< "${GOSHA}"
- tar -C "${HOME}/${GOV}" -xzf "go${GOV}.linux-amd64.tar.gz"
- ulimit -n 8096
- wget -q "https://github.com/mattermost/mattermost-server/archive/v${V}.tar.gz" -O mattermost-server.tar.gz
- tar -C "${SRCROOT}/mattermost-server" --strip-components=1 -xf mattermost-server.tar.gz
- wget -q "https://github.com/mattermost/mattermost-webapp/archive/v${V}.tar.gz" -O mattermost-webapp.tar.gz
- tar -C "${SRCROOT}/mattermost-webapp" --strip-components=1 -xf mattermost-webapp.tar.gz
- l() { echo "${@}" >> setup.sh; }
- l '#!/bin/bash'
- l set -ex
# setup build environment as root
- l 'if [ ${UID} -eq 0 ]; then'
- l useradd -md "${DOCKER_PWD}/${DOCKER_BUILD_USER}" "${DOCKER_BUILD_USER}"
- l echo 'APT::Install-Recommends "0"\; APT::Install-Suggests "0"\;' '>' /etc/apt/apt.conf.d/99reduce-it
- l apt-get update
- l apt-get install -yq gnupg2 dirmngr apt-transport-https ca-certificates
- l apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "${APT_KEY_NODEJS}"
- l echo "deb http://deb.debian.org/debian ${DEBIAN_RELEASE}-backports main" '>' /etc/apt/sources.list.d/backports.list
- l echo "deb-src http://deb.debian.org/debian ${DEBIAN_RELEASE} main" '>' /etc/apt/sources.list.d/stable-source.list
- l echo "deb https://deb.nodesource.com/node_10.x ${DEBIAN_RELEASE} main" '>' /etc/apt/sources.list.d/bad-node.list
- l apt-get update
- l apt-get install -yqt "${DEBIAN_RELEASE}-backports" golang-go
- l apt-get install -yq wget build-essential patch git nodejs
- l apt-get build-dep -yq pngquant
- l install -d -o "${DOCKER_BUILD_USER}" '"$(go env GOROOT)/pkg/linux_arm"'
- l cp --verbose '"${0}"' "${DOCKER_PWD}/${DOCKER_BUILD_USER}"
# switch to non-root user
- l exec su --shell /bin/bash --login "${DOCKER_BUILD_USER}" '"${0}"' '"${@}"'
- l 'fi'
# build as non-root user
- l install -d "${SRCROOT}/mattermost-{server,webapp}" "${GOPATH}/bin"
- l npm install yarn
- l wget -q "https://github.com/mattermost/mattermost-server/archive/v${V}.tar.gz" -O mattermost-server.tar.gz
- l tar -C "${SRCROOT}/mattermost-server" --strip-components=1 -xf mattermost-server.tar.gz
- l wget -q "https://github.com/mattermost/mattermost-webapp/archive/v${V}.tar.gz" -O mattermost-webapp.tar.gz
- l tar -C "${SRCROOT}/mattermost-webapp" --strip-components=1 -xf mattermost-webapp.tar.gz
- l make build -C "${SRCROOT}/mattermost-webapp"
# workaround (instead of patch): platform binary is in GOOS_GOARCH, Makefile expects it in linux_amd64
- l ln -s "${GOPATH}/bin/linux_arm" "${GOPATH}/bin/linux_amd64"
# adapt and revert reverted commit, https://github.com/mattermost/mattermost-server/pull/8537
- l patch -d "${SRCROOT}/mattermost-server" -p1 '<' "${DOCKER_PWD}/build-release.patch"
# workaround (instead of patch): overwrite GO variable to enforce desired GOARCH
- l export GOPATH="${GOPATH}" GOARM=7
- l make config-reset build-linux package-linux -C "${SRCROOT}/mattermost-server" PLUGIN_PACKAGES="" GO='"GOARCH=arm $(which go)"' BUILD_NUMBER="dev-arm-tag${V}"
# workaround (instead of patch): Makefile creates *-amd64.tar.gz
- l mv "${SRCROOT}/mattermost-server/dist/mattermost-team-linux-amd64.tar.gz" "${DOCKER_PWD}/${DOCKER_BUILD_USER}/mattermost-${V}-arm.tar.gz"
- l sha512sum "${DOCKER_PWD}/${DOCKER_BUILD_USER}/mattermost-${V}-arm.tar.gz" '|' tee "${DOCKER_PWD}/${DOCKER_BUILD_USER}/mattermost-${V}-arm.tar.gz.sha512sum"
- docker pull "${DOCKER_IMAGE}"
- chmod +x setup.sh
script:
- patch -d "${SRCROOT}/mattermost-webapp" -p1 < "${TRAVIS_BUILD_DIR}/webpack.patch"
- make build -C "${SRCROOT}/mattermost-webapp"
- patch -d "${SRCROOT}/mattermost-server" -p1 < "${TRAVIS_BUILD_DIR}/make.patch"
- go get -d github.com/mattermost/mattermost-server/...
- make config-reset build-linux package-linux -C "${SRCROOT}/mattermost-server" GO="GOARCH=arm $(which go)" BUILD_NUMBER="dev-arm-tag${V}"
- mv "${SRCROOT}/mattermost-server/dist/mattermost-team-linux-arm.tar.gz" "${TRAVIS_BUILD_DIR}/mattermost-${V}-arm.tar.gz"
- sha512sum "${TRAVIS_BUILD_DIR}/mattermost-${V}-arm.tar.gz" | tee "${TRAVIS_BUILD_DIR}/mattermost-${V}-arm.tar.gz.sha512sum"
- docker run --interactive=true --mount="type=bind,source=${PWD},destination=${DOCKER_PWD}" --rm=true --tty=true --workdir="${DOCKER_PWD}" "${DOCKER_IMAGE}" ./setup.sh
deploy:
provider: releases
api_key: "${GITHUB_OAUTH_TOKEN}"
file:
- "${TRAVIS_BUILD_DIR}/mattermost-${V}-arm.tar.gz"
- "${TRAVIS_BUILD_DIR}/mattermost-${V}-arm.tar.gz.sha512sum"
- "${TRAVIS_BUILD_DIR}/${DOCKER_BUILD_USER}/setup.sh"
- "${TRAVIS_BUILD_DIR}/${DOCKER_BUILD_USER}/mattermost-${V}-arm.tar.gz"
- "${TRAVIS_BUILD_DIR}/${DOCKER_BUILD_USER}/mattermost-${V}-arm.tar.gz.sha512sum"
skip_cleanup: true

33
build-release.patch Normal file
View File

@@ -0,0 +1,33 @@
From 556e16211ed1b4c146ca2a094688618458182ae7 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Wed, 6 Jun 2018 12:34:56 +0100
Subject: [PATCH] Split make goal
---
build/release.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/build/release.mk b/build/release.mk
index 238343e..1b7859f 100644
--- a/build/release.mk
+++ b/build/release.mk
@@ -61,7 +61,7 @@ endif
cp README.md $(DIST_PATH)
@# ----- PLATFORM SPECIFIC -----
-
+_:
@# Make osx package
@# Copy binary
ifeq ($(BUILDER_GOOS_GOARCH),"darwin_amd64")
@@ -106,7 +106,7 @@ endif
rm -f $(DIST_PATH)/bin/mattermost.exe
rm -f $(DIST_PATH)/bin/platform.exe
rm -f $(DIST_PATH)/prepackaged_plugins/*
-
+package-linux: package
@# Make linux package
@# Copy binary
ifeq ($(BUILDER_GOOS_GOARCH),"linux_amd64")
--
2.11.0

View File

@@ -1,30 +0,0 @@
diff --git a/build/release.mk b/build/release.mk
index 5eaee80..e0e13bf 100644
--- a/build/release.mk
+++ b/build/release.mk
@@ -59,6 +59,7 @@ endif
cp NOTICE.txt $(DIST_PATH)
cp README.md $(DIST_PATH)
+_:
@# ----- PLATFORM SPECIFIC -----
@# Make osx package
@@ -85,14 +86,15 @@ endif
@# Cleanup
rm -f $(DIST_PATH)/bin/platform.exe
+package-linux: package
@# Make linux package
@# Copy binary
ifeq ($(BUILDER_GOOS_GOARCH),"linux_amd64")
cp $(GOPATH)/bin/platform $(DIST_PATH)/bin # from native bin dir, not cross-compiled
else
- cp $(GOPATH)/bin/linux_amd64/platform $(DIST_PATH)/bin # from cross-compiled bin dir
+ cp $(GOPATH)/bin/linux_arm/platform $(DIST_PATH)/bin # from cross-compiled bin dir
endif
@# Package
- tar -C dist -czf $(DIST_PATH)-$(BUILD_TYPE_NAME)-linux-amd64.tar.gz mattermost
+ tar -C dist -czf $(DIST_PATH)-$(BUILD_TYPE_NAME)-linux-arm.tar.gz mattermost
@# Don't clean up native package so dev machines will have an unzipped package available
@#rm -f $(DIST_PATH)/bin/platform

View File

@@ -1,13 +0,0 @@
diff --git a/package.json b/package.json
index d4eabf8..d076a53 100644
--- a/package.json
+++ b/package.json
@@ -146,7 +146,7 @@
"scripts": {
"check": "eslint --ignore-pattern node_modules --ignore-pattern non_npm_dependencies --ignore-pattern dist --ext .js --ext .jsx . --quiet",
"fix": "eslint --ignore-pattern node_modules --ignore-pattern non_npm_dependencies --ignore-pattern dist --ext .js --ext .jsx . --quiet --fix",
- "build": "cross-env NODE_ENV=production webpack --display-error-details --verbose --progress",
+ "build": "cross-env NODE_ENV=production webpack --display-error-details --progress",
"run": "cross-env NODE_ENV=production webpack --progress --watch",
"run-fullmap": "webpack --progress --watch",
"test": "jest --forceExit",