sh ‘’’
git add Deployment.txt
git commit -m “updating deployment.txt”
git push http://id:pw@10.158.xxx.xxx:port/root/hello-world.git
‘’’

'나는 노동자 > Jenkins' 카테고리의 다른 글

wrap[$class: ‘BuildUser’]) error  (0) 2020.01.07
jenkins cleanWs()  (0) 2020.01.06
git clone username password  (0) 2019.12.18
gitlab 암호 잊어버렸을때  (0) 2019.11.13
Jenkins security login  (0) 2019.11.08

빌드시
build-user-vars-plugin 가 설치되었는데요
아래와 같은 에러가 발생할 경우

java.lang.UnsupportedOperationException: no known iplementation of class jenkins.tasks.SimpleBuildWrapper is named BuildUser~~
이런식의 에러가 발생할 경우 플러그인을 1.5버젼 이상으로 설치해야한다

mirrors.jenkins-ci.org/plugins/build-user-vars-plugin/1.5/

'나는 노동자 > Jenkins' 카테고리의 다른 글

Jenkins pipeline git push id password  (0) 2020.01.07
jenkins cleanWs()  (0) 2020.01.06
git clone username password  (0) 2019.12.18
gitlab 암호 잊어버렸을때  (0) 2019.11.13
Jenkins security login  (0) 2019.11.08

No such DSL method ‘cleanWs()’ found among steps [~
뭐 이런 에러가 빌드시 난다면

workspace cleanup plugin을 설치해야한다

updates.jenkins-ci.org/download/plugins/

에서 ws-cleanup을 다운로드 해서 넣어주거나

jenkins에서 플러그인 설치를 하면 된다

'나는 노동자 > Jenkins' 카테고리의 다른 글

Jenkins pipeline git push id password  (0) 2020.01.07
wrap[$class: ‘BuildUser’]) error  (0) 2020.01.07
git clone username password  (0) 2019.12.18
gitlab 암호 잊어버렸을때  (0) 2019.11.13
Jenkins security login  (0) 2019.11.08

컨테이너에 들어간다
cd /use/bin

ls git*
./gitlab-rails console -e production

user=User.where(id: 1).first
아니면
user=User.find_by(username: ‘root’)
@root가 보이면

user.password=‘newpassword를넣는다’
user.password_confirmation=‘newpassword’
user.save

'나는 노동자 > Jenkins' 카테고리의 다른 글

jenkins cleanWs()  (0) 2020.01.06
git clone username password  (0) 2019.12.18
Jenkins security login  (0) 2019.11.08
jenkins+ansible+mysql+php+nginx+shell scripting  (0) 2019.11.05
jenkins ansible output color  (0) 2019.11.05

