| 
									
										
										
										
											2018-08-08 11:18:52 +08:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set -x | 
					
						
							| 
									
										
										
										
											2018-10-25 09:54:55 +08:00
										 |  |  | set -e | 
					
						
							| 
									
										
										
										
											2018-08-08 11:18:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-24 10:56:38 +08:00
										 |  |  | commitSha=$(git rev-parse --short HEAD) | 
					
						
							|  |  |  | commitMessage=$(git log --oneline -n 1) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-08 11:18:52 +08:00
										 |  |  | cd `dirname $0` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | yarn build | 
					
						
							| 
									
										
										
										
											2019-01-05 14:58:41 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-15 00:36:32 +08:00
										 |  |  | yarn preview > /tmp/preview.log & | 
					
						
							| 
									
										
										
										
											2019-01-05 14:58:41 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | sleep 3; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-14 22:41:57 +08:00
										 |  |  | ts-node ./tools/translator/bin/prerender.ts | 
					
						
							| 
									
										
										
										
											2019-01-05 14:58:41 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | killall -9 node | 
					
						
							| 
									
										
										
										
											2018-11-09 09:42:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-02 13:17:29 +08:00
										 |  |  | if [[ ! -d "./ng-docs.github.io" ]] | 
					
						
							| 
									
										
										
										
											2019-01-01 22:45:58 +08:00
										 |  |  | then | 
					
						
							| 
									
										
										
										
											2019-02-14 22:41:57 +08:00
										 |  |  |     git clone https://asnowwolf:${GITHUB_ACCESS_TOKEN}@github.com/ng-docs/preview.angular.cn.git ./ng-docs.github.io | 
					
						
							| 
									
										
										
										
											2019-01-01 22:45:58 +08:00
										 |  |  | fi | 
					
						
							| 
									
										
										
										
											2018-11-09 09:42:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-02 18:13:10 +08:00
										 |  |  | cp -r dist/* ./ng-docs.github.io | 
					
						
							| 
									
										
										
										
											2018-11-09 08:52:30 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-02 18:13:10 +08:00
										 |  |  | cd ./ng-docs.github.io | 
					
						
							| 
									
										
										
										
											2018-11-09 08:52:30 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-08 11:18:52 +08:00
										 |  |  | git add . | 
					
						
							| 
									
										
										
										
											2018-09-24 10:56:38 +08:00
										 |  |  | git commit --allow-empty -am "${commitMessage}" | 
					
						
							| 
									
										
										
										
											2018-08-08 11:18:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-24 11:01:10 +08:00
										 |  |  | git push | 
					
						
							| 
									
										
										
										
											2018-08-08 11:18:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | cd - |