-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gl4di4torRr
authored and
Gl4di4torRr
committed
Oct 8, 2018
1 parent
739f5c2
commit c0d17fe
Showing
44 changed files
with
686 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...cluster-spring-boot/image-mirror-example/.applier/inventory-dev/group_vars/seed-hosts.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
openshift_cluster_content: | ||
- object: deployments | ||
content: | ||
- name: "deploy jenkins" | ||
template: "openshift//jenkins-ephemeral" | ||
params: "{{ inventory_dir }}/../params/jenkins" | ||
namespace: multicluster-spring-boot-dev | ||
- name: "create prod cluster credential" | ||
template: "{{ inventory_dir }}/../templates/cluster-secret.yml" | ||
params: "{{ inventory_dir }}/../params/prod-cluster-credentials" | ||
namespace: multicluster-spring-boot-dev | ||
- name: "create image mirror nonprod secret" | ||
template: "{{ inventory_dir }}/../templates/image-mirror-secret.yml" | ||
params: "{{ inventory_dir }}/../params/nonprod-credentials" | ||
namespace: multicluster-spring-boot-dev | ||
- name: "create image mirror prod secret" | ||
template: "{{ inventory_dir }}/../templates/image-mirror-secret.yml" | ||
params: "{{ inventory_dir }}/../params/prod-credentials" | ||
namespace: multicluster-spring-boot-dev | ||
- name: "deploy dev environment" | ||
template: "{{ inventory_dir }}/../templates/deployment.yml" | ||
params: "{{ inventory_dir }}/../params/deployment-dev" | ||
- name: "deply stage environment" | ||
template: "{{ inventory_dir }}/../templates/deployment.yml" | ||
params: "{{ inventory_dir }}/../params/deployment-stage" | ||
- object: builds | ||
content: | ||
- name: "deploy build pipeline to dev" | ||
template: "{{ inventory_dir }}/../templates/build.yml" | ||
params: "{{ inventory_dir }}/../params/build-dev" |
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
...ter-spring-boot/image-mirror-example/.applier/inventory-pre-dev/group_vars/seed-hosts.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
openshift_cluster_content: | ||
- object: projects | ||
content: | ||
- name: "create environments" | ||
file: "{{ inventory_dir }}/../projects/projects.yml" | ||
file_action: create | ||
- object: deployments | ||
content: | ||
- name: "create image mirror service account" | ||
template: "{{ inventory_dir }}/../templates/image-mirror-sa.yml" | ||
params: "{{ inventory_dir }}/../params/registry-sa-nonprod-cluster" |
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
...luster-spring-boot/image-mirror-example/.applier/inventory-prod/group_vars/seed-hosts.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
openshift_cluster_content: | ||
- object: projects | ||
content: | ||
- name: "create environments" | ||
file: "{{ inventory_dir }}/../projects/projects-prod.yml" | ||
file_action: create | ||
- name: "create prod cluster credential" | ||
template: "{{ inventory_dir }}/../templates/image-mirror-sa.yml" | ||
params: "{{ inventory_dir }}/../params/registry-sa-prod-cluster" | ||
namespace: multicluster-spring-boot-prod | ||
- object: deployments | ||
content: | ||
- name: "deply prod environment" | ||
template: "{{ inventory_dir }}/../templates/deployment.yml" | ||
params: "{{ inventory_dir }}/../params/deployment-prod" |
2 changes: 2 additions & 0 deletions
2
multi-cluster-spring-boot/image-mirror-example/.applier/inventory-prod/hosts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[seed-hosts] | ||
localhost ansible_connection=local |
9 changes: 9 additions & 0 deletions
9
multi-cluster-spring-boot/image-mirror-example/.applier/params/build-dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
APPLICATION_NAME=spring-rest | ||
NAMESPACE=multicluster-spring-boot-dev | ||
PIPELINE_REPOSITORY_URL=https://github.com/Gl4di4torRr/container-pipelines.git | ||
PIPELINE_REPOSITORY_REF=multi-cluster-image-mirror | ||
PIPELINE_REPOSITORY_CONTEXT_DIR=multi-cluster-spring-boot/image-mirror-example | ||
SRC_API_URL=<SRC_API_URL> | ||
DEST_API_URL=<DEST_API_URL> | ||
SRC_REGISTRY=<SRC_REGISTRY> | ||
DEST_REGISTRY=<DEST_REGISTRY> |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
multi-cluster-spring-boot/image-mirror-example/.applier/params/deployment-prod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
APPLICATION_NAME=spring-rest | ||
NAMESPACE=multicluster-spring-boot-prod | ||
SA_NAMESPACE=multicluster-spring-boot-stage | ||
READINESS_RESPONSE=status.:.UP | ||
READINESS_PATH=/health |
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
multi-cluster-spring-boot/image-mirror-example/.applier/params/nonprod-credentials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
TOKEN=<TOKEN> | ||
SECRET_NAME=nonprod-credentials |
4 changes: 4 additions & 0 deletions
4
multi-cluster-spring-boot/image-mirror-example/.applier/params/prod-cluster-credentials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
TOKEN=<TOKEN> | ||
API_URL=<API-URL> | ||
REGISTRY_URL=<REGISTRY-URL> | ||
SECRET_NAME=prod-cluster-credentials |
2 changes: 2 additions & 0 deletions
2
multi-cluster-spring-boot/image-mirror-example/.applier/params/prod-credentials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
TOKEN=<TOKEN> | ||
SECRET_NAME=prod-credentials |
2 changes: 2 additions & 0 deletions
2
multi-cluster-spring-boot/image-mirror-example/.applier/params/registry-sa-nonprod-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
NAMESPACE=multicluster-spring-boot-stage | ||
SA_NAME=docker-registry-dev |
2 changes: 2 additions & 0 deletions
2
multi-cluster-spring-boot/image-mirror-example/.applier/params/registry-sa-prod-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
NAMESPACE=multicluster-spring-boot-prod | ||
SA_NAME=docker-registry-prod |
File renamed without changes.
File renamed without changes.
142 changes: 142 additions & 0 deletions
142
multi-cluster-spring-boot/image-mirror-example/.applier/templates/build.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
apiVersion: v1 | ||
kind: Template | ||
labels: | ||
template: generic-java-jenkins-pipeline | ||
metadata: | ||
annotations: | ||
description: Application template for JWS applications built using a Jenkins Pipeline | ||
iconClass: icon-tomcat | ||
tags: tomcat,tomcat8,java,jboss,xpaas,jenkins-ci | ||
version: 1.2.0 | ||
name: generic-java-jenkins-pipeline | ||
objects: | ||
- apiVersion: v1 | ||
kind: BuildConfig | ||
metadata: | ||
labels: | ||
application: ${APPLICATION_NAME} | ||
app: ${APPLICATION_NAME} | ||
build: ${APPLICATION_NAME} | ||
name: "${APPLICATION_NAME}" | ||
namespace: "${NAMESPACE}" | ||
spec: | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: "${APPLICATION_NAME}:latest" | ||
postCommit: {} | ||
resources: {} | ||
runPolicy: Serial | ||
source: | ||
binary: {} | ||
type: Binary | ||
strategy: | ||
sourceStrategy: | ||
from: | ||
kind: ImageStreamTag | ||
name: ${IMAGE_STREAM_TAG_NAME} | ||
namespace: ${IMAGE_STREAM_NAMESPACE} | ||
type: Source | ||
- kind: "BuildConfig" | ||
apiVersion: "v1" | ||
metadata: | ||
labels: | ||
application: ${APPLICATION_NAME} | ||
name: "${APPLICATION_NAME}-pipeline" | ||
namespace: "${NAMESPACE}" | ||
spec: | ||
source: | ||
type: Git | ||
git: | ||
uri: ${PIPELINE_REPOSITORY_URL} | ||
ref: ${PIPELINE_REPOSITORY_REF} | ||
contextDir: ${PIPELINE_REPOSITORY_CONTEXT_DIR} | ||
triggers: | ||
- type: "GitHub" | ||
github: | ||
secret: ${GITHUB_WEBHOOK_SECRET} | ||
- type: "ConfigChange" | ||
strategy: | ||
type: "JenkinsPipeline" | ||
jenkinsPipelineStrategy: | ||
jenkinsfilePath: ${PIPELINE_SCRIPT} | ||
env: | ||
- name: SOURCE_CODE_URL | ||
value: ${SOURCE_CODE_URL} | ||
- name: SOURCE_CODE_BRANCH | ||
value: ${SOURCE_CODE_BRANCH} | ||
- name: SKIP_TLS | ||
value: "true" | ||
- name: SRC_REGISTRY | ||
value: ${SRC_REGISTRY} | ||
- name: DEST_REGISTRY | ||
value: ${DEST_REGISTRY} | ||
- name: SRC_API_URL | ||
value: ${SRC_API_URL} | ||
- name: DEST_API_URL | ||
value: ${DEST_API_URL} | ||
parameters: | ||
- description: The name for the application. | ||
name: APPLICATION_NAME | ||
required: true | ||
value: basic-spring | ||
- description: The namespace to deploy into | ||
name: NAMESPACE | ||
required: true | ||
- description: Git source URI for application | ||
name: PIPELINE_REPOSITORY_URL | ||
required: true | ||
value: https://github.com/redhat-cop/container-pipelines.git | ||
- description: Git branch/tag reference | ||
name: PIPELINE_REPOSITORY_REF | ||
value: "master" | ||
- description: Path within Git project to build; empty for root project directory. | ||
name: PIPELINE_REPOSITORY_CONTEXT_DIR | ||
value: | ||
- description: Path within Git project pointing to the pipeline run script | ||
name: PIPELINE_SCRIPT | ||
value: Jenkinsfile | ||
- description: Git source URI for application | ||
name: SOURCE_CODE_URL | ||
required: true | ||
value: https://github.com/redhat-cop/spring-rest.git | ||
- description: Git branch/tag reference | ||
name: SOURCE_CODE_REF | ||
value: "master" | ||
- description: GitHub trigger secret | ||
from: '[a-zA-Z0-9]{8}' | ||
generate: expression | ||
name: GITHUB_WEBHOOK_SECRET | ||
required: true | ||
- description: Generic build trigger secret | ||
from: '[a-zA-Z0-9]{8}' | ||
generate: expression | ||
name: GENERIC_WEBHOOK_SECRET | ||
required: true | ||
- description: Namespace in which the ImageStreams for Red Hat Middleware images are | ||
installed. These ImageStreams are normally installed in the openshift namespace. | ||
You should only need to modify this if you've installed the ImageStreams in a | ||
different namespace/project. | ||
name: IMAGE_STREAM_NAMESPACE | ||
required: true | ||
value: openshift | ||
- description: Image stream tag for the image you'd like to use to build the application | ||
name: IMAGE_STREAM_TAG_NAME | ||
required: true | ||
value: redhat-openjdk18-openshift:1.1 | ||
- description: The source docker registry used for image mirror | ||
name: SRC_REGISTRY | ||
required: true | ||
- description: The destination docker registry used for image mirror | ||
name: DEST_REGISTRY | ||
required: true | ||
- description: Set source code branch | ||
name: SOURCE_CODE_BRANCH | ||
required: true | ||
value: master | ||
- description: The source docker registry used for the docker registry url | ||
name: SRC_API_URL | ||
required: true | ||
- description: The destination docker registry used for the docker registry url | ||
name: DEST_API_URL | ||
required: true |
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
multi-cluster-spring-boot/image-mirror-example/.applier/templates/image-mirror-sa.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: v1 | ||
kind: Template | ||
metadata: | ||
annotations: | ||
description: template for image mirror service account | ||
objects: | ||
- apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: ${SA_NAME} | ||
namespace: ${NAMESPACE} | ||
- apiVersion: v1 | ||
groupNames: null | ||
kind: RoleBinding | ||
metadata: | ||
creationTimestamp: null | ||
name: edit | ||
namespace: ${NAMESPACE} | ||
roleRef: | ||
name: edit | ||
subjects: | ||
- kind: ServiceAccount | ||
name: ${SA_NAME} | ||
namespace: ${NAMESPACE} | ||
userNames: | ||
- system:serviceaccount:${NAMESPACE}:${SA_NAME} | ||
parameters: | ||
- description: The namespace to deploy into | ||
name: NAMESPACE | ||
required: true | ||
- description: The service account name | ||
name: SA_NAME | ||
required: true |
29 changes: 29 additions & 0 deletions
29
multi-cluster-spring-boot/image-mirror-example/.applier/templates/image-mirror-secret.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: v1 | ||
kind: Template | ||
labels: | ||
template: image-mirror-secret | ||
metadata: | ||
annotations: | ||
description: Cluster Credential Secret | ||
tags: secret | ||
version: 1.0.0 | ||
name: image-mirror-secret | ||
objects: | ||
- apiVersion: v1 | ||
stringData: | ||
username: generic | ||
password: "${TOKEN}" | ||
data: | ||
kind: Secret | ||
metadata: | ||
name: ${SECRET_NAME} | ||
labels: | ||
credential.sync.jenkins.openshift.io: 'true' | ||
type: kubernetes.io/basic-auth | ||
parameters: | ||
- description: The name for the application. | ||
name: SECRET_NAME | ||
required: true | ||
- description: Service Account Token | ||
name: TOKEN | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
galaxy/ |
Oops, something went wrong.