Created
February 16, 2020 13:41
-
-
Save koonagi/0d744174d9c002810ced0dc2d8c5e5c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
lambda_client = boto3.client('lambda') | |
codepipeline_client = boto3.client('codepipeline') | |
def lambda_handler(event, context): | |
try: | |
### | |
# Get CodepipeLine Job ID | |
### | |
job_id = event['CodePipeline.job']['id'] | |
### | |
# TODO implement | |
### | |
### | |
# Response job result(success) to codepipeline | |
### | |
codepipeline_client.put_job_success_result(jobId=job_id) | |
except Exception as e: | |
### | |
# Response job result(failure) to codepipeline | |
### | |
codepipeline_client.put_job_failure_result( | |
jobId=job_id, | |
failureDetails={ | |
'type': 'JobFailed', | |
'message': str(e) | |
} | |
) | |
raise Exception(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment