Skip to content

Instantly share code, notes, and snippets.

@Muneefm
Created January 27, 2018 13:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Muneefm/be63deff14f4093c3ef0d9145d2d0104 to your computer and use it in GitHub Desktop.
Save Muneefm/be63deff14f4093c3ef0d9145d2d0104 to your computer and use it in GitHub Desktop.
This is Gitlab-ci to update lambda code via gitlab. Used this to publish alexa skill.
stages:
- deploy
variables:
AWS_ACCESS_KEY_ID: "ABCD"
AWS_SECRET_ACCESS_KEY: "ABCD"
AWS_DEFAULT_REGION: "us-east-1"
NAME: "your-function-name"
RUNTIME: "nodejs6.10"
ROLE: "arn:aws:iam::000000000000:role/xxxxx"
HANDLER: "index.handler"
FILE: "fileb://your-file.zip"
S3_PATH: "upload-path-to-s3-bucket-"
S3_BUCKET: "s3-bucket-name"
S3_KEY: "file-path-in-s3-bucket"
upload-to-lambda:
image: salte/aws-lambda-deploy:latest
stage: deploy
script:
- zip -r your-file.zip .
- aws s3 ls
- aws s3 cp your-file.zip $S3_PATH
- aws lambda update-function-code --function-name $NAME --s3-bucket $S3_BUCKET --s3-key $S3_KEY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment