From 2bc72c2e8660426dee0c8367770fcf63522ad1b8 Mon Sep 17 00:00:00 2001 From: Richard Gregory Date: Dec 30 2020 10:32:42 +0000 Subject: Enable CI/CD for Fedora Docs Signed-off-by: Richard Gregory --- diff --git a/cicd/.applier/group_vars/seed-hosts.yml b/cicd/.applier/group_vars/seed-hosts.yml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/cicd/.applier/group_vars/seed-hosts.yml diff --git a/cicd/.openshift/projects/projects.yml b/cicd/.openshift/projects/projects.yml new file mode 100644 index 0000000..88775be --- /dev/null +++ b/cicd/.openshift/projects/projects.yml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: List +items: +- apiVersion: project.openshift.io/v1 + kind: ProjectRequest + metadata: + name: fedora-documentation-build + creationTimestamp: null + displayName: Fedora Documentation - Build +- apiVersion: project.openshift.io/v1 + kind: ProjectRequest + metadata: + name: fedora-documentation-stage + creationTimestamp: null + displayName: Fedora Documentation - Stage +- apiVersion: project.openshift.io/v1 + kind: ProjectRequest + metadata: + name: fedora-documentation-prod + labels: + environment: production + creationTimestamp: null + displayName: Fedora Documentation - Prod diff --git a/cicd/.openshift/templates/build.yml b/cicd/.openshift/templates/build.yml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/cicd/.openshift/templates/build.yml diff --git a/cicd/.openshift/templates/deployment.yml b/cicd/.openshift/templates/deployment.yml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/cicd/.openshift/templates/deployment.yml diff --git a/cicd/Jenkinsfile b/cicd/Jenkinsfile new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/cicd/Jenkinsfile diff --git a/cicd/README.md b/cicd/README.md new file mode 100644 index 0000000..bd0f186 --- /dev/null +++ b/cicd/README.md @@ -0,0 +1,35 @@ +# CI/CD for Fedora Docs +Instructions on enabling continuous integration and development for the Fedora documentation website. + +### 1. Create Lifecycle Stages +There are three stages for the application to be promoted through: + +* fedora-documentation-build +* fedora-documentation-stage +* fedora-documentation-prod + +Use the YAML that defines project requests to quickly create application +``` +$ oc create -f .openshift/projects/projects.yml +project.project.openshift.io/fedora-documentation-build created +project.project.openshift.io/fedora-documentation-stage created +project.project.openshift.io/fedora-documentation-prod created +``` + +### 2. Start up Jenkins master +``` +$ oc process openshift//jenkins-persistent | oc apply -f- -n fedora-documentation-build +route.route.openshift.io/jenkins created +persistentvolumeclaim/jenkins created +deploymentconfig.apps.openshift.io/jenkins created +serviceaccount/jenkins created +rolebinding.authorization.openshift.io/jenkins_edit created +service/jenkins-jnlp created +service/jenkins created +``` + +### Cleanup +`$ oc delete project fedora-documentation-build fedora-documentation-stage fedora-documetation-prod` + +### Reference +[Red Hat Communities of Practice](https://github.com/redhat-cop/container-pipelines/tree/master/basic-spring-boot) diff --git a/cicd/requirements.yml b/cicd/requirements.yml new file mode 100644 index 0000000..8bd2bf2 --- /dev/null +++ b/cicd/requirements.yml @@ -0,0 +1,8 @@ +# This is the Ansible Galaxy requirements file to pull in the correct roles +# to support the operation of CASL provisioning/runs. + +# From 'openshift-applier' +- name: openshift-applier + scm: git + src: https://github.com/redhat-cop/openshift-applier + version: v2.1.1