Browse Source

dependabot (#38)

pull/39/head
Bee 4 years ago
committed by GitHub
parent
commit
30ae5ae434
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 75
      .travis.yml
  2. 7
      README.md
  3. 100
      build.sh
  4. 133
      dependabot/Gopkg.lock
  5. 3
      dependabot/Gopkg.toml
  6. 3
      dependabot/dummy.go

75
.travis.yml

@ -5,65 +5,40 @@ service:
- docker
env:
global:
- 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=5.4.0
- GOOS='dragonfly' GOARCH='amd64'
- GOOS='freebsd' GOARCH='amd64'
- GOOS='freebsd' GOARCH='arm'
- GOOS='linux' GOARCH='arm'
- GOOS='linux' GOARCH='arm64'
- GOOS='linux' GOARCH='mips'
- GOOS='linux' GOARCH='mips64'
- GOOS='linux' GOARCH='mips64le'
- GOOS='linux' GOARCH='mipsle'
- GOOS='linux' GOARCH='ppc64'
- GOOS='linux' GOARCH='ppc64le'
- GOOS='linux' GOARCH='s390x'
- GOOS='netbsd' GOARCH='amd64'
- GOOS='netbsd' GOARCH='arm'
- GOOS='openbsd' GOARCH='amd64'
- GOOS='openbsd' GOARCH='arm'
before_install:
- 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"
- export MATTERMOST_RELEASE="$(grep 'version' dependabot/Gopkg.toml | cut -d'"' -f2)"
- docker pull "${DOCKER_IMAGE}"
- chmod +x setup.sh
- chmod +x build.sh
script:
- docker run --interactive=true --mount="type=bind,source=${PWD},destination=${DOCKER_PWD}" --rm=true --tty=true --workdir="${DOCKER_PWD}" "${DOCKER_IMAGE}" ./setup.sh
- docker run --interactive=true --mount="type=bind,source=${PWD},destination=${DOCKER_PWD}" --rm=true --tty=true --workdir="${DOCKER_PWD}" -e DEBIAN_RELEASE -e MATTERMOST_RELEASE -e GOOS -e GOARCH "${DOCKER_IMAGE}" ./build.sh
before_deploy:
- git config --local user.name 'Travis CI'
- git config --local user.email 'travis@travis-ci.org'
- git tag "${MATTERMOST_RELEASE}"
deploy:
provider: releases
api_key: "${GITHUB_OAUTH_TOKEN}"
file:
- "${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"
- "${TRAVIS_BUILD_DIR}/mattermost-${MATTERMOST_RELEASE}-${GOOS}-${GOARCH}.tar.gz"
- "${TRAVIS_BUILD_DIR}/mattermost-${MATTERMOST_RELEASE}-${GOOS}-${GOARCH}.tar.gz.sha512sum"
skip_cleanup: true

7
README.md

@ -1,10 +1,9 @@
# ubiquitous-memory: [Here be dragons][3]
# ubiquitous-memory: [Here be dragons][2]
[![Build Status](https://travis-ci.org/SmartHoneybee/ubiquitous-memory.svg?branch=master)](https://travis-ci.org/SmartHoneybee/ubiquitous-memory)
[Travis CI][0] recipe that builds [Mattermost][1] for Linux on [ARMv7][2]-compatible devices.
[Travis CI][0] recipe that builds [Mattermost][1] for various operating systems and architectures.
[0]: https://travis-ci.org/SmartHoneybee/ubiquitous-memory
[1]: https://mattermost.com/
[2]: https://github.com/golang/go/wiki/GoArm#supported-architectures
[3]: https://en.wikipedia.org/wiki/Here_be_dragons
[2]: https://en.wikipedia.org/wiki/Here_be_dragons

100
build.sh

@ -0,0 +1,100 @@
#!/bin/sh
set -eux
# build user
BUILD_USER_HOME="${BUILD_USER_HOME:-/build}"
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}"
if [ "$(id -u)" -eq 0 ]; then # as root user
# create build user, if needed
set +e
if ! id -u "${BUILD_USER_NAME}"; then # create build user
set -e
useradd --create-home --home-dir "${BUILD_USER_HOME}" --skel "${PWD}" \
"${BUILD_USER_NAME}"
fi
set -e
# configure apt
printf 'APT::Install-Recommends "0";' \
> '/etc/apt/apt.conf.d/99-no-install-recommends'
printf 'APT::Install-Suggests "0";' \
> '/etc/apt/apt.conf.d/99-no-install-suggests'
printf 'APT::Get::Assume-Yes "true";' \
> '/etc/apt/apt.conf.d/99-assume-yes'
# update repositories
apt-get update
# dependencies to setup repositories
apt-get install --quiet \
gnupg2 dirmngr apt-transport-https ca-certificates
# receive missing key
apt-key adv --keyserver 'ipv4.pool.sks-keyservers.net' --recv-keys "${NODE_KEY}"
# 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 go from Debian backports
apt-get install --quiet --target-release "${DEBIAN_RELEASE}-backports" \
golang-go
# install dependencies
apt-get install --quiet \
wget build-essential patch git nodejs
# install 'pngquant' build dependencies (required by node module)
apt-get build-dep --quiet \
pngquant
# 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
runuser -u "${BUILD_USER_NAME}" -- "${0}"
# salvage build artifacts
cp --verbose \
"${BUILD_USER_HOME}/mattermost-${MATTERMOST_RELEASE}-$(go env GOOS)-$(go env GOARCH).tar.gz" \
"${BUILD_USER_HOME}/mattermost-${MATTERMOST_RELEASE}-$(go env GOOS)-$(go env GOARCH).tar.gz.sha512sum" \
"${HOME}"
exit 0
fi
# as non-root user
cd "${HOME}"
# install yarn
npm install yarn
# download and extract Mattermost sources
for COMPONENT in server webapp; do
install --directory "${HOME}/go/src/github.com/mattermost/mattermost-${COMPONENT}"
wget --quiet --continue --output-document="mattermost-${COMPONENT}.tar.gz" \
"https://github.com/mattermost/mattermost-${COMPONENT}/archive/${MATTERMOST_RELEASE}.tar.gz"
tar --directory="${HOME}/go/src/github.com/mattermost/mattermost-${COMPONENT}" \
--strip-components=1 --extract --file="mattermost-${COMPONENT}.tar.gz"
done
# build Mattermost webapp
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 < "${HOME}/build-release.patch"
make --directory="${HOME}/go/src/github.com/mattermost/mattermost-server" \
config-reset build-linux package-linux \
BUILD_NUMBER="dev-$(go env GOOS)-$(go env GOARCH)-${MATTERMOST_RELEASE}" \
GO="GOARCH=$(go env GOARCH) GOOS=$(go env GOOS) $(command -v go)" \
PLUGIN_PACKAGES=''
# rename archive and calculate its SHA512 sum
mv "${HOME}/go/src/github.com/mattermost/mattermost-server/dist/mattermost-team-linux-amd64.tar.gz" \
"${HOME}/mattermost-${MATTERMOST_RELEASE}-$(go env GOOS)-$(go env GOARCH).tar.gz"
sha512sum "${HOME}/mattermost-${MATTERMOST_RELEASE}-$(go env GOOS)-$(go env GOARCH).tar.gz" | \
tee "${HOME}/mattermost-${MATTERMOST_RELEASE}-$(go env GOOS)-$(go env GOARCH).tar.gz.sha512sum"

133
dependabot/Gopkg.lock

@ -0,0 +1,133 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
digest = "1:5247b135b5492aa232a731acdcb52b08f32b874cb398f21ab460396eadbe866b"
name = "github.com/google/uuid"
packages = ["."]
pruneopts = ""
revision = "d460ce9f8df2e77fb1ba55ca87fafed96c607494"
version = "v1.0.0"
[[projects]]
branch = "master"
digest = "1:ad21af51a0276292e9f6f5c37b966630138986478b1ecdbb94b907168fe25281"
name = "github.com/gorilla/websocket"
packages = ["."]
pruneopts = ""
revision = "483fb8d7c32fcb4b5636cd293a92e3935932e2f4"
[[projects]]
digest = "1:48a3138a87e866b217088fc5777fabc71c6c71fb63d4e42ef97e5717735f2b5d"
name = "github.com/mattermost/mattermost-server"
packages = [
"mlog",
"model",
"utils/jsonutils",
"utils/markdown",
]
pruneopts = ""
revision = "826252252404c13bf564a8c4fd51616fc2cc4df9"
version = "v5.5.0"
[[projects]]
digest = "1:9fa4a4a684dfb36f3ba1b0a163225140e19e3219e5576d0761d02dbd4c31b743"
name = "github.com/nicksnyder/go-i18n"
packages = [
"i18n",
"i18n/bundle",
"i18n/language",
"i18n/translation",
]
pruneopts = ""
revision = "0dc1626d56435e9d605a29875701721c54bc9bbd"
version = "v1.10.0"
[[projects]]
digest = "1:a5484d4fa43127138ae6e7b2299a6a52ae006c7f803d98d717f60abf3e97192e"
name = "github.com/pborman/uuid"
packages = ["."]
pruneopts = ""
revision = "adf5a7427709b9deb95d29d3fa8a2bf9cfd388f1"
version = "v1.2"
[[projects]]
digest = "1:894aef961c056b6d85d12bac890bf60c44e99b46292888bfa66caf529f804457"
name = "github.com/pelletier/go-toml"
packages = ["."]
pruneopts = ""
revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194"
version = "v1.2.0"
[[projects]]
digest = "1:7365acd48986e205ccb8652cc746f09c8b7876030d53710ea6ef7d0bd0dcd7ca"
name = "github.com/pkg/errors"
packages = ["."]
pruneopts = ""
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
digest = "1:74f86c458e82e1c4efbab95233e0cf51b7cc02dc03193be9f62cd81224e10401"
name = "go.uber.org/atomic"
packages = ["."]
pruneopts = ""
revision = "1ea20fb1cbb1cc08cbd0d913a96dead89aa18289"
version = "v1.3.2"
[[projects]]
digest = "1:22c7effcb4da0eacb2bb1940ee173fac010e9ef3c691f5de4b524d538bd980f5"
name = "go.uber.org/multierr"
packages = ["."]
pruneopts = ""
revision = "3c4937480c32f4c13a875a1829af76c98ca3d40a"
version = "v1.1.0"
[[projects]]
digest = "1:246f378f80fba6fcf0f191c486b6613265abd2bc0f2fa55a36b928c67352021e"
name = "go.uber.org/zap"
packages = [
".",
"buffer",
"internal/bufferpool",
"internal/color",
"internal/exit",
"zapcore",
]
pruneopts = ""
revision = "ff33455a0e382e8a81d14dd7c922020b6b5e7982"
version = "v1.9.1"
[[projects]]
branch = "master"
digest = "1:efb97ebbd73c3a7068579327f5d98a17c09f6d8caf1fa3212c506e8bb78126b5"
name = "golang.org/x/crypto"
packages = [
"bcrypt",
"blowfish",
]
pruneopts = ""
revision = "4d3f4d9ffa16a13f451c3b2999e9c49e9750bf06"
[[projects]]
digest = "1:11c58e19ff7ce22740423bb933f1ddca3bf575def40d5ac3437ec12871b1648b"
name = "gopkg.in/natefinch/lumberjack.v2"
packages = ["."]
pruneopts = ""
revision = "a96e63847dc3c67d17befa69c303767e2f84e54f"
version = "v2.1"
[[projects]]
digest = "1:f0620375dd1f6251d9973b5f2596228cc8042e887cd7f827e4220bc1ce8c30e2"
name = "gopkg.in/yaml.v2"
packages = ["."]
pruneopts = ""
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
version = "v2.2.1"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
input-imports = ["github.com/mattermost/mattermost-server/model"]
solver-name = "gps-cdcl"
solver-version = 1

3
dependabot/Gopkg.toml

@ -0,0 +1,3 @@
[[constraint]]
name = "github.com/mattermost/mattermost-server"
version = "v5.5.0"

3
dependabot/dummy.go

@ -0,0 +1,3 @@
package main
import _ "github.com/mattermost/mattermost-server/model"
func() main() {/* dummy file */}
Loading…
Cancel
Save