sh 将自定义标签和部署/测试计划清单添加到Github

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 将自定义标签和部署/测试计划清单添加到Github相关的知识,希望对你有一定的参考价值。

USER=$GIT_AUTH_USER
PASS=$GIT_AUTH_TOKEN

if git rev-parse --git-dir > /dev/null 2>&1; then :
    # This is a valid git repository (but the current working
    # directory may not be the top level.
    # Check the output of the git rev-parse command if you care)
    REPO=`git remote show github | grep "Fetch URL:" | sed "s#^.*/\(.*\).git#\1#"`
	echo $REPO
    OWNER=`git remote show github | grep "Fetch URL:" | cut -d "@" -f2 | cut -d ":" -f2 | cut -d "/" -f1`

    # Delete default labels
	curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$OWNER/$REPO/labels/bug"
	curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$OWNER/$REPO/labels/duplicate"
	curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$OWNER/$REPO/labels/enhancement"
	curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$OWNER/$REPO/labels/help%20wanted"
	curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$OWNER/$REPO/labels/invalid"
	curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$OWNER/$REPO/labels/question"
	curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$OWNER/$REPO/labels/wontfix"

	# Create labels
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Can’t Replicate","color":"f49600"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Out of Scope","color":"f4ac00"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Low Priority","color":"f4eab2"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"High Priority","color":"f46400"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Not to Spec","color":"5c0072"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Suggestion","color":"9900bf"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Question","color":"b700bf"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Function","color":"056346"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Performance","color":"004c4a"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Content","color":"B2E0B2"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Style","color":"009800"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Chrome","color":"fbd131"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Firefox","color":"cd3e27"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Safari","color":"2994d2"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"IE 11","color":"004ff2"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"IE 10","color":"0b18db"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"IE 9","color":"3d0cf9"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Mac","color":"53067a"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Windows","color":"690670"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Android 4.4.4","color":"5ef23c"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Android 4.4.2","color":"2cdb43"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Android 5","color":"8adb2c"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"iOS 9","color":"db690b"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"iOS 8","color":"f29000"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Phone","color":"E6E6E6"}' "https://api.github.com/repos/$OWNER/$REPO/labels"
	curl --user "$USER:$PASS" --include --request POST --data '{"name":"Tablet","color":"CFCFCF"}' "https://api.github.com/repos/$OWNER/$REPO/labels"

    # Create testing plan
	curl --user "$USER:$PASS" --include --request POST --data '{"title":"Testing Plan","body":"# NAME OF PROJECT - Testing Plan\nFor more information or a refresher on our testing protocol, please [see the docs](https://github.com/teamcolab/KnowledgeBombz/wiki/Testing-Procedure).\n## 1. Visual Inspection\n- [ ] Is everything visually consistent? Across the site and between browsers?\n- [ ] Are there any abnormalities?\n- [ ] Does every link or action item have a hover/active state?\n- [ ] Does the test link design match the comp?\n- [ ] Does the site breakdown responsively in a manner that is usable and consistent with the desktop experience and normal mobile usability patterns?\n## 2. Functional Inspection\n- [ ] ADD TASKS SPECIFIC TO PROJECT HERE!\n## 3. Performance Inspection\n- [ ] ADD SPECIFIC PAGES/TASKS THAT SHOULD BE FOCUSED ON FOR PERFORMANCE\n#### Load Testing\nThe following pages should be included in a load test.\n- [ ] URL\n- [ ] URL\n- [ ] URL\n## 4. Review\nOnce testing has been completed, and all issues have been closed by the issuer, this issue should be assigned to the PM for approval.\n- [ ] Assigned to PM for final approval"}' "https://api.github.com/repos/$OWNER/$REPO/issues"

	# Create deployment plan
	curl --user "$USER:$PASS" --include --request POST --data '{"title":"Deployment Plan","body":"# NAME OF PROJECT - Deployment Plan\nThis comprehensive deployment plan is to be completed for all projects. It includes standard deployment tasks that are to occur both prior to and following deployment. It may also contain project specific tasks that should be highlighted in the checklists below.\nShould any issues arise during the deployment phase, those issues should be logged in GitHub, and the PM should be notified immediately.\n## 1. Prerequisites\n#### DNS & Hosting Information\nAny hosting information should be included here.\n#### Security Requirements\nAny security information should be included here.\n#### Additional Information\nAny additional information the developer may need for deployment should be included here.\n## 2. Pre-Deployment Tasks\n#### General Tasks\n- [ ] Client has approved launch date\n- [ ] Images have alt text\n- [ ] Site is free of Javascript errors and debugging messages\n- [ ] Source code is free of comments/vardump/outputted values\n- [ ] Browser testing has been completed\n- [ ] Make sure that any hosting or DNS credentials are in hand and working properly\n- [ ] Compile styles and scripts for production\n- [ ] Install plugin and sign up/connect \"Free\" or \"Pay as You Go\" SendGrid account for transactional email delivery\n- [ ] Generate 301 redirects or ask client for mapping if they are inputting content\n- [ ] Generate favicons\n- [ ] style.css contains proper attribution to CO+LAB with name of client as theme name and appropriate screenshot.png\n- [ ] If client has Google Analytics confirm that we have account access. If not, make a note of this and set one up.\n#### Project Specific Tasks\n- [ ] ADD PROJECT SPECIFIC PRE-LAUNCH TASKS HERE - If applicable\n## 3. Post-Deployment Tasks\n#### General Tasks\n- [ ] Project manager has checked the proposal to ensure site meets the promised requirements\n- [ ] Hosts file has been cleared of development IP addresses\n- [ ] The website loads quickly\n- [ ] Visual inspection yields no abnormalities\n- [ ] Page titles appear correctly\n- [ ] Page descriptions appear correctly\n- [ ] Site is free of boilerplate text, graphics, and templates\n- [ ] When you view the site in a browser the favicon shows up\n- [ ] When you bookmark the site on an iPhone/iPad the apple touch icon appears\n- [ ] 404 page yields an appropriate 404 response\n- [ ] 301 redirects are in place\n- [ ] Development content has been removed\n- [ ] Recipient for forms are set to the appropriate email addresses\n- [ ] Typography.com: Move settings to production ensuring that the domains match the live domain (including https)\n- [ ] Verify that email notifications are being sent rapidly\n- [ ] CO+LAB credit line has been included\n- [ ] Running Integrity on the live URL has no errors\n- [ ] There are no 404 errors\n- [ ] There are no references to the test link\n- [ ] Gateways and API credentials are set to __live__ mode\n- [ ] Google indexed results are redirecting to the correct pages\n- [ ] Filter CO+LAB and Client IP from Google Analytics   +\n- [ ] Google Analytics is receiving data in real times\n- [ ] /robots.txt allows indexing\n- [ ] Webmaster tools is installed\n- [ ] Sitemap.xml is in place and installed via Webmaster tools\n- [ ] Monitoring service is implemented (pingdom -- note: only required for sites that use servers)\n- [ ] Site is backed up either in Github or as a Zip in the Dropbox\n- [ ] Backup solution is in place (typically Backup Buddy or Pantheon)\n- [ ] Activate backups and configure to backup database daily, files weekly\n- [ ] The above items are marked as completed and the launch has been announced to the team\n- [ ] TURN DOWN FOR WHAT???!?!????!\n#### Project Specific Tasks\n- [ ] ADD PROJECT SPECIFIC PRE-LAUNCH TASKS HERE - If applicable"}' "https://api.github.com/repos/$OWNER/$REPO/issues"
else :
    # this is not a git repository
    echo "You are not currently in any git repo"
fi

以上是关于sh 将自定义标签和部署/测试计划清单添加到Github的主要内容,如果未能解决你的问题,请参考以下文章

是否可以将自定义元数据标签添加到音乐文件?

将自定义标签添加到材料范围滑块

将自定义html添加到django中的choicefield标签

将自定义 CSS 和 JS 添加到 Shopify

如何将自定义标签/过滤器添加到现有的 Django 应用程序?

将自定义 getter 添加到接收到的 json