module.exports = { tags: async (tln) => [], dotenvs: async (tln) => [], env: async (tln, env) => {}, options: async (tln) => [], inherits: async (tln) => [], depends: async (tln) => [], steps: async (tln) => [ { id: 'docker-build', filter: 'linux', builder: async (tln, script) => script.set([ 'docker build -t ${COMPONENT_ID}:${COMPONENT_VERSION} .' ]) }, { id: 'docker-run', filter: 'linux', builder: async (tln, script) => script.set([ 'docker run -d --rm \\', ' -p ${COMPONENT_PARAM_PORT}:${COMPONENT_PARAM_PORT} \\', ' -e MONGO_INITDB_ROOT_USERNAME=${COMPONENT_PARAM_DB_ROOT_USER} \\', ' -e MONGO_INITDB_ROOT_PASSWORD=${COMPONENT_PARAM_DB_ROOT_PASS} \\', ' -v ${COMPONENT_PARAM_DB_VOLUME}:/data/db \\', ' -e MONGO_INITDB_DATABASE=${COMPONENT_PARAM_DB_NAME} \\', ' --name ${COMPONENT_ID} ${COMPONENT_ID}:${COMPONENT_VERSION}' ]) }, { id: 'mongo-run-cli', filter: 'linux', builder: async (tln, script) => script.set([ 'docker exec -it ${COMPONENT_ID} mongo -u ${COMPONENT_PARAM_DB_ROOT_USER} -p ${COMPONENT_PARAM_DB_ROOT_PASS}' ]) }, { id: 'mongo-migration-status', filter: 'linux', builder: async (tln, script) => script.set([ 'migrate-mongo status' ]) }, { id: 'mongo-migration-up', filter: 'linux', builder: async (tln, script) => script.set([ 'migrate-mongo up' ]) }, { id: 'mongo-migration-down', filter: 'linux', builder: async (tln, script) => script.set([ 'migrate-mongo down' ]) } ], components: async (tln) => [] } /* db.createUser({ user: "admin", pwd: passwordPrompt(), roles: [ { role: "clusterAdmin", db: "admin" }, { role: "readAnyDatabase", db: "admin" }, { role: "userAdminAnyDatabase", db: "admin" }]}, { w: "majority" , wtimeout: 5000 }) mongo -u admin -p --authenticationDatabase admin use scraper db.createUser({ user: "scraper", pwd: passwordPrompt(), roles: [ { role: "readWrite", db: "scraper" } ] }) */