GitLab CI Multi Runner for pipeline jobs with GitLab CI with built-in support for AWS SAM CLI
5.3K
For npm support use the nodejs tag anjanbiswas/gitlab-runner-sam-cli:nodejs.
docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
anjanbiswas/gitlab-runner-sam-cli:latest
TIP: On macOS, use
/Users/Sharedinstead of/srv.
To register your runner with Gitlab -
docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner \
anjanbiswas/gitlab-runner-sam-cli:latest register
For further instructions on Docker based Gitlab Runner registration see documentation
To initialize and invoke an AWS Lambda Function (NodeJS 8.10) in a sam-cli project with a properly defined SAM Template (template.yml) and CI Pipeline with .gitlab-ci.yml-
TIP: Both
template.ymland.gitlab-ci.ymlmust be in the root of the SAM Project.
image: node:8.10
stages:
- install # install all npm dependencies
- test # execute unit tests
npmInstall:
stage: install
script:
- npm install --production
# artifacts describe the result of the stage
# that can be used in consecutive stages
artifacts:
untracked: true
unit-testing:
stage: test
image: anjanbiswas/gitlab-runner-sam-cli:nodejs
# use the artifcats of the 'npmInstall' job
dependencies:
- npmInstall
script:
- npm install
#Invoke the Lambda Function locally
- sam local invoke --event event.json
Content type
Image
Digest
Size
137.2 MB
Last updated
over 7 years ago
docker pull anjanbiswas/gitlab-runner-sam-cli