register jenkins service on mac os

2018/12/26

reference : https://medium.com/@fahimhossain_16989/adding-startup-scripts-to-launch-daemon-on-mac-os-x-sierra-10-12-6-7e0318c74de1

to /Library/LaunchDaemons/com.jenkins02.startup.plist ( root )

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>EnvironmentVariables</key>
    <dict>
      <key>PATH</key>
      <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:</string>
    </dict>
    <key>Label</key>             <string>com.jenkins02.startup</string>
    <key>Disabled</key>          <false/>
    <key>RunAtLoad</key>         <true/>
    <key>KeepAlive</key>         <true/>
    <key>LaunchOnlyOnce</key>    <true/>
    <key>SessionCreate</key>     <true/>
    <key>ThrottleInterval</key>  <integer>180</integer>
    <key>StandardOutPath</key>
    <string>/Volumes/Data/APP/jenkins/jenkins-slave-02/startup.stdout</string>
    <key>StandardErrorPath</key>
    <string>/Volumes/Data/APP/jenkins/jenkins-slave-02/startup.stderr</string>
    <key>UserName</key>
    <string>admin</string>
    <key>GroupName</key>
    <string>staff</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Volumes/Data/APP/jenkins/jenkins-slave-02/start-jenkins-slave-service.sh</string>
    </array>
</dict>
</plist>

load> sudo launchctl load -w /Library/LaunchDaemons/com.jenkins02.startup.plist

unload> sudo launchctl unload -w /Library/LaunchDaemons/com.jenkins02.startup.plist

log> StandardOutPath  , StandardErrorPath

cf) no background process

Advertisements

disable jenkins security

2018/12/07

config.xml

  • Login to your Jenkins server
  • Browse to JENKINS_HOME directory
  • Verify the content of config.xml file
  • Use the sed command shown below to disable security
  • Verify again the config.xml
  • Restart Jenkins
sed -i \
  's#<useSecurity>true#<useSecurity>false#g' \
  config.xml

sed -i \
  '/authorizationStrategy/d' \
  config.xml


config file provider plugin in jenkins

2018/11/28

https://plugins.jenkins.io/config-file-provider

  • Maven 은 3개의 settings.xml 이 존재
    • conf/settings.xml (Global)
    • .m2/settings.xml (User)
    • .m2/repository/settings.xml (Local)
  • 3개 settings.xml을 모두 사용하며, 3개가 merge된다. merge시 Local > User > Global 우선순위
  • Plugins는 Global Maven settings.xml을 설정시, (Global세팅)파일을 대체
  • Plugins는 Maven settings.xml을 설정시, (User세팅)파일을 대체
  • 프로젝트 별로 Global Maven settings.xml 설정시 서버의 .m2/settings.xml 과 id 가 충돌할 경우, 서버가 우선순위가 있기 때문에 Global Maven settings.xml 설정이 안먹음
  • Config Files > Add a new Config > Type에 Maven settings.xml,  Global Maven settings.xml  then Submit
    1. Global Maven Settings.xml: A global maven settings.xml which can be referenced within Apache Maven jobs. (ex) conf/settings.xml)
    2. Maven Settings.xml:  A settings.xml which can be referenced within Apache Maven jobs. ( .m2/settings.xml )
  • credential 사용시에는 username/password 방식의 credential을 등록.
  • 적용 Freestyle): Build Tab > Add build step > Invoke top-level Maven targets > 고급… > Global settings files > provided Global settings.xml >  Provided Settings
  • 적용 Maven project) : Build Tab > 고급… > Global settings files > provided Global settings.xml > Provided Settings

ansible plugin setting in jenkins

2018/11/28

prerequisites : install ansible  to slave ( default /usr/bin/ansible )

1) playbook 을 github 형상 내에 추가 ( ex. echo.yaml )

2) jenkins의 Source Code Management > git 에서 github 정보를 추가

3) jenkins의 build > invoke ansible playbook 선택 후 playbook 파일 경로 입력 ( 형상 checkout 받은 위치를 현재 위치로 보면 됩니다. )

inventory 항목에서 직접 입력 하거나 또는 형상 내 inventory file을 추가하여 지정하는 방식을 사용할 수 있음

 

참고자료 : https://wiki.jenkins.io/display/JENKINS/Ansible+Plugin

about jenkins’s ProcessTreeKiller

2018/11/13

link : https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller

you can disable this feature by setting a java property to the value “true”

e.g. java -Dhudson.util.ProcessTreeDisable=true -jar jenkins.jar ( or slave JVM)

  • how it works
    Killer는 프로세스 스폰/생성시의 환경변수 복사본을 가지고 있다가  job 종료시에 프로세스 목록을 뒤져서 동일한 환경변수를 가지고 있는 프로세스를 종료시키는 역할을 함.
  • if your build wants to leave a daemon running behind
    BUILD_ID 값을 바꾸면, jenkins는 빌드에서 스폰된 프로세스로 생각하지 않는다.
    e.g. BUILD_ID=dontkillmeJenkins /usr/apache/bin/httpd
    cf) pipeline의 경우에는 BUILD_ID 대신 JENKINS_NODE_COOKIE 값을 사용해야함

 

Docker and Jenkins as Code feedly

2018/10/26

Docker and Jenkins [as Code]
https://speakerdeck.com/onenashev/docker-and-jenkins-as-code

— via my feedly newsfeed

SRE: The Biggest Lie Since Kanban feedly

2018/10/26

SRE: The Biggest Lie Since Kanban
https://theagileadmin.com/2018/10/02/sre-the-biggest-lie-since-kanban/

— via my feedly newsfeed

マルチクラウドでContinuous Deliveryを実現するSpinnakerについて / Introduction of Spinnaker fee dly

2018/10/26

マルチクラウドでContinuous Deliveryを実現するSpinnakerについて / Introduction of Spinnaker
https://speakerdeck.com/mahito/introduction-of-spinnaker

— via my feedly newsfeed

Reason for outage template

2018/10/19

from https://speakerdeck.com/pheonix25/from-100-to-1000-plus-deployments-a-day-psconfasia-edition?slide=118

  1. what happend?
  2. How was it caused?
  3. What was the impact on Service?
  4. When did it happen?

RFO Meeting

#War room
Only join when you are actively participating in disturbance. Otherwise please leave.

Collaborative debugging game
https://sddconf.com/brands/sdd/library/DOLLARD-Debugging.pdf

 

CI/CD/CS: Implementing Continuous Security across Your Delivery Pipeline and at Run-Time

2018/09/19