Sign inSign up

anjanbiswas/gitlab-runner-sam-cli

By anjanbiswas

•Updated over 7 years ago

GitLab CI Multi Runner for pipeline jobs with GitLab CI with built-in support for AWS SAM CLI

Image
1

5.3K

anjanbiswas/gitlab-runner-sam-cli repository overview

⁠Gitlab Runner with AWS SAM CLI

⁠GitLab CI Multi Runner for pipeline jobs and built-in support for AWS SAM⁠ CLI.

For npm support use the nodejs tag anjanbiswas/gitlab-runner-sam-cli:nodejs.

⁠Quick Run
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/Shared instead 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⁠

⁠Sample usage

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.yml and .gitlab-ci.yml must 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

Tag summary

Content type

Image

Digest

Size

137.2 MB

Last updated

over 7 years ago

docker pull anjanbiswas/gitlab-runner-sam-cli