Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .helm/templates/ecr-image-pull-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ spec:
- secretRef:
name: {{ .Chart.Name }}-ecr-login-renew-secrets
---
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ .Chart.Name }}-ecr-login-renew-cron-job
Expand Down
18 changes: 9 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pipeline {
withDockerRegistry(url: "https://${env.WERF_REPO}", credentialsId: "ecr:us-east-2:aws-nrel-tada-ci") {
withCredentials([aws(credentialsId: "aws-nrel-tada-ci")]) {
withKubeConfig([credentialsId: "kubeconfig-nrel-reopt-test"]) {
tadaWithWerfNamespaces(rancherProject: "reopt-api-dev", primaryBranch: "master", dbBaseName: "reopt_api_development", baseDomain: "${DEVELOPMENT_BASE_DOMAIN}") {
tadaWithWerfNamespaces(rancherProject: "reopt-api-dev", primaryBranch: "ponderosa", dbBaseName: "reopt_api_development", baseDomain: "${DEVELOPMENT_BASE_DOMAIN}") {
withCredentials([string(credentialsId: "reopt-api-werf-secret-key", variable: "WERF_SECRET_KEY")]) {
sh """
werf converge \
Expand All @@ -122,7 +122,7 @@ pipeline {
--set='ecrAwsSecretAccessKey=${AWS_SECRET_ACCESS_KEY}' \
--set='branchName=${BRANCH_NAME}' \
--set='ingressHost=${DEPLOY_BRANCH_DOMAIN}' \
--set='tempIngressHost=${tadaDeployBranchDomain(baseDomain: env.DEVELOPMENT_TEMP_BASE_DOMAIN, primaryBranch: "master")}' \
--set='tempIngressHost=${tadaDeployBranchDomain(baseDomain: env.DEVELOPMENT_TEMP_BASE_DOMAIN, primaryBranch: "ponderosa")}' \
--set='dbName=${DEPLOY_BRANCH_DB_NAME}'
"""
}
Expand All @@ -134,7 +134,7 @@ pipeline {
}

stage("deploy-staging") {
when { expression { params.STAGING_DEPLOY || env.BRANCH_NAME == "master" } }
when { expression { params.STAGING_DEPLOY || env.BRANCH_NAME == "ponderosa" } }

environment {
DEPLOY_ENV = "staging"
Expand All @@ -145,8 +145,8 @@ pipeline {
steps {
withDockerRegistry(url: "https://${env.WERF_REPO}", credentialsId: "ecr:us-east-2:aws-nrel-tada-ci") {
withCredentials([aws(credentialsId: "aws-nrel-tada-ci")]) {
withKubeConfig([credentialsId: "kubeconfig-nrel-reopt-prod2"]) {
tadaWithWerfNamespaces(rancherProject: "reopt-api-staging", primaryBranch: "master", dbBaseName: "reopt_api_staging", baseDomain: "${STAGING_BASE_DOMAIN}") {
withKubeConfig([credentialsId: "kubeconfig-nrel-reopt-prod3"]) {
tadaWithWerfNamespaces(rancherProject: "reopt-api-staging", primaryBranch: "ponderosa", dbBaseName: "reopt_api_staging", baseDomain: "${STAGING_BASE_DOMAIN}") {
withCredentials([string(credentialsId: "reopt-api-werf-secret-key", variable: "WERF_SECRET_KEY")]) {
sh """
werf converge \
Expand All @@ -157,7 +157,7 @@ pipeline {
--set='ecrAwsSecretAccessKey=${AWS_SECRET_ACCESS_KEY}' \
--set='branchName=${BRANCH_NAME}' \
--set='ingressHost=${DEPLOY_BRANCH_DOMAIN}' \
--set='tempIngressHost=${tadaDeployBranchDomain(baseDomain: env.STAGING_TEMP_BASE_DOMAIN, primaryBranch: "master")}' \
--set='tempIngressHost=${tadaDeployBranchDomain(baseDomain: env.STAGING_TEMP_BASE_DOMAIN, primaryBranch: "ponderosa")}' \
--set='dbName=${DEPLOY_BRANCH_DB_NAME}'
"""
}
Expand All @@ -169,7 +169,7 @@ pipeline {
}

stage("deploy-production") {
when { branch "master" }
when { branch "ponderosa" }

environment {
DEPLOY_ENV = "production"
Expand All @@ -180,8 +180,8 @@ pipeline {
steps {
withDockerRegistry(url: "https://${env.WERF_REPO}", credentialsId: "ecr:us-east-2:aws-nrel-tada-ci") {
withCredentials([aws(credentialsId: "aws-nrel-tada-ci")]) {
withKubeConfig([credentialsId: "kubeconfig-nrel-reopt-prod2"]) {
tadaWithWerfNamespaces(rancherProject: "reopt-api-production", primaryBranch: "master") {
withKubeConfig([credentialsId: "kubeconfig-nrel-reopt-prod4"]) {
tadaWithWerfNamespaces(rancherProject: "reopt-api-production", primaryBranch: "ponderosa") {
withCredentials([string(credentialsId: "reopt-api-werf-secret-key", variable: "WERF_SECRET_KEY")]) {
sh """
werf converge \
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ properties([
$class: "GitParameterDefinition",
name: "PARAM_BRANCH",
type: "PT_BRANCH",
defaultValue: "origin/master",
defaultValue: "origin/ponderosa",
sortMode: "ASCENDING_SMART",
selectedValue: "DEFAULT",
quickFilterEnabled: true,
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile-image-cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pipeline {
steps {
withDockerRegistry(url: "https://${env.WERF_REPO}", credentialsId: "ecr:us-east-2:aws-nrel-tada-ci") {
withCredentials([aws(credentialsId: "aws-nrel-tada-ci")]) {
tadaRancherAllProjectNamespacesKubeConfig(projects: [[credentialsId: "kubeconfig-nrel-reopt-test", rancherProject: "reopt-api-dev"], [credentialsId: "kubeconfig-nrel-reopt-prod2", rancherProject: "reopt-api-staging"], [credentialsId: "kubeconfig-nrel-reopt-prod2", rancherProject: "reopt-api-production"]]) {
tadaRancherAllProjectNamespacesKubeConfig(projects: [[credentialsId: "kubeconfig-nrel-reopt-test", rancherProject: "reopt-api-dev"], [credentialsId: "kubeconfig-nrel-reopt-prod3", rancherProject: "reopt-api-staging"], [credentialsId: "kubeconfig-nrel-reopt-prod4", rancherProject: "reopt-api-production"]]) {
withCredentials([gitUsernamePassword(credentialsId: "github-nrel-gov-admin")]) {
sh "werf cleanup --scan-context-namespace-only"
}
Expand Down
6 changes: 3 additions & 3 deletions Jenkinsfile-undeploy-staging
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pipeline {
buildDiscarder(logRotator(daysToKeepStr: "30"))
}
triggers {
cron(env.BRANCH_NAME == "master" ? "H * * * *" : "")
cron(env.BRANCH_NAME == "ponderosa" ? "H * * * *" : "")
}

environment {
Expand Down Expand Up @@ -55,8 +55,8 @@ pipeline {
stages {
stage("undeploy-branches") {
steps {
withKubeConfig([credentialsId: "kubeconfig-nrel-reopt-prod2"]) {
tadaUndeployEachBranch(rancherProject: env.RANCHER_PROJECT, undeployDeletedBranches: params.UNDEPLOY_DELETED_BRANCHES, undeployMergedBranches: params.UNDEPLOY_MERGED_BRANCHES, undeployBranchNames: params.UNDEPLOY_BRANCH_NAMES, primaryBranch: "master") {
withKubeConfig([credentialsId: "kubeconfig-nrel-reopt-prod3"]) {
tadaUndeployEachBranch(rancherProject: env.RANCHER_PROJECT, undeployDeletedBranches: params.UNDEPLOY_DELETED_BRANCHES, undeployMergedBranches: params.UNDEPLOY_MERGED_BRANCHES, undeployBranchNames: params.UNDEPLOY_BRANCH_NAMES, primaryBranch: "ponderosa") {
tadaWithWerfEnv(rancherProject: env.RANCHER_PROJECT, dbBaseName: env.DB_BASE_NAME) {
tadaUndeployBranch()
}
Expand Down