Skip to content

Commit

Permalink
Uml 3727 build image (#2968)
Browse files Browse the repository at this point in the history
* Update docker file

* go mod init

* Add go lambda

* Update Dockerfile

* update build and push actions

* Update build and push

* Update path in build and push

* Update go ver

* Update ingestion lambda

* Update dockerfile

* Update dockerfile

* Update DockerFile
  • Loading branch information
gillettmoj authored Nov 28, 2024
1 parent d3afd7b commit d7fe909
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/_build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ jobs:
run_unit_tests: 'true'
run_integration_tests: 'false'
artifact_to_dl: ''
- svc_prefix: 'ingestion'
svc_suffix: 'lambda'
build_development_docker: 'false'
run_unit_tests: 'false'
run_integration_tests: 'false'
artifact_to_dl: ''
steps:
- uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb

Expand Down Expand Up @@ -255,9 +261,12 @@ jobs:
docker build --file service-${SVC_PREFIX}/docker/web/Dockerfile --tag ${SVC_PREFIX}_web:latest .
elif [[ "${SVC_SUFFIX}" = "lambda" ]]; then
elif [[ "${SVC_PREFIX}" = "stats_upload" ]]; then
docker build --no-cache --file lambda-functions/upload-statistics/Dockerfile --tag stats_upload_lambda:latest lambda-functions/upload-statistics
elif [[ "${SVC_PREFIX}" = "ingestion" ]]; then
docker build --file lambda-functions/ingestion-lambda/Dockerfile --tag ingestion_lambda:latest lambda-functions/ingestion-lambda
fi
if: (inputs.specific_path == 'all' || inputs.specific_path == matrix.svc_prefix)

Expand Down
4 changes: 2 additions & 2 deletions lambda-functions/ingestion-lambda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ COPY go.mod go.sum ./

RUN go mod download

COPY cmd/ingestion ./cmd/ingestion
COPY app/ ./

RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o /go/bin/ingestion ./cmd/ingestion
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o /go/bin/ingestion ./

FROM scratch AS production

Expand Down
17 changes: 17 additions & 0 deletions lambda-functions/ingestion-lambda/app/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

import (
"context"
"fmt"

"github.com/aws/aws-lambda-go/lambda"
)

func Handler(ctx context.Context) (string, error) {
fmt.Println("Hello World")
return "Hello World!", nil
}

func main() {
lambda.Start(Handler)
}
5 changes: 5 additions & 0 deletions lambda-functions/ingestion-lambda/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/ministryofjustice/opg-use-an-lpa

go 1.23.1

require github.com/aws/aws-lambda-go v1.47.0 // indirect
2 changes: 2 additions & 0 deletions lambda-functions/ingestion-lambda/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI=
github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A=

0 comments on commit d7fe909

Please sign in to comment.