donal
2018-04-19 4eacb7222d8c5d715572b27f907bad08f01c21af
ADD - ocp pipeline stuff
2 files added
1 files modified
114 ■■■■■ changed files
.openshift-applier/inventory/group_vars/all.yml 4 ●●●● patch | view | raw | blame | history
.openshift-applier/params/ocp-pipeline 3 ●●●●● patch | view | raw | blame | history
.openshift-applier/templates/ocp-pipeline.yml 107 ●●●●● patch | view | raw | blame | history
.openshift-applier/inventory/group_vars/all.yml
@@ -3,8 +3,8 @@
- object: app-builds
  content:
  - name: todolist-fe-build
    template: "{{ playbook_dir }}/templates/todolist-fe-deploy.yml"
    params: "{{ playbook_dir }}/params/dev"
    template: "{{ playbook_dir }}/templates/todolist-fe-build.yml"
    params: "{{ playbook_dir }}/params/build"
    namespace: "{{ ci_cd_namespace }}"
    tags:
    - build
.openshift-applier/params/ocp-pipeline
New file
@@ -0,0 +1,3 @@
PIPELINE_SOURCE_REPOSITORY_URL=
PIPELINE_SOURCE_REPOSITORY_REF=develop
NAME=todolist-fe
.openshift-applier/templates/ocp-pipeline.yml
New file
@@ -0,0 +1,107 @@
---
kind: Template
apiVersion: v1
metadata:
  name: s2i-app-build
  annotations:
    openshift.io/display-name: S2I App Build Template
    description: S2I binary build config to create an image with your app baked in.
    iconClass: fa-cube
    tags: s2i
objects:
- apiVersion: v1
  kind: ImageStream
  metadata:
    labels:
      build: "${NAME}"
      app: "${NAME}"
    name: "${NAME}"
  spec: {}
- apiVersion: v1
  kind: BuildConfig
  metadata:
    labels:
      build: "${NAME}"
      name: "${NAME}-pipeline"
      type: pipeline
      app: "${NAME}"
    name: "${NAME}-pipeline"
  spec:
    nodeSelector: {}
    output: {}
    postCommit: {}
    resources: {}
    runPolicy: Serial
    source:
      contextDir: "${PIPELINE_CONTEXT_DIR}"
      git:
        ref: "${PIPELINE_SOURCE_REPOSITORY_REF}"
        uri: "${PIPELINE_SOURCE_REPOSITORY_URL}"
      type: Git
      sourceSecret:
        name: "${PIPELINE_SOURCE_SECRET}"
    strategy:
      jenkinsPipelineStrategy:
        jenkinsfilePath: Jenkinsfile
      type: JenkinsPipeline
    triggers:
    - type: ConfigChange
    - type: Bitbucket
      bitbucket:
        secret: "${BITBUCKET_WEBHOOK}"
    - type: Generic
      generic:
        secret: "${GENERIC_WEBHOOK}"
    - type: GitHub
      github:
        secret: "${GITHUB_WEBHOOK}"
    - type: GitLab
      gitlab:
        secret: "${GITLAB_WEBHOOK}"
parameters:
- name: NAME
  displayName: Name
  description: The name assigned to all objects and the resulting imagestream.
  required: true
  value: s2i-app
- name: PIPELINE_SOURCE_REPOSITORY_URL
  displayName: Git Repository URL
  description: The URL of the repository with your Jenkinsfile.
  required: true
  value: https://github.com/rht-labs/Jenkinsfiles
- name: PIPELINE_SOURCE_REPOSITORY_REF
  displayName: Git Reference
  description: Set this to a branch name, tag or other ref of your repository if you
    are not using the default (master) branch.
  value: master
- name: PIPELINE_CONTEXT_DIR
  displayName: Git Context Directory for Jenkinsfile
  description: Set this to the directory where the Jenkinsfile is if not using the
    default root directory
- name: BITBUCKET_WEBHOOK
  displayName: Bitbucket Webook
  description: OCP secret string to configure a Bitbucket webhook
  generate: expression
  from: "[a-zA-Z0-9]{20}"
- name: GENERIC_WEBHOOK
  displayName: Generic Webook
  description: OCP secret string to configure a Generic webhook
  generate: expression
  from: "[a-zA-Z0-9]{20}"
- name: GITHUB_WEBHOOK
  displayName: Github Webook
  description: OCP secret string to configure a Github webhook
  generate: expression
  from: "[a-zA-Z0-9]{20}"
- name: GITLAB_WEBHOOK
  displayName: Gitlab Webook
  description: OCP secret string to configure a Gitlab webhook
  generate: expression
  from: "[a-zA-Z0-9]{20}"
- name: PIPELINE_SOURCE_SECRET
  displayName: Secret for git repository
  description: The name of the OCP secret that has credentials for the pipeline git
    repository
  value: gitlab-auth
labels:
  template: s2i-app-build-template