[컴] jenkins 의 plugin list 를 추출하는 법

jenkins plugin 설치 / batch / cli 에서 설치 / 뽑기

jenkins 의 plugin list 를 추출하는 법

jenkins web page 에서 추출하기

https:///script 로 가서

Jenkins.instance.pluginManager.plugins.each{
  plugin -> 
    println ("${plugin.getShortName()}:${plugin.getVersion()}")
}

jenkins cli 로 뽑기

cli 는 다음처럼 받을 수 있다.

curl https:///jnlpJars/jenkins-cli.jar -o jenkins-cli.jar
// get_plugin_list.groovy
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
plugins.each {println "${it.getShortName()}: ${it.getVersion()}"}
java -jar jenkins-cli.jar -s https:// -auth "namh:who1sthegoodman" groovy = < get_plugin_list.groovy >  plugins.txt

jenkins cli 로 plugin 설치

testing - How to install jenkins plugins from command line? - Stack Overflow

java -jar jenkins-cli.jar -s https://inhouse.foodpang.co/ci -auth <username>:<password> install-plugin <plugin_name1> <plugin_name2> ...

Reference

  1. How to get a list of installed Jenkins plugins with name and version pair - Stack Overflow

[컴][유틸] 2024-03, 에디터

hexa editor / hex editor / 괜찮은 hex editor

2024-03, 에디터

See Also

  1. 쿠…sal: [컴] sublime text 2 에서 binary 파일을 text 파일로 열기
  2. 쿠…sal: [컴][유틸] 대용량 파일 뷰어 big size file viewer

[컴] gradle java build 에서 git commit hash id 를 추가

스프링 / 스프링부트 / spring /

gradle java build 에서 git commit hash id 를 추가

com.gorylenko.gradle-git-properties gradle plugin 을 이용할 것이다.

build.gralde

아래처럼 build.gradle 을 설정하자. build 를 하면 build/resources/main/git.properties 가 만들어진다.

plugins {
  id "com.gorylenko.gradle-git-properties" version "2.4.1"
}
...
gitProperties {
    keys = ['git.branch','git.commit.id','git.commit.time']
    customProperty 'greeting', 'Hello' // expression
    // Customize file name (could be a file name or a relative file path below gitPropertiesResourceDir dir)
    gitPropertiesName = "my-git-file.properties"
    dotGitDirectory = file("${project.rootDir}/.git") # 정의하지 않으면, 자동으로 .git folder를 찾는다.
}

git.properties

위에서 gitPropertiesName 로 properties file 의 이름을 변경했기에, build/resources/main/my-git-file.properties 가 만들어진다.

my-git-file.properties 의 내용은 다음과 같다.

// build/resources/main/my-git-file.properties
git.branch=mybranch_name
git.commit.id=0c5da9f4f7312bb6c02f21c47ae129b31a006046
git.commit.time=2024-03-10T11\:18\:37+0900
greeting=Hello

jar 에서 위치

그리고 이것은 gradlew build 를 할 때 아래 경로에 들어가게 된다.

  • myjar-0.0.1.jar\BOOT-INF\classes\git.properties

SpringBoot

[컴] amazone 의 Correctto 17

 

amazone 의 Correctto 17

아마존에서 제공하는 OpenJDK 17 로 보면 된다. LTS(Long Term Support) 를 지원한다.

curl -LO https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz

아래 링크에 가면, deb, rpm 등도 다운로드 받을 수 있다.

[컴] MySql virtual column

mariadb 마리아db /

MySql virtual column

ALTER TABLE t1 ADD COLUMN c2 INT GENERATED ALWAYS AS (c1 + 1) STORED;
ALTER TABLE t1 ADD COLUMN c2 INT GENERATED ALWAYS AS (c1 + 1) VIRTUAL;

다른 table의 column을 이용하려면, view를 만드는 것도 방법이다.

Reference

  1. Generated (Virtual and Persistent/Stored) Columns - MariaDB Knowledge Base
  2. mysql - Stored/Virtual Generated Column- Pros/Cons/Best Practices? - Stack Overflow

[컴] SpringBoot 3.x 의 logging 설정

logback config / springboot log configuration / log config / spring log / 기간 설정

SpringBoot 3.x 의 logging 설정

spring-boot-starter-web을 사용한다면 logback 이 dependency 에 걸려있어서 자동으로 추가된다.

좀 더 자세한 logback option 의 설명

logback.rollingpolicy.max-history 에 대한 설명

TimeBasedRollingPolicy 를 사용한다면, max-history 는 ’며칠의 log를 보관하는 지를 결정’하는 설정이 된다고 한다.

totalSizeCap 을 설정해놓는 것이 disk usage 를 관리하는데 도움이 될 것이라고 한다.

[[컴] kafka app log 주기적으로 삭제

remove kakfka application log / kafka stream log / 자동 삭제

kafka app log 주기적으로 삭제

kafka log 라고 하면 대체로 data 에서 사용하는 log 로 검색된다. 여기선 kafka app 이 찍는 log 를 이야기 한다. 이것은 log4j 로 되어 있어서 log4j 설정을 잡아주면 된다. MaxFileSize, MaxBackupIndex 를 사용하면 된다.

  • MaxFileSize
  • MaxBackupIndex
log4j.rootLogger=INFO, stdout, kafkaAppender

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n

log4j.appender.kafkaAppender=org.apache.log4j.RollingFileAppender
log4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log
log4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
log4j.appender.kafkaAppender.MaxFileSize=500MB
log4j.appender.kafkaAppender.MaxBackupIndex=5
...

DailyRollingFileAppender 에서 사용은 주의하자.

DailyRollingFileAppender 에서 MaxBackupIndex = 3 를 사용한다고 해도, 이것이 3일치 log를 보관하는 것을 이야기하는 것은 아니다. 같은 이름의 log에 대해서 backup 을 3개까지 보관가능하다는 뜻이다.

log.2009-11-07.1, log.2009-11-07.2, log.2009-11-07.3 을 보관한다는 이야기다.

Reference

  1. Kafka logs are not deleted - Ops - Confluent Community
  2. Logging · The Internals of Apache Kafka