def main()

in job-worker/npm_job_worker.py [0:0]


def main():
    while True:
        try:
            job = poll_for_jobs()
            nonce, jobId, inputS3, inputObject, outputS3, outputObject, ak, sk, st, config = get_job_info(job)
            acknowledge = job_acknowledge(jobId, nonce)
            print('Acknowledge job returned: ' + str(acknowledge))
            artifact, tempdirname = get_s3_artifact(inputS3, inputObject, ak, sk, st)
            artifact_list, newtempdir = unzip_codepipeline_artifact(artifact, tempdirname)
            pkg = config['TypeOfArtifact']
            if pkg == 'npm':
                publish_stat, npmconfigname = push_to_npm(config, artifact_list, newtempdir, jobId)
                print('Publishing to repository resulted in the status code: %s' % str(publish_stat))
            cleanup(npmconfigname, newtempdir)
        except Exception as e:
            print(" Received an error: %s" % e)
            raise