Skip to content

Commit

Permalink
Merge pull request #7 from mysilio-co/staging
Browse files Browse the repository at this point in the history
Add SMTP config
  • Loading branch information
ianconsolata authored Oct 2, 2022
2 parents 10d6916 + b009811 commit e4e3262
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 13 deletions.
50 changes: 48 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,31 @@ jobs:
- run: npm run test:unit
- run: npm run test:ingregration
helmfile-apply:
parameters:
env:
type: string
docker:
- image: itme/helmfile:0.1
auth:
username: $DOCKER_USER
password: $DOCKER_PASSWORD
environment:
HELMFILE_ENVIRONMENT: << parameters.env >>
steps:
- checkout
- run: aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name $CLUSTER_NAME
- run: helmfile --file .deploy/helmfile.yaml apply
helmfile-diff:
parameters:
env:
type: string
docker:
- image: itme/helmfile:0.1
auth:
username: $DOCKER_USER
password: $DOCKER_PASSWORD
environment:
HELMFILE_ENVIRONMENT: << parameters.env >>
steps:
- checkout
- run: aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name $CLUSTER_NAME
Expand All @@ -48,8 +58,25 @@ workflows:
docker-password: DOCKER_PASSWORD
filters:
branches:
only: main
only:
- main
- staging
- helmfile-apply:
name: apply/staging
env: staging
context:
- kube-primary
- docker-org-itme
- docker-user-ian
- mysilio-me-smtp
filters:
branches:
only: staging
requires:
- docker/publish
- helmfile-apply:
name: apply/production
env: production
context:
- kube-primary
- docker-org-itme
Expand All @@ -58,14 +85,33 @@ workflows:
filters:
branches:
only: main
requires:
- docker/publish
diff:
jobs:
- helmfile-diff:
name: diff/staging
env: staging
context:
- kube-primary
- docker-org-itme
- docker-user-ian
- mysilio-me-smtp
filters:
branches:
ignore:
- main
- staging
- helmfile-diff:
name: diff/production
env: production
context:
- kube-primary
- docker-org-itme
- docker-user-ian
- mysilio-me-smtp
filters:
branches:
ignore: main
ignore:
- main
- staging
18 changes: 8 additions & 10 deletions .deploy/helmfile.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
repositories:
- name: css
url: https://communitysolidserver.github.io/css-helm-chart/charts/
url: https://communitysolidserver.github.io/css-helm-chart/

environments:
production:
staging:

releases:
- name: itme-image-pull-secrets
namespace: mysilio-me
chart: ./image-pull-secrets
values:
- ./values/image-pull-secrets.yaml.gotmpl
- name: production-css
namespace: mysilio-me
chart: css/community-solid-server
values:
- ./values/production.yaml.gotmpl
needs:
- mysilio-me/itme-image-pull-secrets
- name: staging-css
- name: {{ .Environment.Name }}-css
namespace: mysilio-me
chart: css/community-solid-server
version: 2.1.0
values:
- ./values/staging.yaml.gotmpl
- ./values/{{ .Environment.Name }}.yaml.gotmpl
needs:
- mysilio-me/itme-image-pull-secrets
6 changes: 6 additions & 0 deletions .deploy/values/production.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ image:
tag: {{ requiredEnv "CIRCLE_SHA1" }}
pullSecrets:
- itme-image-pull-secrets
customParameters:
- flag: --smtpUser
value: {{ requiredEnv "SMTP_USER" }}
- flag: --smtpPassword
value: {{ requiredEnv "SMTP_PASSWORD" }}
baseUrlOverride: https://mysilio.me
ingress:
enabled: true
className: nginx
Expand Down
6 changes: 6 additions & 0 deletions .deploy/values/staging.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ image:
tag: {{ requiredEnv "CIRCLE_SHA1" }}
pullSecrets:
- itme-image-pull-secrets
customParameters:
- flag: --smtpUser
value: {{ requiredEnv "SMTP_USER" }}
- flag: --smtpPassword
value: {{ requiredEnv "SMTP_PASSWORD" }}
baseUrlOverride: https://staging.mysilio.me
ingress:
enabled: true
annotations:
Expand Down
18 changes: 18 additions & 0 deletions config/app/variables/cli/cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,24 @@
"type": "number",
"describe": "Run the server in multithreaded mode using workers. (special values: -1: num_cores-1, 0: num_cores). Defaults to 1 (singlethreaded)"
}
},
{
"@type": "YargsParameter",
"name": "smtpUser",
"options": {
"requiresArg": true,
"type": "string",
"describe": "The User to use for SMTP"
}
},
{
"@type": "YargsParameter",
"name": "smtpPassword",
"options": {
"requiresArg": true,
"type": "string",
"describe": "The Password to use for SMTP"
}
}
],
"options": {
Expand Down
14 changes: 14 additions & 0 deletions config/app/variables/resolver/resolver.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@
"key": "workers",
"defaultValue": 1
}
},
{
"CombinedShorthandResolver:_resolvers_key": "urn:solid-server:default:variable:smtpUser",
"CombinedShorthandResolver:_resolvers_value": {
"@type": "KeyExtractor",
"key": "smtpUser"
}
},
{
"CombinedShorthandResolver:_resolvers_key": "urn:solid-server:default:variable:smtpPassword",
"CombinedShorthandResolver:_resolvers_value": {
"@type": "KeyExtractor",
"key": "smtpPassword"
}
}
]
}
Expand Down
15 changes: 15 additions & 0 deletions config/identity/email/mysilio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^5.0.0/components/context.jsonld",
"@graph": [
{
"comment": "A Mysilio specific SMTP config that uses values passed in via the cli",
"@id": "urn:solid-server:default:EmailSender",
"@type": "BaseEmailSender",
"args_senderName": "Mysilio Support <support@mysilio.com>",
"args_emailConfig_host": "email-smtp.us-west-2.amazonaws.com",
"args_emailConfig_port": 587,
"args_emailConfig_auth_user": { "@id": "urn:solid-server:default:variable:smtpUser" },
"args_emailConfig_auth_pass": { "@id": "urn:solid-server:default:variable:smtpPassword" }
}
]
}
2 changes: 1 addition & 1 deletion config/mysilio.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"css:config/http/server-factory/websockets.json",
"css:config/http/static/default.json",
"css:config/identity/access/public.json",
"css:config/identity/email/default.json",
"css:config/identity/email/mysilio.json",
"css:config/identity/handler/default.json",
"css:config/identity/ownership/token.json",
"css:config/identity/pod/static.json",
Expand Down
10 changes: 10 additions & 0 deletions config/util/variables/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@
"comment": "Run the server in multithreaded mode with the set amount of workers.",
"@id": "urn:solid-server:default:variable:workers",
"@type": "Variable"
},
{
"comment": "Supply an SMTP User",
"@id": "urn:solid-server:default:variable:smtpUser",
"@type": "Variable"
},
{
"comment": "Supply an SMTP Password",
"@id": "urn:solid-server:default:variable:smtpPassword",
"@type": "Variable"
}
]
}

0 comments on commit e4e3262

Please sign in to comment.