forked from awslabs/speke-reference-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal_build.sh
executable file
·38 lines (29 loc) · 1.15 KB
/
local_build.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
#!/bin/sh
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
ORIGIN=`pwd`
BUILD=$ORIGIN/build
# date stamp for this deploy
STAMP=`date +%s`
echo build stamp is $STAMP
# clear the build folder
rm -f $BUILD/*
# create the reference server zip with a unique name
SERVZIP=speke-reference-lambda-$STAMP.zip
cd $ORIGIN/src
# using zappa for help in packaging
zappa package --output $BUILD/$SERVZIP
# create the custom resource zip with a unique name
RESZIP=cloudformation-resources-$STAMP.zip
cd $ORIGIN/cloudformation
zip -r $BUILD/$RESZIP mediapackage_endpoint_common.py mediapackage_speke_endpoint.py resource_tools.py
# update templates with the new zip filenames
sed -e "s/DEV_0_0_0/$STAMP/g" speke_reference.json >$BUILD/speke_reference.json
sed -e "s/DEV_0_0_0/$STAMP/g" mediapackage_speke_endpoint.json >$BUILD/mediapackage_speke_endpoint.json
cd $BUILD