forked from aws-samples/aws-get-started-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webspec.yml
45 lines (43 loc) · 1.58 KB
/
webspec.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
version: 0.2
phases:
install:
runtime-versions:
docker: 19
python: 3.7
ruby: 2.7
pre_build:
commands:
- locale-gen en_US en_US.UTF-8
- dpkg-reconfigure locales
- export LC_ALL="en_US.UTF-8"
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=${COMMIT_HASH:=latest}
- |
if [ ! -d ".git" ]; then
echo Initializing Git Repo
git init
git remote add origin $FULL_REPO_URL
git fetch
git checkout -f "$CODEBUILD_RESOLVED_SOURCE_VERSION"
fi
- git submodule init
- git submodule update --recursive --remote --merge
- echo Install Hugo
# Latest version of Hugo
- curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "download_url.*Linux-64bit.tar.gz" | grep -v "extended" | cut -d '"' -f 4 | wget -qi -
- HUGO_TAR="$(find . -name "*Linux-64bit.tar.gz")"
- tar -xzf $HUGO_TAR
- chmod +x hugo
- gem install html-proofer
# Copy deployment script so that build stage can access it
- cp automation/content-build-deploy/deploy.sh /usr/local/bin/
- . automation/content-build-deploy/build-env.sh
build:
commands:
- echo Build website
- ./hugo -D --enableGitInfo
- HTML_PROOFER="$(gem contents html-proofer | grep '/bin/')"
- echo running html-proofer
- $HTML_PROOFER ./public --check-html --empty-alt-ignore --allow-hash-href
# fail if proofer has issues... if you want to deploy anyway, move these back to post_build
- deploy.sh