This repository was archived by the owner on Jul 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlrn-build-dependency.sh
More file actions
84 lines (80 loc) · 2.38 KB
/
lrn-build-dependency.sh
File metadata and controls
84 lines (80 loc) · 2.38 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# This will walk into each directory in this set and ensure it's demo is up to date
# and pushed up to github
# where am i? move to where I am. This ensures source is properly sourced
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
#provide messaging colors for output to console
txtbld=$(tput bold) # Bold
bldgrn=${txtbld}$(tput setaf 2) # green
bldred=${txtbld}$(tput setaf 1) # red
txtreset=$(tput sgr0)
lrnecho(){
echo "${bldgrn}$1${txtreset}"
}
lrnwarn(){
echo "${bldred}$1${txtreset}"
}
#repo in question
repo=$1
if [ -z $1 ]; then
read -rp "Repo name: " repo
fi
# go back a level so we have all the repos here
cd ~/LRNWebcomponents/$repo
# commit message
commit=$2
if [ -z $2 ]; then
read -rp "Commit message: " commit
fi
# add everything in from this repo
git add -A
git commit -m "$commit"
git push origin master
# tag for this repo
tag=$3
git tag
if [ -z $3 ]; then
read -rp "Tag: " tag
fi
# push to this tag
git tag $tag
git push origin $tag
# update demo to match
sh update-demo.sh
# move into the build directory
cd ../build
# install which will then update to this tag
bower install --save LRNWebcomponents/$repo
# build which will have the new item roped in
polymer build
# move to build directory
cd build/default
# smash it into 1 file
vulcanize index.html > build.html
# move back to root of build repo
cd ../..
cp -R components-to-copy/ build/default/bower_components/
# add all changes for this
git add -A
git commit -m "updated downstream $repo"
git push origin master
# now make change in the build for edit derivative
# move into the build directory
cd ../build-for-edit
# install which will then update to this tag
bower install --save LRNWebcomponents/$repo
# build which will have the new item roped in
polymer build
# move to build directory
cd build/default
# smash it into 1 file
vulcanize index.html > build.html
# move back below the repo
cd ../../..
# support for updating ELMSLN copy of this
cp build/build/default/build.html ~/elmsln/core/webcomponents/elements/_build/build.html
cp build/build/default/push-manifest.json ~/elmsln/core/webcomponents/elements/_build/manifest.json
cp build/build/default/service-worker.js ~/elmsln/core/webcomponents/elements/_build/service-worker.js
cp build-for-edit/build/default/build.html ~/elmsln/core/webcomponents/elements/_build/build_edit.html
echo "$repo as well as the LRN build file have been updated"