Linux

linux: lang: APT Commands

Install package

sudo apt install keyword

Search cache

apt-cache search keyword

File installed package location

sudo apt content keyword

Dependencies

sudo apt depends keyword

Search for a package

sudo apt search keyword

Show package info

sudo apt show keyword

Verify a package

sudo apt check keyword

List recommended missing packages of given package

sudo apt recommends keyword

Check package version

sudo apt version keyword

Tags

Jenkins 05 - Manage Users/Roles

Managing Users & Roles

Default Logic

  • Before Roles are Created, ALL users are admin
  • Need Role Strategy Plugin to create/manage 'Roles'
    •  
  • Create Roles, then assign users to lock system down
  • Manage Jenkins > Manage Users > Create User
  • API Token
  • User must login to view the API Token ( for REST calls to Jenkins )

Role Strategy Plugin

Manual Installation

Download Manually

cd /var/lib/jenkins/plugins
wget --no-cookies "https://updates.jenkins.io/download/plugins/role-strategy/2.8.1/role-strategy.hpi"
systemctl restart jenkins

 

Tags

Jenkins: 04 - Jenkins CLI

Jenkins CLI

WHY

  • CLI uses less memory
  • Continuous Integration Hooks

Configure Global Security

  • Manage Jenkins > Configure Global Security > Enable security = Yes
  • <ip>::8080/cli
  • You can access various features in Jenkins through a command-line tool. See the documentation for more details of this feature.To get started, download jenkins-cli.jar, and run it as follows
  • java -jar jenkins-cli.jar -s http://192.168.0.103:8080/ help
  •  
  • Copy jenkins-cli.jar
    • FROM
/var/cache/jenkins/war/WEB-INF/jenkins-cli.jar
  • TO
/usr/lib/jenkins/

 

Tags

Jenkins: 03 - Changing Jenkins Home Directory

Changing Deployment Location

  • http://192.168.0.103:8080/configure
  • var/lib/jenkins
    • Copy ALL data to NEW location
  • /etc/sysconfig/jenkins
    • Change env variable JENKINS_HOME
      • OR
      • export JENKINS_HOME=<path>
    • Change other paths
  • etc/init.d/jenkins
    • update paths
  • /home/<user>/.bash_profile
    • update PATH
  • systemctl restart jenkins
    • OR
    • <ip>:8080/restart
  • <ip>:8080/systemInfo

Basic Deployment Locations

/etc/init.d/jenkins

# Check for missing binaries (stale symlinks should not happen)

JENKINS_WAR="/usr/lib/jenkins/jenkins.war"

# Check for existence of needed config file and read it
JENKINS_CONFIG=/etc/sysconfig/jenkins

JENKINS_PID_FILE="/var/run/jenkins.pid"

# Source function library.
.
Tags

Jenkins: 01 - Jenkins Deploy & Config (Centos7.dev)

Deploying Jenkins on CentOS7 ( jetty/winstone )

 

Install Folders

  • /var/lib/jenkins - filesystem
  • /usr/lib/jenkins - jenkins.war
  • /etc/init.d/jenkins - init & config

 

Finding Packages with Yum

sudo -c 'yum list wget'


Pull Jenkins Repo

  • Pull jenkins repo
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

 

  • Get key for to validate the jenkins package
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

 

Tags
Subscribe to Linux