<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DevOps on Time Friend</title><link>https://time-friend.com/en/categories/devops/</link><description>Recent content in DevOps on Time Friend</description><generator>Hugo</generator><language>en-GB</language><lastBuildDate>Wed, 29 Jul 2026 15:15:07 +0800</lastBuildDate><atom:link href="https://time-friend.com/en/categories/devops/index.xml" rel="self" type="application/rss+xml"/><item><title>Continuous Integration - Code Quality Scanning</title><link>https://time-friend.com/en/archive/continuous-integration-code-quality-scanning/</link><pubDate>Sun, 15 Dec 2019 23:15:00 +0000</pubDate><guid>https://time-friend.com/en/archive/continuous-integration-code-quality-scanning/</guid><description>&lt;p&gt;To facilitate managing company code quality, integrating code quality scanning with continuous integration is an important step.
Currently the company is relatively young, but in just one year, we&amp;rsquo;ve had close to 300 frontend projects.&lt;/p&gt;
&lt;p&gt;With so many frontend projects, how we ensure code quality becomes a very important matter.&lt;/p&gt;
&lt;p&gt;With too many code projects, code review is necessary. But manual code review cannot guarantee efficiency.
Due to differences in individual levels and familiarity with company standards, we cannot guarantee consistent standards across all projects.
Some potential bugs may also be missed.&lt;/p&gt;</description></item><item><title>Continuous Integration - Using GitLab CI for Frontend Project Continuous Integration</title><link>https://time-friend.com/en/archive/continuous-integration-using-gitlab-ci-for-frontend-projects/</link><pubDate>Fri, 20 Sep 2019 23:15:00 +0000</pubDate><guid>https://time-friend.com/en/archive/continuous-integration-using-gitlab-ci-for-frontend-projects/</guid><description>&lt;p&gt;There are many continuous integration platforms on the market. Today I&amp;rsquo;ll introduce GitLab&amp;rsquo;s CI.&lt;/p&gt;
&lt;p&gt;Starting from GitLab 8.0, GitLab CI has been integrated into GitLab.&lt;/p&gt;
&lt;p&gt;Usage is very simple. As long as we create a &lt;code&gt;.gitlab-ci.yml&lt;/code&gt; file in the project root directory and add a Runner, we directly integrate GitLab CI.&lt;/p&gt;
&lt;p&gt;Integration method is very simple and convenient. Currently we put a &lt;code&gt;.gitlab-ci.yml&lt;/code&gt; file in the front-end scaffold, and every subsequent front-end project can directly integrate GitLab CI according to standards.&lt;/p&gt;</description></item><item><title>A Bug Caused by .gitattributes File from Two Years Ago</title><link>https://time-friend.com/en/archive/gitattributes-bug-from-two-years-ago/</link><pubDate>Thu, 24 Jan 2019 19:33:33 +0000</pubDate><guid>https://time-friend.com/en/archive/gitattributes-bug-from-two-years-ago/</guid><description>&lt;h1 id="cause"&gt;Cause&lt;/h1&gt;
&lt;p&gt;On a whim, I opened a frontend project I wrote two years ago to start code review.
I wrote this project alone for two years, roughly over a hundred thousand lines of code.&lt;/p&gt;
&lt;p&gt;Found that Git in this project recognized all code files as binary files.
This problem had troubled me for a long time, but I couldn&amp;rsquo;t find the cause. This led to my code having no diff history.&lt;/p&gt;</description></item><item><title>Git Case-Insensitive Causing Annoying Problem</title><link>https://time-friend.com/en/archive/git-case-insensitive-issue/</link><pubDate>Wed, 09 Jan 2019 19:33:33 +0000</pubDate><guid>https://time-friend.com/en/archive/git-case-insensitive-issue/</guid><description>&lt;blockquote&gt;
&lt;p&gt;Because a colleague changed a folder name from lowercase to uppercase, I couldn&amp;rsquo;t directly push, rebase and other operations locally. Very annoying~&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;error: The following untracked working tree files would be overwritten by checkout:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; xxx.js
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Please move or remove them before you can switch branches.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Aborting
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="solution"&gt;Solution&lt;/h1&gt;
&lt;p&gt;Set to case-sensitive (must restore configuration after problem is solved)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git config core.ignorecase false
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Although setting case-sensitive will always affect code in other branches, so it&amp;rsquo;s not recommended to use this configuration permanently. After the problem is solved, it should be changed back.&lt;/p&gt;</description></item><item><title>Automated Deployment of Hugo, Hexo Blog with Travis CI</title><link>https://time-friend.com/en/archive/automated-deployment-hugo-hexo-blog-with-travis-ci/</link><pubDate>Tue, 20 Nov 2018 16:14:25 +0000</pubDate><guid>https://time-friend.com/en/archive/automated-deployment-hugo-hexo-blog-with-travis-ci/</guid><description>&lt;h1 id="what-is-travis-ci"&gt;What is Travis CI?&lt;/h1&gt;
&lt;p&gt;Travis CI is an online hosted CI service. Using Travis for continuous integration doesn&amp;rsquo;t require setting up your own server. Most importantly, it&amp;rsquo;s free for open source projects.
If company uses gitlab, it also provides corresponding continuous integration services. Won&amp;rsquo;t elaborate here.&lt;/p&gt;
&lt;h1 id="travis-ci-configuration-file"&gt;Travis CI Configuration File&lt;/h1&gt;
&lt;p&gt;Travis requires project root directory must have a &lt;code&gt;.travis.yml&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;When your repository has commits, travis will automatically execute the behaviors you configured below.&lt;/p&gt;</description></item><item><title>Git Delete All Commit History Solution</title><link>https://time-friend.com/en/archive/git-delete-all-commits-solution/</link><pubDate>Tue, 30 Oct 2018 19:33:33 +0000</pubDate><guid>https://time-friend.com/en/archive/git-delete-all-commits-solution/</guid><description>&lt;p&gt;If your previous project committed some sensitive data, or you want to clear previous commit history, here&amp;rsquo;s the solution.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 1. Check out a new branch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git checkout --orphan latest_branch
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 2. Stage all files&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git add -A
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 3. Commit the staged files&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git commit -am &lt;span style="color:#e6db74"&gt;&amp;#34;commit message&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 4. Delete the original branch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git branch -D master
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 5. Rename the current branch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git branch -m master
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 6. Push your history to the remote repository&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git push -f origin master
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Git Push Stuck Solution</title><link>https://time-friend.com/en/archive/git-push-stuck-solution/</link><pubDate>Mon, 09 Apr 2018 19:33:33 +0000</pubDate><guid>https://time-friend.com/en/archive/git-push-stuck-solution/</guid><description>&lt;p&gt;The blog&amp;rsquo;s daily English is directly scraped from Shanbay English. To avoid directly requesting proxy interfaces (which would be relatively slow).
So my program generates corresponding data files every day, and the frontend directly gets them via ajax.
Blog content is also automatically published every day, achieving the effect of updating famous quotes and sentences daily.
Haven&amp;rsquo;t checked for a long time, found many git commits weren&amp;rsquo;t pushed. After manually pushing, found there were over 800 modifications not pushed.&lt;/p&gt;</description></item><item><title>Git Series - About the Add Command</title><link>https://time-friend.com/en/archive/git-series-about-add-command/</link><pubDate>Sun, 10 Sep 2017 19:33:33 +0000</pubDate><guid>https://time-friend.com/en/archive/git-series-about-add-command/</guid><description>&lt;h2 id="basic-usage"&gt;Basic Usage&lt;/h2&gt;
&lt;p&gt;Usually add &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; to the index library through the form &lt;code&gt;git add &amp;lt;path&amp;gt;&lt;/code&gt;,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; can be a file or a directory:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;git add &amp;lt;path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If there are many changes, you can use the following command to add all changed files at once:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; git add -A .
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add all modifications to the staging area, including new files and edited files, excluding deleted files:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ git add . 
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Means add all content:&lt;/p&gt;</description></item><item><title>Automated Deployment Frontend Code - Using grunt-ftp-deploy</title><link>https://time-friend.com/en/archive/automated-deployment-frontend-code-grunt-ftp-deploy/</link><pubDate>Sun, 14 Jun 2015 23:36:00 +0000</pubDate><guid>https://time-friend.com/en/archive/automated-deployment-frontend-code-grunt-ftp-deploy/</guid><description>&lt;p&gt;Every time after modifying code, need to deploy to remote server, my operation steps are:&lt;/p&gt;
&lt;p&gt;Modify code &amp;ndash;&amp;gt; grunt build &amp;ndash;&amp;gt; Open FileZilla &amp;ndash;&amp;gt; Login ftp server &amp;ndash;&amp;gt; Find local folder &amp;ndash;&amp;gt; Find remote server target folder &amp;ndash;&amp;gt; Select all local files &amp;ndash;&amp;gt; Upload&lt;/p&gt;
&lt;p&gt;Because deploying code, at some times will be particularly frequent. Every time need to repeat the above eight operations. Want to do something, change this.&lt;/p&gt;
&lt;p&gt;Today our protagonist: grunt-ftp-deploy&lt;/p&gt;</description></item><item><title>Annoying AngularJS Annotations - Using grunt-ng-annotate</title><link>https://time-friend.com/en/archive/annoying-angularjs-annotations-grunt-ng-annotate/</link><pubDate>Fri, 12 Jun 2015 23:15:00 +0000</pubDate><guid>https://time-friend.com/en/archive/annoying-angularjs-annotations-grunt-ng-annotate/</guid><description>&lt;p&gt;Angular added dependency injection&lt;/p&gt;
&lt;p&gt;When writing code, roughly written as follows&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;app&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;controller&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;tempController&amp;#39;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;$scope&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;$http&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;$state&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;$timeout&lt;/span&gt;) {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; })
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But such code, after compression will cause a problem.
Function parameters: $scope, $http, $state, $timeout will become: a,b,c,d&lt;/p&gt;
&lt;p&gt;Causing this function cannot find services to inject, because each parameter&amp;rsquo;s naming is strictly required.&lt;/p&gt;
&lt;p&gt;As follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;app&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;controller&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;tempController&amp;#39;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;a&lt;/span&gt;,&lt;span style="color:#a6e22e"&gt;b&lt;/span&gt;,&lt;span style="color:#a6e22e"&gt;c&lt;/span&gt;,&lt;span style="color:#a6e22e"&gt;d&lt;/span&gt;) {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; })
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;!-- more --&gt;
&lt;p&gt;To solve this problem, angular supports the following writing:&lt;/p&gt;</description></item></channel></rss>