sachgits / hello-openshift-jenkins-ci-cd

Example using Openshift with Jenkins and sync Openshift Secret

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cria configuração Secret

$ oc create secret generic certisign-git-ssh-secret \
    --from-literal=username=<user_name> \
    --from-literal=password=<password> \
    --type=kubernetes.io/basic-auth
    
# habilitar syncronismo com jenkins
$ oc label secret certisign-git-ssh-secret credential.sync.jenkins.openshift.io=true

$ oc label secret certisign-git-ssh-secret jenkins.openshift.io/secret.name=certisign-git-ssh-secret

Screen

image-20190503124255395

image-20190503124355774

Criar template Jenkins

oc process -f jenkins-sync-secret.yml -p APPLICATION_NAME=hello | oc create -f -

image-20190506103715132

image-20190506104007093

Iniciar o Build

# verificar o nome do build
$ oc get bc
NAME             TYPE              FROM      LATEST
hello-pipeline   JenkinsPipeline             0

# iniciar
$ oc start-build hello-pipeline
build.build.openshift.io/hello-pipeline-1 started

image-20190506104212619

# vejas os logs
$ oc logs -f bc/hello-pipeline
info: logs available at /https://jenkins-teste.apps.na311.openshift.opentlc.com/blue/organizations/jenkins/teste%2Fteste-hello-pipeline/detail/teste-hello-pipeline/1/

image-20190506104504358

Referência

About

Example using Openshift with Jenkins and sync Openshift Secret