Skip to content

Commit

Permalink
Merge pull request #5 from SmartColumbusOS/open_source
Browse files Browse the repository at this point in the history
Extract chart
  • Loading branch information
Austin authored Sep 27, 2019
2 parents 1cf56cf + 4d77891 commit e66a290
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 34 deletions.
33 changes: 14 additions & 19 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,45 @@
library(
identifier: 'pipeline-lib@4.3.6',
identifier: 'pipeline-lib@4.6.1',
retriever: modernSCM([$class: 'GitSCMSource',
remote: 'https://github.com/SmartColumbusOS/pipeline-lib',
credentialsId: 'jenkins-github-user'])
)

properties([
pipelineTriggers([scos.dailyBuildTrigger()]),
parameters([
booleanParam(defaultValue: false, description: 'Deploy to development environment?', name: 'DEV_DEPLOYMENT')
])
])

def image
def doStageIf = scos.&doStageIf
def doStageIfDeployingToDev = doStageIf.curry(env.DEV_DEPLOYMENT == "true")
def doStageIfMergedToMaster = doStageIf.curry(scos.changeset.isMaster && env.DEV_DEPLOYMENT == "false")
def doStageIfRelease = doStageIf.curry(scos.changeset.isRelease)
def doStageUnlessRelease = doStageIf.curry(!scos.changeset.isRelease)
def doStageIfPromoted = doStageIf.curry(scos.changeset.isMaster)

node ('infrastructure') {
ansiColor('xterm') {
scos.doCheckoutStage()

doStageUnlessRelease('Deploy to Dev') {
deployProxiesTo(environment: 'dev')
doStageIfDeployingToDev('Deploy to Dev') {
deployTo(environment: 'dev')
}

doStageIfPromoted('Deploy to Staging') {
doStageIfMergedToMaster('Deploy to Staging') {
def environment = 'staging'

deployProxiesTo(environment: environment)

deployTo(environment: environment)
scos.applyAndPushGitHubTag(environment)

}

doStageIfRelease('Deploy to Production') {
def releaseTag = env.BRANCH_NAME
def promotionTag = 'prod'

deployProxiesTo(environment: 'prod', internal: false)

scos.applyAndPushGitHubTag(promotionTag)

def environment = 'prod'
deployTo(environment: environment)
scos.applyAndPushGitHubTag(environment)
}
}
}

def deployProxiesTo(params = [:]) {
def deployTo(params = [:]) {
def environment = params.get('environment')
if (environment == null) throw new IllegalArgumentException("environment must be specified")

Expand Down
5 changes: 0 additions & 5 deletions chart/Chart.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions chart/templates/ldap.yml

This file was deleted.

Binary file removed kylo.ldap
Binary file not shown.
11 changes: 8 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ data "terraform_remote_state" "env_remote_state" {
}
}


resource "local_file" "kubeconfig" {
filename = "${path.module}/outputs/kubeconfig"
content = "${data.terraform_remote_state.env_remote_state.eks_cluster_kubeconfig}"
content = "${data.terraform_remote_state.env_remote_state.eks_cluster_kubeconfig}"
}

resource "local_file" "helm_vars" {
filename = "${path.module}/outputs/${terraform.workspace}.yaml"

content = <<EOF
alm:
dns_zone: "${var.alm_dns_zone}"
services:
- hostname: "iam-master.${var.alm_dns_zone}"
name: ldap
EOF
}

Expand All @@ -41,7 +44,9 @@ set -x
export KUBECONFIG=${local_file.kubeconfig.filename}
export AWS_DEFAULT_REGION=us-east-2
helm upgrade --install external-services chart --namespace=external-services \
helm repo add scdp https://smartcitiesdata.github.io/charts
helm repo update
helm upgrade --install external-services scdp/external-services --namespace=external-services \
--values ${local_file.helm_vars.filename}
EOF
}
Expand Down

0 comments on commit e66a290

Please sign in to comment.