Skip to content

Commit

Permalink
pipeline-promotion changes (#158)
Browse files Browse the repository at this point in the history
* Fixed S3 file copy defect

* Ensured that oes-config runs last

* Changes for pipeline promotion

* Added git sample

* Removeing temp file

* edit sample

* Give permissions to all for openshift

* more permissions

* bug fix

* Made changes as per Abhis comments

* Fixed issue related to git_pr_token being empty

* Bumped-up the chart number

Co-authored-by: ksrinimba <[email protected]>
  • Loading branch information
ksrinimba and ksrinimba authored Jul 1, 2021
1 parent d1b4f62 commit 53c92b9
Show file tree
Hide file tree
Showing 8 changed files with 610 additions and 530 deletions.
2 changes: 1 addition & 1 deletion charts/oes/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: oes
version: 3.8.4
version: 3.8.5
appVersion: 3.8.1
description: OES is a non-forked version of OSS spinnaker
icon: https://raw.githubusercontent.com/OpsMx/enterprise-spinnaker/master/img/opsmx.png
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ data:
if [ -f /tmp/spinnaker/.hal/default/profiles/fiat-local.yml ]; then
sed -i s/RELEASE_NAME/{{ .Release.Name }}/g /tmp/spinnaker/.hal/default/profiles/fiat-local.yml
fi
sed -i s/SPINNAKER_NAMESPACE/${SPINNAKER_NAMESPACE}/ /tmp/spinnaker/.hal/default/profiles/orca-local.yml
printf 'server.address: 0.0.0.0\n' > /tmp/config/halyard-local.yml
if [ -f /tmp/spinnaker/.hal/halyard.yaml ]; then
cp /tmp/spinnaker/.hal/halyard.yaml /tmp/config
Expand All @@ -87,6 +88,7 @@ data:
if [ -f /tmp/spinnaker/.hal/default/profiles/fiat-local.yml ]; then
sed -i s/RELEASE_NAME/{{ .Release.Name }}/g /tmp/spinnaker/.hal/default/profiles/fiat-local.yml
fi
sed -i s/SPINNAKER_NAMESPACE/${SPINNAKER_NAMESPACE}/ /tmp/spinnaker/.hal/default/profiles/orca-local.yml
# Copy S3 Specific files
cp /tmp/spinnaker/.hal/default/service-settings/clouddriver-caching.yml.s3 /tmp/spinnaker/.hal/default/service-settings/clouddriver-caching.yml
cp /tmp/spinnaker/.hal/default/service-settings/clouddriver-ro.yml.s3 /tmp/spinnaker/.hal/default/service-settings/clouddriver-ro.yml
Expand Down Expand Up @@ -114,3 +116,4 @@ data:
{{- if .Values.gitopsHalyard.mTLS.enabled }}
sed -i s/SPINNAKER_NAMESPACE/${SPINNAKER_NAMESPACE}/g /tmp/spinnaker/.hal/default/service-settings/*
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ apiVersion: v1
stringData:
# Git token to access repo where pipeline stuff is stored
git_secret_token: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.token }}
{{- if .Values.spinnaker.gitopsHalyard.pipelinePromotion.approverToken }}
git_pr_token: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.approverToken }}
{{- end }}
kind: Secret
metadata:
namespace: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.executionNamespace }}
name: git-token
type: Opaque
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ stringData:
kind: Secret
metadata:
name: local-spin-cli-config
namespace: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.executionNamespace }}
{{- end }}
48 changes: 35 additions & 13 deletions charts/oes/templates/pipeline-promotion/pipe-promot-config-cm.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
{{- if .Values.spinnaker.gitopsHalyard.pipelinePromotion.enabled }}
apiVersion: v1
data:
git_friendly_username: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.username }}
git_project: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.repository }}
git_refresh_enabled: "true"
git_repo: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.organization }}
git_user_email: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.usermail }}
ignore_spin_errors: "false"
debug: "false"
pipelineconfig: "false" # Enable pipeline configuration during promotion
pipelineconfigdir: "prod-config" # directory to look for under application when syncing to Spinnaker
pipelinecreateconf: "false" # Create default parameter-config files in "default-config", useful for 1st time param-creation
repo.properties: |
#properties file for pipeline promotion scripts
# Common Stuff
repo_type={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.type }}
repo_name={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.repository }}
root_folder={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.rootFolder }}
#S3 Specific
AWS_ACCESS_KEY_ID={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.AWS_SECRET_ACCESS_KEY }}
#git mandatory patameters
git_url={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.baseUrl }}
git_project={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.organization }}
git_user={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.username }}
git_branch={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.branch }}
#git_password={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.password }}
#API
git_api_url={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.apiUrl }} # bitbucket
#Auto PR requirements
merge_branch={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.createPR }}
auto_merge={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.autoApprovePR }}
git_approve_user={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.approvingUser }}
target_branch={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.targetBranch }}
#optional
#git_user_email={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.usermail }}
#delete pipeLine
delete_on_sync_spin={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.deleteOnSyncSpin }}
delete_on_sync_repo={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.deleteOnSyncRepo }}
#git_approve_user_password={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.approver_password }}
#git_secret_sshkey={{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.secret_sshkey }}
kind: ConfigMap
metadata:
creationTimestamp: null
name: pipe-promot-config
namespace: {{ .Values.spinnaker.gitopsHalyard.pipelinePromotion.executionNamespace }}
{{- end }}
Loading

0 comments on commit 53c92b9

Please sign in to comment.