-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.sh
executable file
·43 lines (32 loc) · 1.09 KB
/
run.sh
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
#!/bin/bash
set -e
# Adapted from run.sh in iainmckay/satis-s3
# Source: https://github.com/iainmckay/satis-s3/blob/ce9d960d54aa1e6fcb888c88f6ddc1e4cd2c7c30/run.sh
# These 'env vars' are hard coded as Satis expects these locations
export SATIS="/satis/bin/satis"
export OUT_PATH="/tmp/satis"
export CONFIG_PATH="/config.json"
if [ ! -z "$GITHUB_AUTH" ]; then
/composer.phar config --global github-oauth.github.com "$GITHUB_AUTH"
fi
echo "ENV VARS ..."
echo "SATIS: ${SATIS}"
echo "OUT_PATH: ${OUT_PATH}"
echo "About to make OUT_PATH"
mkdir -p $OUT_PATH
# Download the existing repo from S3
echo "About to s3 sync bucket to tmp"
aws s3 sync s3://$S3_BUCKET/$S3_PATH $OUT_PATH
echo "About to rm OUT_PATH/include/*"
rm -f $OUT_PATH/include/*
echo "Contents of /tmp/ ..."
ls -la /tmp
# Rebuild the repo
echo "About to build with satis."
php $SATIS build --verbose $CONFIG_PATH $OUT_PATH
# Purge unused package files
echo "About to purge with satis"
php $SATIS purge $CONFIG_PATH $OUT_PATH
# Push it back to S3
echo "About to s3 sync tmp to bucket"
aws s3 sync --delete $OUT_PATH s3://$S3_BUCKET/$S3_PATH