-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
73 lines (60 loc) · 1.23 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
66
67
68
69
70
71
72
73
image:
name: hashicorp/terraform:latest
entrypoint: [""]
stages:
- build
- plan
- deploy
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
TF_VAR_bucket_name: $BUCKET_NAME
TF_VAR_environment: $ENVIRONMENT
TF_VAR_function_name: $FUNCTION_NAME
TF_VAR_api_name: $API_NAME
TF_VAR_region: $REGION
TF_VAR_resize_prefix: $RESIZE_PREFIX
TF_VAR_profile: $PROFILE
TF_VAR_cdn_url: $CDN_URL
TF_VAR_source_bucket: $SOURCE_BUCKET
.install-dependencies:
before_script:
stage: [build]
script: |
#!/usr/bin/env bash
set -e
echo "Installing dependencies"
# installing sam cli and aws cli
pip install awscli --upgrade --user
pip install aws-sam-cli --upgrade --user
build:
extends: .install-dependencies
stage: build
script: |
#!/bin/bash
set -e
cd lambda-resizer
sam build
only:
- main
artifacts:
paths:
- lambda-resizer/.aws-sam/build
plan:
stage: plan
script:
- terraform init
- terraform plan
only:
- main
deploy:
stage: deploy
script:
- terraform init
- terraform plan
- terraform apply -auto-approve
only:
- main
environment:
name: production
when: manual