Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit bfd7b22

Browse files
chore(code.angularjs.org/publish): push snapshot from jenkins master build
Since the CI server is not available, we are not able to pull the current build from it to update the snapshot. This commit changes Jenkins to push the snapshot directly to the code.angularjs.org repository on every successful master build.
1 parent 581ee9d commit bfd7b22

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

scripts/code.angularjs.org/publish.sh

+17-25
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,26 @@ function init {
2323
}
2424

2525
function prepare {
26-
if [[ $IS_SNAPSHOT_BUILD ]]; then
27-
# nothing to prepare for snapshot builds as
28-
# code.angularjs.org will fetch the current snapshot from
29-
# the build server during publish
30-
exit 0
31-
fi
3226

3327
echo "-- Cloning code.angularjs.org"
34-
git clone git@github.com:angular/code.angularjs.org.git $REPO_DIR
28+
git clone git@github.com:angular/code.angularjs.org.git $REPO_DIR --depth=1
3529

36-
#
37-
# copy the files from the build
38-
#
3930
echo "-- Updating code.angularjs.org"
40-
mkdir $REPO_DIR/$NEW_VERSION
41-
cp -r $BUILD_DIR/* $REPO_DIR/$NEW_VERSION/
31+
32+
if [[ $IS_SNAPSHOT_BUILD ]]; then
33+
#
34+
# update the snapshot folder
35+
#
36+
rm -rf $REPO_DIR/snapshot
37+
mkdir $REPO_DIR/snapshot
38+
cp -r $BUILD_DIR/* $REPO_DIR/snapshot/
39+
else
40+
#
41+
# copy the files from the build
42+
#
43+
mkdir $REPO_DIR/$NEW_VERSION
44+
cp -r $BUILD_DIR/* $REPO_DIR/$NEW_VERSION/
45+
fi
4246

4347
#
4448
# commit
@@ -50,13 +54,6 @@ function prepare {
5054
}
5155

5256

53-
function _update_snapshot() {
54-
for backend in "$@" ; do
55-
echo "-- Updating snapshot version: backend=$backend"
56-
curl -G --data-urlencode "ver=$NEW_VERSION" http://$backend:8003/fetchLatestSnapshot.php
57-
done
58-
}
59-
6057
function _update_code() {
6158
cd $REPO_DIR
6259

@@ -74,12 +71,7 @@ function publish {
7471
# the currently serving Compute Engine backends.
7572
# code.angularjs.org is served out of port 8003 on these backends.
7673
backends=("$(dig backends.angularjs.org +short TXT | python -c 'print raw_input()[1:-1].replace(",", "\n")')")
77-
78-
if [[ $IS_SNAPSHOT_BUILD ]]; then
79-
_update_snapshot ${backends[@]}
80-
else
81-
_update_code ${backends[@]}
82-
fi
74+
_update_code ${backends[@]}
8375
}
8476

8577
source $(dirname $0)/../utils.inc

0 commit comments

Comments
 (0)