-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
66 lines (55 loc) · 1.88 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
image: alpine
stages:
- build
- fhir-sandbox
- fhir-onboard
# Lambda Build Stages
build:
stage: build
image: maven:3.8-openjdk-17-slim
script:
- mvn clean
- mvn install
artifacts:
expire_in: 1 week
paths:
- target/ecr-cda-to-fhir-lambda-1.0.1.jar
.upload_and_deploy: &upload_and_deploy
image:
name: amazon/aws-cli
entrypoint: [""]
script:
- aws sts get-caller-identity
- cd target/
- aws s3 cp $S3_KEY s3://$S3_BUCKET/
- aws lambda update-function-code --region us-east-1 --function-name $FUNCTION_NAME --s3-bucket $S3_BUCKET --s3-key $S3_KEY
# Lambda Deploy Stages
##############################################################################
### ECR on FHIR SANDBOX ###
##############################################################################
deploy-lambda-fhir-sandbox:
stage: fhir-sandbox
<<: *upload_and_deploy
variables:
AWS_ACCESS_KEY_ID: $FHIR_SANDBOX_AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY: $FHIR_SANDBOX_AWS_SECRET_KEY
S3_BUCKET: fhir-aims-sandbox-lambda-funcs
S3_KEY: ecr-cda-to-fhir-lambda-1.0.1.jar
FUNCTION_NAME: fhir-aims-sandbox-cda2fhirlambda
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
##############################################################################
### ECR on FHIR ONBOARD ###
##############################################################################
deploy-lambda-fhir-onboard:
stage: fhir-onboard
<<: *upload_and_deploy
variables:
AWS_ACCESS_KEY_ID: $FHIR_ONBOARD_AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY: $FHIR_ONBOARD_AWS_SECRET_KEY
S3_BUCKET: fhir-aims-onboard-lambda-funcs
S3_KEY: ecr-cda-to-fhir-lambda-1.0.1.jar
FUNCTION_NAME: fhir-aims-onboard-cda2fhirlambda
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: manual