Code Monkey home page Code Monkey logo

jenkins's Introduction

Jenkins

  • Install jenkings plugin "google kubernetes engine"
  • Install kubectl inside docker container that has jenkins inside.
# Set the Kubernetes version as found in the UCP Dashboard or API

k8sversion=v1.11.5

# Get the kubectl binary.
curl -LO https://storage.googleapis.com/kubernetes-release/release/$k8sversion/bin/linux/amd64/kubectl

# Make the kubectl binary executable.
chmod +x ./kubectl

# Move the kubectl executable to /usr/local/bin.
sudo mv ./kubectl /usr/local/bin/kubectl
OR
mv ./kubectl /usr/local/bin/kubectl

POC (Local installation)

  • Install jenkings plugin "google kubernetes engine"
  • Install kubectl inside docker container that has jenkins inside.
# Set the Kubernetes version as found in the UCP Dashboard or API
k8sversion=v1.11.5

# Get the kubectl binary.
curl -LO https://storage.googleapis.com/kubernetes-release/release/$k8sversion/bin/linux/amd64/kubectl

# Make the kubectl binary executable.
chmod +x ./kubectl

# Move the kubectl executable to /usr/local/bin.
sudo mv ./kubectl /usr/local/bin/kubectl
OR
mv ./kubectl /usr/local/bin/kubectl
docker run -d --name grafana -p 3000:3000 grafana/grafana
docker run -d --name influxdb -p 8086:8086 influxdb
  • Access the container (if installed locally):
docker run -u root --rm -d -p 8080:8080  -p 50000:50000  -v jenkins-data:/var/jenkins_home  -v /var/run/docker.sock:/var/run/docker.sock  jenkinsci/blueocean
sudo docker exec -it name-of-container /bin/bash (Jenkins version installed : 2.164.2)
  • Create grafana database run: CREATE DATABASE grafana

docker run --rm --link=influxdb -it influxdb influx -host influxdb OR curl -i -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb"

  • Configure influxdb: set an user of the database with password curl -G http://localhost:8086/query -u todd:influxdb4ever --data-urlencode "q=SHOW DATABASES" or access the DB via docker and configure users following:
* https://docs.influxdata.com/influxdb/v1.7/administration/authentication_and_authorization/
* https://hub.docker.com/_/influxdb/
  • Create a datasource of influxdb type on grafana (localhost:3000)(http access via browser)

  • Connect github (could be github enterprise) repo with jenkins installed (using blue ocean plugin)

  • Install other needed plugins: junit, influxdb, jacoco, git and pipeline.

  • Configure the influxdb target on jenkins overall configuration (use global listener)

  • Test a hello world job on shell executor and see if data is being stored by influxdb (using localhost influxdb url)

  • Construct the pipelines (backend-frontend) needed to run.(see pipelines)

Hints for jenkins usage

  • Durability/Scallability of pipelines
  • Parallel usage
  • preserveStashes for use if a "restar stage" option is used
  • Use groovySandbox, ScriptSecurity plugin foir security
  • Use Secrets for passwords etc.
  • Keep it simple, try to use more declarative than scripted.
  • Use comand line tools instead of groovy tools for XML and JSON parsing
  • Try to use external scripts and tools insted of groovy
  • Reduce number of steps in pipeline
  • Try to use Configuration as a code plugins.

jenkins's People

Contributors

dirakx1 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.