File tree Expand file tree Collapse file tree 2 files changed +45
-4
lines changed Expand file tree Collapse file tree 2 files changed +45
-4
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "variables" : {
3
+ "aws_access_key_id" : " {{ env `AWS_ACCESS_KEY_ID` }}" ,
4
+ "aws_secret_access_key" : " {{ env `AWS_SECRET_ACCESS_KEY` }}" ,
5
+ "aws_region" : " {{ env `AWS_REGION` }}" ,
6
+ "fastly_api_key" : " {{ env `FASTLY_API_KEY` }}"
7
+ },
8
+ "builders" : [
9
+ {
10
+ "type" : " docker" ,
11
+ "image" : " ruby:2.3-slim" ,
12
+ "commit" : " true"
13
+ }
14
+ ],
15
+ "provisioners" : [
16
+ {
17
+ "type" : " file" ,
18
+ "source" : " ." ,
19
+ "destination" : " /app"
20
+ },
21
+ {
22
+ "type" : " shell" ,
23
+ "environment_vars" : [
24
+ " AWS_ACCESS_KEY_ID={{ user `aws_access_key_id` }}" ,
25
+ " AWS_SECRET_ACCESS_KEY={{ user `aws_secret_access_key` }}" ,
26
+ " AWS_REGION={{ user `aws_region` }}" ,
27
+ " FASTLY_API_KEY={{ user `fastly_api_key` }}"
28
+ ],
29
+ "inline" : [
30
+ " apt-get update" ,
31
+ " apt-get install -y build-essential curl git libffi-dev s3cmd" ,
32
+ " cd /app" ,
33
+
34
+ " bundle check || bundle install --jobs 7" ,
35
+ " bundle exec middleman build" ,
36
+
37
+ " /bin/bash ./scripts/deploy.sh"
38
+ ]
39
+ }
40
+ ]
41
+ }
Original file line number Diff line number Diff line change 31
31
# directory
32
32
SOURCE=" ${BASH_SOURCE[0]} "
33
33
while [ -h " $SOURCE " ] ; do SOURCE=" $( readlink " $SOURCE " ) " ; done
34
- DIR=" $( cd -P " $( dirname " $SOURCE " ) /.." && pwd ) "
34
+ DIR=" $( cd -P " $( dirname " $SOURCE " ) /.." && pwd) "
35
35
36
36
# Upload the files to S3 - we disable mime-type detection by the python library
37
37
# and just guess from the file extension because it's surprisingly more
@@ -42,8 +42,8 @@ if [ -z "$NO_UPLOAD" ]; then
42
42
echo " Uploading to S3..."
43
43
44
44
# Check that the site has been built
45
- if [ ! -d " $DIR /website/ build" ]; then
46
- echo " Missing compiled website! Running ` make build` to compile!"
45
+ if [ ! -d " $DIR /build" ]; then
46
+ echo " Missing compiled website! Run ' make build' to compile!"
47
47
exit 1
48
48
fi
49
49
@@ -56,7 +56,7 @@ if [ -z "$NO_UPLOAD" ]; then
56
56
--recursive \
57
57
--add-header=" Cache-Control: max-age=31536000" \
58
58
--add-header=" x-amz-meta-surrogate-key: site-$PROJECT " \
59
- put " $DIR /website/ build/" " s3://hc-sites/$PROJECT /latest/"
59
+ put " $DIR /build/" " s3://hc-sites/$PROJECT /latest/"
60
60
fi
61
61
62
62
# Perform a soft-purge of the surrogate key.
You can’t perform that action at this time.
0 commit comments