forked from guardian/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdist-publish-assets-tc
executable file
·56 lines (43 loc) · 1.3 KB
/
dist-publish-assets-tc
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
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -o xtrace
set -o nounset
set -o errexit
echo "Asset publish"
set +x
echo "##teamcity[progressStart 'asset publish']"
set -x
static_folder="static/riffraff"
rm -rf $static_folder
mkdir -p "$static_folder/packages/frontend-static"
cp "static/deploy.json" "$static_folder"
cp -r static/hash/* "$static_folder/packages/frontend-static"
cp static/abtests.json "$static_folder/packages/frontend-abtests"
pushd $static_folder
zip -r "../artifacts.zip" .
mv ../artifacts.zip ./artifacts.zip
popd
echo "Uploading artifact and build manifest to S3"
set +u
if [[ -z $BUILD_NUMBER ]]; then
BUILD_NUMBER=0
fi
if [[ -z $BUILD_VCS_NUMBER ]]; then
BUILD_VCS_NUMBER=dev-vcs-build
fi
if [[ -z $BUILD_VCS_BRANCH ]]; then
BUILD_VCS_BRANCH=dev-branch
fi
set -u
BUILD_START_DATE=$(date +"%Y-%m-%dT%H:%M:%S.000Z")
sed -e "s|<%build_number%>|$BUILD_NUMBER|" \
-e "s|<%start_time%>|$BUILD_START_DATE|" \
-e "s|<%revision%>|$BUILD_VCS_NUMBER|" \
-e "s|<%branch%>|$BUILD_VCS_BRANCH|" \
static/build-template.json | tee $static_folder/build.json
set +o xtrace
echo "##teamcity[publishArtifacts '$static_folder/artifacts.zip => static']"
echo "##teamcity[publishArtifacts '$static_folder/build.json => static']"
set -o xtrace
set +x
echo "##teamcity[progressFinish 'asset publish']"
set -x