-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yaml
38 lines (34 loc) · 999 Bytes
/
buildspec.yaml
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
version: 0.2
env:
variables:
S3_BUCKET: 'maximeclement.com'
APP_NAME: 'maximeclement.com'
BUILD_ENV: 'prod'
phases:
install:
runtime-versions:
nodejs: 10
commands:
# Install angular cli
- npm install -g @angular/[email protected]
# Install node dependancies.
- npm install
build:
commands:
# Builds Angular application. You can also build using custom environment here like mock or staging
- echo Build started on `date`
- npm run build:prod
post_build:
commands:
# Clear S3 bucket.
- aws s3 rm s3://${S3_BUCKET} --recursive
- echo S3 bucket is cleared.
- ls
# Copy dist folder to S3 bucket, As of Angular 6, builds are stored inside an app folder in distribution and not at the root of the dist folder
- aws s3 cp dist s3://${S3_BUCKET}/${APP_NAME} --recursive
- echo Build completed on `date`
# artifacts:
# files:
# - '**/*'
# discard-paths: yes
# base-directory: 'dist*'