-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildspec.yml
32 lines (28 loc) · 1.11 KB
/
buildspec.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
version: 0.2
phases:
install:
commands:
- echo Beginning the install phase...
- npm install -g terser
- npm install -g uglifycss
- rm -rf build
- mkdir build
build:
commands:
- echo Beginning the build phase...
- cat js/*.js > build/theme.js
- terser build/theme.js > build/theme.min.js
- cat css/*.css > build/theme.css
- uglifycss build/theme.css > build/theme.min.css
- echo "\n\n// $CODEBUILD_SOURCE_VERSION $CODEBUILD_WEBHOOK_HEAD_REF $CODEBUILD_WEBHOOK_TRIGGER\n\n" >> build/theme.js
- echo "\n\n// $CODEBUILD_SOURCE_VERSION $CODEBUILD_WEBHOOK_HEAD_REF $CODEBUILD_WEBHOOK_TRIGGER\n\n" >> build/theme.min.js
- echo "\n\n/* $CODEBUILD_SOURCE_VERSION $CODEBUILD_WEBHOOK_HEAD_REF $CODEBUILD_WEBHOOK_TRIGGER */\n\n" >> build/theme.css
- echo "\n\n/* $CODEBUILD_SOURCE_VERSION $CODEBUILD_WEBHOOK_HEAD_REF $CODEBUILD_WEBHOOK_TRIGGER */\n\n" >> build/theme.min.css
artifacts:
files:
- build/theme.js
- build/theme.min.js
- build/theme.css
- build/theme.min.css
name: build-$(date +%Y-%m-%d-%H-%M-%S)
discard-paths: yes