Skip to content
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

Add Task to Deploy MongoDB Database for nodejs Sample App #29

Open
danielhelfand opened this issue Aug 15, 2019 · 2 comments
Open

Add Task to Deploy MongoDB Database for nodejs Sample App #29

danielhelfand opened this issue Aug 15, 2019 · 2 comments

Comments

@danielhelfand
Copy link
Contributor

The sample app used in this workshop uses a MongoDB database as a way to track the page views of the application.

This is an opportunity to add a task that would run in parallel to other tasks as part of the pipeline used in the workshop. The goal would be to have a new task for deploying a MongoDB database with the appropriate environment variables set as described here.

This database deploy step would run alongside the build task of the pipeline and also make the deployed sample app more interesting.

@danielhelfand
Copy link
Contributor Author

This step should be able to be run conditionally. Tekton does support conditional tasks. Not sure how this would work with tkn at this point, and there may need to be an option added to the CLI that would allow a pipelinerun to be triggered that specifies if a conditional task should be run.

@danielhelfand
Copy link
Contributor Author

danielhelfand commented Aug 28, 2019

This can be accomplished by doing the following:

  1. Add this task to the deploy-pipeline:
  - name: deploy-mongo
    taskRef:
      name: openshift-client
    params:
    - name: ARGS
      value: "new-app centos/mongodb-36-centos7 -e MONGODB_USER=admin MONGODB_DATABASE=mongo_db MONGODB_PASSWORD=secret MONGODB_ADMIN_PASSWORD=super-secret"

The above task would execute in parallel to the build task on the deploy-pipeline.

  1. Set the MONGO_URL environment variable to the ip of the deployed MongoDB database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant