Fork me on GitHub

Labs: Jenkins Embeddable Build Status

Labs: Jenkins Embeddable Build Status

Jenkins exposes the current status of your build as an icon in a fixed URL. You can put this URL into other sites (such as GitHub README) so that people can see the current state of the build.

  • Install “Embeddable Build Status Plugin” at Jenkins -> Plugin Manager
  • Go to your job view, and click the “Embeddable Build Status” on the left.
  • Get the Markdown format link and put it into your README.md
Continue reading →

Docker On Docker

Labs: Pipeline with Dockerfile to run in the Slave Agent Node

Now you have Jenkins installed, If you have a Jenkinsfile try to run stage in a dedicated docker container instance, You have two options to resolve the dependency to docker.


 pipeline {
        //  agent  any

    stages {
        stage('Spell Check') {
                agent {
                    dockerfile {
                        filename 'Dockerfile.mdspell'
                        args '-u="root"'
                        }
                }
        }
    }

 }

Install Docker Within Jenkins Master

Slave Agent Node With Docker installed

For my case, I have Jenkins running as a Docker container in an Azure Ubuntu Linux VM, so in the VM host I already have Docker installed. But within the container of Jenkins, the docker is not installed.

So I specify another VM host with Docker installed as a slave agent node to the Jenkins Master host (192.168.1.1:8080). The Jenkins Master will assign pipeline jobs to the slave agent node to run.

  • Go to Jenkins-> Manage Jenkins-> Manage Node {Your-Jenkins-Root-URL}/computer/new and give the node a named “docker-agent”
  • Configure as below and Save.

    Add Node

  • Check the Node Log {Your-Jenkins-Root-URL}/computer/docker-agent/log to make sure the agent connected.

Notes: during my setting up, the log remind me to install Java in the slave agent node.


sudo apt install openjdk-8-jdk


Continue reading →

Labs: GitHub Push触发Jenkins自动构建

Labs: GitHub Push触发Jenkins自动构建

GitHub上配置Jenkins的webhook地址

  • Step 1: 假设Jenkins所在服务器的地址是:192.168.0.1,端口为8080,那么webhook地址就是 http://192.168.0.1:8080/github-webhook/

  • Step 2: GitHub -> Settings -> Webhooks -> Add webhook and fill Payload URL with the webhook address in step 1.

Troubleshoot

  • Error: We couldn’t deliver this payload: Failure when receiving data from the peer.

    Make sure the port of the Jenkins Server allow the inbound from GitHub. If the Jenkins Server is hosted in Azure VM, define an inbound port rule to allow traffic from GitHub Server.

Generate Personal Access Token

当Jenkins 接收到来之GitHub的webhook 的通知后,Jenkins需要访问GitHub repository的时候,有的操作是需要授权的,所以我们要在GitHub上生成授权的token给Jenkins使用,这就是Personal access tokens.

Jenkins配置

  • Manage Jenkins->Configure System -> Add GitHub Server
  • Fill “API URL” with https://api.github.com, “Credentials” Choose “Add”

    Add GitHub Server

  • In The pop up form,”Kind” Choose ”Secret text”,”Secret”填入前面在GitHub上生成的Personal access tokens.

  • 填写完毕后,点击Configure System页面中右侧的”Test connection”按钮.
Continue reading →

The Sre Workbook Reading Notes

Reading Notes: The Site Reliability Workbook: Practical Ways to Implement SRE

Chapter 8 On Call

Google’s on-call practice:

  • Make sure never achieve reliability at the expense of an on-call engineer’s health.
  • SRE work should be a healthy mix of duties: on-call and project work.
  • Google SRE target a maximum of two incidents per on-call shift.
  • cash compensation for on-call.

The responsibilities of on-call engineers:

  • The on-call engineer minimizes user impact first, then makes sure the issues are fully addressed.
  • At the start of each shift, the on-call engineer reads the handoff from the previous shift.
  • At the end of the shift, the on-call engineer sends a handoff email to the next engineer on-call.
Continue reading →

Reading Notes: Peopleware: Productive Projects and Teams

Reading Notes: Peopleware: Productive Projects and Teams

Part I: Manage The Human Resource

The major problems of our work are not so much technological as sociological in nature.

  • The high tech illusion

    The researchers who made fundamental breakthroughs in those areas are in a high-tech business. The rest of us are appliers of their work.

    We use computers and other new technology components to develop our products or to organize our affairs. We are mostly in the human communication business.

    Our successes come from good human interactions.

Chapter 2: Make a Cheeseburger, Sell a Cheeseburger

  • We have to learn to do work less of the time and think about the work more.

    我们必须学会花更少的时间工作和花更多的时间思考工作本身。

Chapter 3

  • People under time pressure don’t work better - they just work faster with low quality.

Chapter 4 Quality

  • Quality, far beyond that required by the end user, is a means to higher productivity.

    远远超过超过最终用户需求的质量是取得更高生产力的手段。

Chapter 5

  • Organizational busy work tend to expand to fill the working day.

Chapter 6

  • Lose weight while sleeping

  • False Hope: Technology is moving swiftly, that you’re being passed by.

    Technology is moving swiftly, but (the High-Tech Illusion again) most of what you’re doing is not truly high-tech work.

  • That is Management

    The manager’s function is not to make people work, but to make it possible for people to work.

Part II: The Office Environment

In Part II, we’ll look into some of the causes of lost time and propose measures that you can take to create a healthy, work-conducive environment.

Chapter 8 You never get anything done around here between 9 and 5

If you manage a team of people who need to use their brains during the workday, then the workplace environment (quite,space, and privacy) is your business.

Chapter 10 Brain Time versus Body Time

  • Flow State

The phenomena of flow and immersion give us a more realistic way to model how time is applied to a development task. What matters is not the amount of time you’re present, but the amount of time that you’re working at full potential. An hour in flow really accomplishes something, but 10 six-minute work periods sandwiched between 11 interruptions won’t accomplish anything.

  • The E-Factor

E-Factor = Uninterrupted Hours/Body-Present Hours

Chapter 11

Chapter 13

Design Your Workspace

  • Sit Behind A wall And Make Sure At Least Eight Feet A Wall In Front

    As you work, you want to occasionally look up and rest your eyes by focusing on something farther away than the desk.

    If there is a blank wall closer than eight feet your eyes will not change focus and they get no relief.

  • Windows

Part III The Right People

Chapter 16 Hiring The Juggler

When you set out to hire a programmer, the rules of common sense are often suspended. You don’t ask to see a design or a program or anything. In fact, the interview is just talk.

  • Build Your Portfolio and show it off as part of each interview next time.

    How to build it then? Put everything as code.

    • document as code and render as blog post in GitHub page.
    • projects as code and deploy the projects into Cloud.
    • when learn new technology or tool, set up a running instance in the cloud to practice and demonstrate what you did.

Chapter 19 Happy To Be Here

  • The Cost of Turnover
  • Why People Leave
    • A just-passing-through mentality: Co-workers engender no feelings of long-term involvement in the job.
    • A feeling of disposability: Management can only think of its workers as interchangeable parts (since turnover is so high, nobody is indispensable).
    • The company move
Continue reading →

All Tags

mindset

devops

book

ci

communication

jenkins

自媒体

hometown

geek life

cloud