2.0.4 • Published 1 year ago
@shippify/bulk-manager v2.0.4
What this project is and does
This project allows to start the execution of a Bulk Step Function Machine and it create a firebase document to track the progress.
What you need to work with and run it
- Yo need to invoke the function invokeBulkEngineStepMachine using async/await. It returns the job id of the execution
const { invokeBulkEngineStepMachine } = require('@shippify/bulk-manager/src/index');
(async () => {
const jobId = await invokeBulkEngineStepMachine(data).catch((err) => {
console.log('err ', err);
return res.status(500).json({message:err.message});
});
return res.status(200).json({ message: 'Job created', jobId });
})();
- Yo need to invoke the function invokeBulkEngineStepMachine using async/await. It returns the job id of the execution
const { cancelBulkEngineStepMachine } = require('@shippify/bulk-manager/src/index');
const cancel = async (jobId) => {
try {
const jobId = await cancelBulkEngineStepMachine(jobId);
console.log('jobId: ', jobId);
process.exit(0);
} catch (error) {
throw error;
}
};
cancel('BSDEV_change_network_71');
- You need some environment variables to work with this library
- For dev environment you can use the following variables
- SERVER_ENV=staging
- BULK_ENGINE_S3_BUCKET=bulk-engine-dev
- STEP_FUNCTION_BULK_ENGINE=arn:aws:states:sa-east-1:103430952571:stateMachine:BulkEngineLooperDev
- FIREBASE_PROJECT_ID
- FIREBASE_API_KEY
- FIREBASE_AUTH_DOMAIN
- SHIPPIFY_AMAZON_ACCESS_KEY_ID
- SHIPPIFY_AMAZON_SECRET_ACCESS_KEY
- For dev environment you can use the following variables
How to contribute to this project
- You need to write new code inside /src following airbnb best practices.
- Every change need to be put it down in the changelog
How to run it locally
- install the library and invoke the function invokeBulkEngineStepMachine
How to deploy it
- After you make a change in the code, update the version of the package in the package.json file
- Create a pull request to invoke the npm library deployment automatically