diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f5184d1..643c7a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,14 +6,14 @@ include: stages: - build - - deploy_production + - deploy_sandbox build_image: extends: .build_image -deploy_production: +deploy_sandbox_us: before_script: - export - sh bin/generate_chart.sh - extends: .deploy_production + extends: .deploy_sandbox_us when: on_success diff --git a/bin/generate_chart.sh b/bin/generate_chart.sh index a958c00..f8d6777 100644 --- a/bin/generate_chart.sh +++ b/bin/generate_chart.sh @@ -10,35 +10,35 @@ printf " version: $CHART_VERSION\n" >> .gitops/helm/oauth-reference-integration printf " repository: $CHART_REPOSITORY\n" >> .gitops/helm/oauth-reference-integration/Chart.yaml printf " alias: $CHART_ALIAS\n" >> .gitops/helm/oauth-reference-integration/Chart.yaml -printf "microservice:\n" > .gitops/helm/oauth-reference-integration/production.yaml -printf " environment: production\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " nameOverride: oauth-reference-integration\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " podDefaults:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " env:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " production:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " NODE_ENV: production\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " CHECKR_API_URL: ${CHECKR_API_URL}\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " CHECKR_OAUTH_CLIENT_SECRET: ${CHECKR_OAUTH_CLIENT_SECRET}\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " ENCRYPTION_SECRET_KEY: ${ENCRYPTION_SECRET_KEY}\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " REACT_APP_CHECKR_OAUTH_CLIENT_ID: ${REACT_APP_CHECKR_OAUTH_CLIENT_ID}\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " REACT_APP_CHECKR_PARTNER_URL: ${REACT_APP_CHECKR_PARTNER_URL}\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " S3_ACCESS_KEY_SECRET: ${S3_ACCESS_KEY_SECRET}\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " S3_BUCKET: ${S3_BUCKET}\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " deployments:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " web:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " command: ['node', 'server.js']\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " replicaCount: $REPLICA_COUNT\n\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " ingresses:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " web:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " type: $INGRESS_TYPE\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " hosts:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " - host: $INGRESS_HOSTS\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " serviceName: web\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " servicePort: 80\n\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " services:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " web:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " ports:\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " - port: 80\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " targetPort: 8000\n" >> .gitops/helm/oauth-reference-integration/production.yaml -printf " selector: web\n" >> .gitops/helm/oauth-reference-integration/production.yaml +printf "microservice:\n" > .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " environment: sandbox\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " nameOverride: oauth-reference-integration\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " podDefaults:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " env:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " sandbox:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " NODE_ENV: production\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " CHECKR_API_URL: ${CHECKR_API_URL}\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " CHECKR_OAUTH_CLIENT_SECRET: ${CHECKR_OAUTH_CLIENT_SECRET}\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " ENCRYPTION_SECRET_KEY: ${ENCRYPTION_SECRET_KEY}\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " REACT_APP_CHECKR_OAUTH_CLIENT_ID: ${REACT_APP_CHECKR_OAUTH_CLIENT_ID}\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " REACT_APP_CHECKR_PARTNER_URL: ${REACT_APP_CHECKR_PARTNER_URL}\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " S3_ACCESS_KEY_SECRET: ${S3_ACCESS_KEY_SECRET}\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " S3_BUCKET: ${S3_BUCKET}\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " deployments:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " web:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " command: ['node', 'server.js']\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " replicaCount: $REPLICA_COUNT\n\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " ingresses:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " web:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " type: $INGRESS_TYPE\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " hosts:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " - host: $INGRESS_HOSTS\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " serviceName: web\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " servicePort: 80\n\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " services:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " web:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " ports:\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " - port: 80\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " targetPort: 8000\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml +printf " selector: web\n" >> .gitops/helm/oauth-reference-integration/sandbox_us.yaml