GithubHelp home page GithubHelp logo

mattermost-build's Introduction

Mattermost build

Jenkins automation for building mattermost

Command to hook up new kuberntes cluster to docker repository

kubectl create secret docker-registry myregistrykey --docker-server=mmjenkins.azurecr.io --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD [email protected]

Deploying the build server locally

Prerequisites

  • virtualization platform
  • docker
  • install minikube, kubectl, helm by following instructions here:

Overview

  • startup minikube cluster
  • deploy mattermost-build (Jenkins)
  • run builds
  • destroy minikube cluster

Setup

minikube start

This will start a minikube environment with a default of 2GB and 2 cpus. These values can be set like this:

minikube start --memory 8192 --cpus 4 --mount

Config is stored in ~/.minikube

enable ingress

minikube addons enable ingress

Add tiller to the Kube cluster

helm init

Clone repo

git clone https://github.com/mattermost/mattermost-build.git
cd mattermost-build

Pull dependent charts

cd mattermost-jenkins
helm dep update

Deploy build server

Reuse the Docker daemon: https://github.com/kubernetes/minikube

eval $(minikube docker-env)

Now all docker commands on the host will actually run inside the minikube VM.

Build the server in k8s

make deploy-local

Get credentials for Jenkins

kubectl get secret build-mattermost-com-jenkins -o yaml
apiVersion: v1
data:
  jenkins-admin-password: ZG9ZcDJ0QzZXZg==
  jenkins-admin-user: YWRtaW4=
kind: Secret
metadata:
  creationTimestamp: 2017-11-04T14:12:40Z
  labels:
    app: build-mattermost-com-jenkins
    chart: jenkins-0.8.9
    heritage: Tiller
    release: build-mattermost-com
  name: build-mattermost-com-jenkins
  namespace: default
  resourceVersion: "15793"
  selfLink: /api/v1/namespaces/default/secrets/build-mattermost-com-jenkins
  uid: 38049232-c16a-11e7-bb92-080027fb5028
type: Opaque

Decode password

echo "ZG9ZcDJ0QzZXZg==" | base64 --decode

Get service URL to login to Jenkins

minikube service list

Run build jobs

Builds start running as soon as Jenkins is up. The current config pulls all branches from https://github.com/mattermost/mattermost-webapp and runs build/Jenkinsfile

Cleanup

Delete all pods but leave minikube up for a new deployment

make delete

Delete everything and shutdown minikube

make nuke

Issues

  • Currently bypassing the ingress controller. Should either adjust to use the ingress, or just remove it from local builds.
  • Change build job to stop it pulling all branches from github. Instead, it should pull from user-specified branch/location.

mattermost-build's People

Contributors

mthornba avatar crspeller avatar

Watchers

AmesianX avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.