Skip to content

Add mongo-seed-db k8 job. #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 7, 2017
Merged
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
123 changes: 123 additions & 0 deletions ansible/group_vars/alpha-mongo-seed-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: mongo-seed-db

container_image: quay.io/runnable/api

container_run_args: npm run migrate-up

container_envs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to just do this:

envs:
  - name: IS_QUEUE_WORKER
    value: "true"
  - name: ROLLBAR_KEY
    value: "{{ api_workers_rollbar_key | default('ansible_undefined') }}"

container_envs: "{{ api_base_container_envs + envs }}"

Not sure if that would work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not going to do, causes more issues.

- name: LOG_LEVEL
value: trace
- name: DOCKER_IMAGE_BUILDER_CACHE
value: "/home/anandkumarpatel/cache"
- name: VALID_REDIR_TLDS
value: "{{ domain }},runnablecloud.com"
- name: FULL_API_DOMAIN
value: "{{ api_url }}"
- name: FULL_FRONTEND_DOMAIN
value: "https://{{ domain }}"
- name: AWS_ACCESS_KEY_ID
value: "{{ api_aws_access_key_id }}"
- name: AWS_SECRET_ACCESS_KEY
value: "{{ api_aws_secret_access_key }}"
- name: BIG_POPPA_HOST
value: "http://{{ big_poppa_host_address }}:{{ big_poppa_port }}"
- name: CLIO_HTTP_URL
value: "http://{{ clio_host_address }}:{{ clio_port }}/"
- name: COOKIE_DOMAIN
value: "{{ domain }}"
- name: CREAM_HOST
value: "http://{{ cream_host_address }}:{{ cream_port }}"
- name: DATADOG_HOST
valueFrom: "spec.nodeName"
- name: DATADOG_PORT
value: "{{ datadog_port }}"
- name: DOCKER_BUILD_LINE_TIMEOUT_MS
value: "3600000"
- name: DOMAIN
value: "{{ domain }}"
- name: KEYMAKER_HTTP_URL
value: "http://{{ keymaker_host_address }}:{{ keymaker_port }}/"
- name: GITHUB_CALLBACK_URL
value: "{{ api_url }}/auth/github/callback"
- name: GITHUB_CLIENT_ID
value: "{{ api_github_client_id }}"
- name: GITHUB_CLIENT_SECRET
value: "{{ api_github_client_secret }}"
- name: GITHUB_DEPLOY_KEYS_BUCKET
value: "{{ api_github_deploy_keys_bucket }}"
- name: GITHUB_HOOK_URL
value: "{{ api_url }}/actions/github"
- name: GITHUB_UPGRADE_REDIRECT_URL
value: "https://app.{{ domain }}/githubAuthUpgrade/"
- name: GITHUB_WEBHOOK_URL
value: "https://{{ drake_hostname }}/github"
- name: GITHUB_VARNISH_HOST
value: "{{ github_varnish_host }}"
- name: GITHUB_VARNISH_PORT
value: "{{ github_varnish_port }}"
- name: GITHUB_PROTOCOL
value: "http"
- name: HELLO_RUNNABLE_GITHUB_ID
value: "{{ hello_runnable_github_id }}"
- name: HELLO_RUNNABLE_GITHUB_TOKEN
value: "{{ api_hello_runnable_github_token }}"
- name: KRAIN_PORT
value: "{{ krain_port }}"
- name: MIXPANEL_APP_ID
value: "{{ api_mixpanel_app_id | default('ansible_undefined') }}"
- name: MONGO_AUTH
value: "{{ api_mongo_auth }}"
- name: MONGO_DB
value: "{{ api_mongo_database }}"
- name: MONGO_HOSTS
value: "{{ mongo_hosts }}"
- name: MONGO_REPLSET_NAME
value: "{{ api_mongo_replset_name | default('ansible_undefined') }}"
- name: MONGO
value: "mongodb://{{ api_mongo_auth }}@{{ mongo_hosts }}/{{ api_mongo_database }}"
- name: NAVI_HOST
value: "http://{{ navi_host_address }}:{{ navi_http_port }}"
- name: NODE_ENV
value: "{{ node_env }}"
- name: NUM_WORKERS
value: "1"
- name: OPTIMUS_HOST
value: "http://{{ optimus_hostname }}"
- name: RABBITMQ_HOSTNAME
value: "{{ rabbit_host_address }}"
- name: RABBITMQ_PASSWORD
value: "{{ rabbit_password }}"
- name: RABBITMQ_PORT
value: "{{ rabbit_port }}"
- name: RABBITMQ_USERNAME
value: "{{ rabbit_username }}"
- name: REDIS_IPADDRESS
value: "{{ redis_host_address }}"
- name: REDIS_PORT
value: "{{ redis_port }}"
- name: S3_CONTEXT_RESOURCE_BUCKET
value: "{{ api_s3_context_bucket }}"
- name: S3_LOG_BUCKET
value: "{{ api_s3_log_bucket }}"
- name: SENDGRID_KEY
value: "{{ sendgrid_key }}"
- name: SWARM_HOST
value: "http://{{ swarm_host_address }}:{{ swarm_master_port }}"
- name: USER_CONTENT_DOMAIN
value: "{{ user_content_domain }}"
- name: AWS_ALIAS_HOST
value: "{{ api_aws_alias_host }}"
- name: NEW_RELIC_APP_NAME
value: "{{ api_new_relic_app_name | default('ansible_undefined') }}"
- name: NEW_RELIC_LICENSE_KEY
value: "{{ new_relic_license_key | default('ansible_undefined') }}"
- name: NEW_RELIC_LOG_LEVEL
value: "fatal"
- name: NEW_RELIC_NO_CONFIG_FILE
value: "true"
- name: INTERCOM_APP_ID
value: "{{ api_intercom_app_id | default('ansible_undefined') }}"
- name: INTERCOM_API_KEY
value: "{{ api_intercom_api_key | default('ansible_undefined') }}"
- name: USER_VAULT_ENDPOINT
value: "http://{{ user_vault_load_balancer }}:{{ user_vault_port }}"
6 changes: 6 additions & 0 deletions ansible/mongo-seed-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- hosts: api
vars_files:
- group_vars/alpha-mongo-seed-db.yml
roles:
- role: k8-job
1 change: 1 addition & 0 deletions ansible/single-host-part-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
- include: rabbitmq.yml
- include: redis.yml
- include: mongo-create-users.yml
- include: mongo-seed-db.yml
- include: rabbit-create-exchanges.yml