{"id":19037079,"url":"https://github.com/retgits/jenkinsbuild-lambda","last_synced_at":"2025-09-13T12:40:55.050Z","repository":{"id":57493598,"uuid":"136755951","full_name":"retgits/jenkinsbuild-lambda","owner":"retgits","description":"An AWS Lambda app that triggers Jenkins jobs based on SQS events","archived":false,"fork":false,"pushed_at":"2019-09-11T21:14:25.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T22:12:49.166Z","etag":null,"topics":["aws-sqs","jenkins","lambda"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retgits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-09T20:33:00.000Z","updated_at":"2019-09-11T21:14:27.000Z","dependencies_parsed_at":"2022-08-28T13:41:13.764Z","dependency_job_id":null,"html_url":"https://github.com/retgits/jenkinsbuild-lambda","commit_stats":null,"previous_names":["retgits/sqsreceiver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/retgits/jenkinsbuild-lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fjenkinsbuild-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fjenkinsbuild-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fjenkinsbuild-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fjenkinsbuild-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retgits","download_url":"https://codeload.github.com/retgits/jenkinsbuild-lambda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fjenkinsbuild-lambda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274961851,"owners_count":25381893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-sqs","jenkins","lambda"],"created_at":"2024-11-08T21:58:37.149Z","updated_at":"2025-09-13T12:40:55.018Z","avatar_url":"https://github.com/retgits.png","language":"Go","readme":"# jenkinsbuild-lambda\n\nTrigger builds using the [Jenkins REST API](https://wiki.jenkins.io/display/JENKINS/Remote+access+API) based on messages published on an [Amazon SQS](https://aws.amazon.com/sqs/) queue.\n\n## Prerequisites\n\n### Environment Variables\n\nThe app relies on [AWS Systems Manager Parameter Store](https://aws.amazon.com/systems-manager/features/) (SSM) to store encrypted variables on how to connect to Jenkins. The variables it relies on are:\n\n* `/prod/jenkins/token`: The token to authenticate to Jenkins\n* `/prod/jenkins/user`: The username to authenticate to Jenkins\n* `/prod/jenkins/url`: The URL to Jenkins\n\nThese parameters are encrypted using [Amazon KMS](https://aws.amazon.com/kms/) and retrieved from the Parameter Store on deployment. This way the encrypted variables are given to the Lambda function and the function needs to take care of decrypting them at runtime.\n\nTo create the encrypted variables, run the below command for all of the variables\n\n```bash\naws ssm put-parameter                       \\\n   --type String                            \\\n   --name \"/prod/jenkins/token\"             \\\n   --value $(aws kms encrypt                \\\n              --output text                 \\\n              --query CiphertextBlob        \\\n              --key-id \u003cYOUR_KMS_KEY_ID\u003e    \\\n              --plaintext \"PLAIN TEXT HERE\")\n```\n\nTo test the function locally, using `SAM`, you'll have to uncomment lines 45-47 in the `template.yaml` file and update these with base64 encoded values from the Parameter Store. Only during deployment to AWS Lambda will these variables get their actual values from the Parameter Store.\n\n### SQS queue\n\nThe SSM parameter `/prod/jenkins/sqsqueue` doesn't have to be encrypted but does need to reference a valid SQS ARN. The payload of the message the function expects is\n\n```json\n{\n   \"BuildID\": \"MyAwesomeBuild\"\n}\n```\n\nIn this case, _MyAwesomeBuild_ is the name of the job to trigger in Jenkins.\n\n## Build and Deploy\n\nThere are several `Make` targets available to help build and deploy the function\n\n| Target | Description                                       |\n|--------|---------------------------------------------------|\n| build  | Build the executable for Lambda                   |\n| clean  | Remove all generated files                        |\n| deploy | Deploy the app to AWS Lambda                      |\n| deps   | Get the Go modules from the GOPROXY               |\n| help   | Displays the help for each target (this message). |\n| local  | Run SAM to test the Lambda function using Docker  |\n| test   | Run all unit tests and print coverage             |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretgits%2Fjenkinsbuild-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretgits%2Fjenkinsbuild-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretgits%2Fjenkinsbuild-lambda/lists"}