초기에 사용자를 만들어고 사용자 접속 옵션을 넣으면
(Configure Global Security에서 사용자가입 허용_
만들어진 사용자로 로그인이 가능하며, 모든 권한을 갖는다
이에 사용자를 만들고 해당사용자에게 특정 role을 부여하는 절차이다.

Plugin: Role-based Autorization Strategy설치

jenkins 관리-> Configure Golbal Security-> Authoriaztion에서 Role-Based Strategy를 선택후 저장
로그아웃후 만들어진 사용자(위에서 가입허용으로 만든 사용자)로 로그인을 하면 Access Denied라고 나옴

jenkins관리 => Manage and Assign Roles -> Manage Role
Golbal roles에서 Role to add 에 read-only라고 적고 add한다. Overall [read]선택후 -> 저장

이제 사용자와 role을 연결해주자
jenkins관리 -> Manage and Assign Role -> Assign Roles
User/group to add [guest] 기존에 만든 사용자를 입력하고 add버튼을 누른다. 그리고 read-only role을 선택하고 저장

로그아웃후 재로그인시 guest로 로그인이 가능해졌다
Job은 보이지 않은

다시 관리자로 로그인후
jenkins관리 -> Manage and Assign Roles-> Manage Roles read-only role에서 Job [read] 를 선택하고 저장후 재로그인[guest] 하면 Job이 보인다,

'나는 노동자 > Jenkins' 카테고리의 다른 글

git clone username password  (0) 2019.12.18
gitlab 암호 잊어버렸을때  (0) 2019.11.13
jenkins+ansible+mysql+php+nginx+shell scripting  (0) 2019.11.05
jenkins ansible output color  (0) 2019.11.05
jenkins root 추가  (0) 2019.11.04

우선 docker로 mysql설치

docker run —name test-db -p 3306:3306 -e MYSQL_ROOT_PASSWORD=1234 -d mysql

컨테이너로 들어간후

mysql -uroot -p1234 mysql
create database people
use people
create table register(id int(3), name varchar(50),lastname varchar(50), aget int(3));

컨테이너를 나온다
이후 people.txt라는 파일을 만들고
내용은
Denice,Caule
Cherise,Olenick
~
~
이런식으로 50줄을 만든다

vi put.sh
#!/bin/bash

counter=0
while [ $counter -lt 50]; do
let counter=counter+1
name=$(nl people.txt |grep -w $counter| awk ‘{print $2}| awk -F ‘,’ ‘{print $1}’)

# nl은 파일 라인줄을 포함해서 출력해주고 grep -w 라인번호는 해당 라인번호 라인을 출력해준다, 첫번째 awk는 라인번호를 제외한 Denice,Caule이런식으로 출력을 해주며 두번째 awk는 -F를 기준으로 , 값으로 앞뒤를 구분해서 출력해준다 위의 name의 경우라면 앞의 값 Denice의 값을 가진다

lastname=$(nl people.txt|grep -w $counter| awk ‘{print $2}’|awk -F ‘,’ ‘{print $2}’)

age=$(shuf -i 20-25 -n 1)
# shuf는 램덤값을 출력하며 -i 는 범위를나타낸다 -n 은 출력라인을 몇개나 할것인지를 의미한다
20-25사이의 랜덤값을 하나씩 출력하라는 의미이다

mysql -uroot -p1234 people -e “insert into register values ($counter, ‘$name’,’$lastname’,$age)”

echo “$counter, $name $lastname, $age ws corrently imported”

done

docker cp put.sh test-db:/tmp and copy people.txt too
docker exec -it test-db bash

ls /tmp
./put.sh
db에 연결해서 테이블에 값이 정상적으로 들어갔는지 확인

nginx+php 설치

docker run -it -d —name nginx-test -p 8888:80 -v /home/nginx-test:/usr/share/nginx/html wyveo/nginx-php-fpm:latest

# php-fpm이 포함된 nginx이미지를 사용한다

vi info.php
<?php phpinfo(); ?>

웹주소:8888/info.php







'나는 노동자 > Jenkins' 카테고리의 다른 글

git clone username password  (0) 2019.12.18
gitlab 암호 잊어버렸을때  (0) 2019.11.13
Jenkins security login  (0) 2019.11.08
jenkins ansible output color  (0) 2019.11.05
jenkins root 추가  (0) 2019.11.04

jenkins에서 ansible build실행시
color 화면이 console ouput에 나오지 않을경우

jenkins plugin중 ansicolor가 설치되어 있지 않아서다

plugin에 추가해주자. 그 다음

빌드 환경으로 들어가서. Build Triggers를 선택후

하단애 빌드환경에. Coloe ANSI Console Output를 선택해준다

Build 를 선택한후 Advanced(고급)를 선택한다

하단부에. Colorized stdout을 선택한다

저장하고. 다시 빌드하면 된다

개별 다운로드는

https://updates.jenkins-ci.org/download

를 참조하면 된다

'나는 노동자 > Jenkins' 카테고리의 다른 글

git clone username password  (0) 2019.12.18
gitlab 암호 잊어버렸을때  (0) 2019.11.13
Jenkins security login  (0) 2019.11.08
jenkins+ansible+mysql+php+nginx+shell scripting  (0) 2019.11.05
jenkins root 추가  (0) 2019.11.04

기존에 배포된 deploy를 edit한후

pod template 하단 이미지 부분에

기존
securityContext:
fgGroup: 1000 이렇게 되어 있다면 아래를 추가한다
runAsUser: 0

저장후 deploy를 scale 0 으로 한후 다시 1로 변경한다

kubectl scale deploy/deployname -n namespace —replicas=0 이후

—replicas=1로 변경

'나는 노동자 > Jenkins' 카테고리의 다른 글

git clone username password  (0) 2019.12.18
gitlab 암호 잊어버렸을때  (0) 2019.11.13
Jenkins security login  (0) 2019.11.08
jenkins+ansible+mysql+php+nginx+shell scripting  (0) 2019.11.05
jenkins ansible output color  (0) 2019.11.05

+ Recent posts