Skip to content

Commit 41e8092

Browse files
author
garfielddai
committed
Initial commit
0 parents  commit 41e8092

File tree

1,130 files changed

+19313
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,130 files changed

+19313
-0
lines changed

Jenkinsfile_coding_demo_build

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pipeline {
2+
agent any
3+
stages {
4+
stage('检出') {
5+
steps {
6+
checkout([$class: "GitSCM", branches: [[name: env.GIT_BUILD_REF]],
7+
userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]])
8+
}
9+
}
10+
stage('构建') {
11+
steps {
12+
sh 'git archive --format zip --prefix ${DEPOT_NAME}/ --output "${DEPOT_NAME}.zip" ${GIT_COMMIT}'
13+
archiveArtifacts(artifacts: '*.zip', allowEmptyArchive: true)
14+
codingArtifactsGeneric(files: "${DEPOT_NAME}.zip", repoURL: "${ARTIFACT_URL}", credentialsId: "${ARTIFACT_CREDENTIALS_ID}", withBuildProps: true, version: "${GIT_COMMIT}")
15+
}
16+
}
17+
}
18+
}

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### 欢迎体验 CODING DevOps 引导流程👏👏
2+
3+
##### CODING 在此项目中放置了一大小为 76.96 MB 的代码仓库,同时也在 Github 中放置了大小及文件数完全相同的代码仓库,您可以尝试分别克隆 CODING 及 Github 的代码仓库,感受不同的速度差异。
4+
![图片](https://coding-net-production-file-ci.codehub.cn/3cedb0e0-fefe-11ea-b7c6-479edf7bcd61.gif?sign=iyFSH6xqv0CN4WQtrxePHI6IDedhPTEyNTcyNDI1OTkmaz1BS0lEYXk4M2xGbWFTNlk0TFRkek1WTzFTZFpPeUpTTk9ZcHImZT0xNjAxMjQyNzc1JnQ9MTYwMTAyNjc3NSZyPTQzNDA5NzYyJmY9LzNjZWRiMGUwLWZlZmUtMTFlYS1iN2M2LTQ3OWVkZjdiY2Q2MS5naWYmYj1jb2RpbmctbmV0LXByb2R1Y3Rpb24tZmlsZQ==)
5+
6+
- 克隆 CODING 仓库:``` git clone https://e.coding.net/codingcorp/git-scm-coding/git-scm.git```
7+
- 克隆 Github 仓库:``` git clone https://github.com/Coding/git-scm.git```

git-scm.com/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
API_USER=
2+
API_PASS=

git-scm.com/.gemset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git-scm

git-scm.com/.github/ISSUE_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Please ONLY submit issues related to the git-scm Website (e.g. website-specific content, JS, or CSS that doesn't seem to be doing its job correctly) !
2+
3+
Make sure this is NOT an issue about :
4+
5+
- the Git documentation (a.k.a. man/help pages, i.e. anything with a URL starting with https://git-scm.com/docs), which should be raised with the community at https://git-scm.com/community,
6+
- the contents of the Pro Git book (i.e. anything with a URL starting with https://git-scm.com/book or its PDF versions), which should be raised at https://github.com/progit/progit2/issues.
7+
- Git itself, which should also be raised with the community at https://git-scm.com/community, or
8+
- Git for Windows, which should be raised at https://github.com/git-for-windows/git.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: 'Downloads on git-scm not working'
3+
about: 'If you are experiencing problems downloading git from git-scm.com'
4+
---
5+
6+
<!---
7+
Please follow the instructions below.
8+
An issue properly explained is solved much faster!
9+
10+
* If you are experiencing problems/questions/bugs with git itself, start a discussion on the [community mailing list](https://git-scm.com/community).
11+
* If you are experiencing problems on your git for windows program, please open an issue at [git-for-windows/git](https://github.com/git-for-windows/git).
12+
* Please open Git documentation (a.k.a. man/help pages, i.e. anything with a URL starting with `https://git-scm.com/docs`) specific issues with the [community](https://git-scm.com/community),
13+
* Please open Pro Git book contents issues (i.e. anything with a URL starting with `https://git-scm.com/book` or its PDF versions) at [progit/progit2](https://github.com/progit/progit2/issues).
14+
15+
-->
16+
17+
<!--- Provide a brief summary of the issue in the title above -->
18+
19+
### Which download is failing?
20+
<!--- Tell us in which page and version is the download broken -->
21+
22+
### Problem
23+
<!--- Tell us the problem as clear as possible -->
24+
25+
### Context
26+
<!--- Which operating system and browser are you using? -->
27+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
28+
29+
### Steps to Reproduce
30+
<!--- Provide a detailed list of steps. -->
31+
<!--- In the rare cases where this is infeasible, we will also accept a detailed set of instructions. -->
32+
33+
### Other details
34+
<!--- Include as many relevant details you may find relevant -->
35+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: 'git-scm UI broken'
3+
about: 'git-scm.com UI is not working'
4+
---
5+
6+
<!---
7+
Please follow the instructions below.
8+
An issue properly explained is solved much faster!
9+
10+
* If you are experiencing problems/questions/bugs with git itself, start a discussion on the [community mailing list](https://git-scm.com/community).
11+
* If you are experiencing problems on your git for windows program, please open an issue at [git-for-windows/git](https://github.com/git-for-windows/git).
12+
* Please open Git documentation (a.k.a. man/help pages, i.e. anything with a URL starting with `https://git-scm.com/docs`) specific issues with the [community](https://git-scm.com/community),
13+
* Please open Pro Git book contents issues (i.e. anything with a URL starting with `https://git-scm.com/book` or its PDF versions) at [progit/progit2](https://github.com/progit/progit2/issues).
14+
15+
-->
16+
17+
<!--- Provide a brief summary of the issue in the title above -->
18+
19+
### URL for broken page
20+
<!--- Tell us in which page is the website broken -->
21+
22+
### Problem
23+
<!--- Tell us the problem as clear as possible -->
24+
25+
### Context
26+
<!--- Which operating system and browser are you using? -->
27+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
28+
29+
### Steps to Reproduce
30+
<!--- Provide a detailed list of steps. -->
31+
<!--- In the rare cases where this is infeasible, we will also accept a detailed set of instructions. -->
32+
33+
### Other details
34+
<!--- Include as many relevant details you may find relevant -->
35+

git-scm.com/.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile ~/.gitignore_global
6+
7+
.env
8+
9+
# Ignore bundler config
10+
/.bundle
11+
/vendor/gems
12+
13+
# Ignore the default SQLite database.
14+
/db/*.sqlite3*
15+
16+
# Ignore all logfiles and tempfiles.
17+
/log/*.log
18+
/tmp
19+
.sass-cache/
20+
21+
.DS_Store
22+
23+
#Ignore vim swpfiles
24+
*.swp
25+
*.swo
26+
27+
/public/*.zip
28+
29+
node_modules/
30+
31+
# Ignore byebug history
32+
.byebug_history
33+
34+
# RSpec
35+
spec/examples.txt

git-scm.com/.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--require spec_helper

git-scm.com/.rubocop.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
inherit_gem:
2+
rubocop-github:
3+
- config/default.yml
4+
- config/rails.yml
5+
6+
AllCops:
7+
TargetRubyVersion: 2.4
8+
9+
Performance:
10+
enabled: true
11+
12+
Style/FrozenStringLiteralComment:
13+
Exclude:
14+
- db/schema.rb

git-scm.com/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.4.2

git-scm.com/.stylelintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"stylelint-config-primer"
4+
]
5+
}

git-scm.com/.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: ruby
2+
3+
sudo: false
4+
5+
before_script:
6+
- bundle exec rake db:create db:schema:load
7+
8+
bundler_args: --without development production --jobs=3 --retry=3
9+
10+
cache:
11+
bundler: true
12+
13+
notifications:
14+
email: false
15+
16+
script:
17+
- bundle exec rubocop -P
18+
- bundle exec rspec

git-scm.com/ARCHITECTURE.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# git-scm.com architecture
2+
3+
This document describes the general setup and architecture that runs the
4+
git-scm.com site. The idea is to document all the moving parts that
5+
_aren't_ checked in to this repository. That may help new people joining
6+
the project to help out, as well provide some continuity in case the
7+
maintainer is hit by a bus.
8+
9+
## Content
10+
11+
Though the site is a rails app, it can _mostly_ be thought of a serving
12+
static content. It's just that we suck in that static content and
13+
pre-process it using nightly scheduled jobs. We never write anything to
14+
the database on behalf of user requests.
15+
16+
The content is a mix of:
17+
18+
- actual static content in this repository
19+
20+
- community book content brought in from https://github.com/progit;
21+
see the `lib/tasks/book2.rake` file.
22+
23+
- manpages from releases of the git project, imported and formatted
24+
via asciidoctor; see the `lib/tasks/index.rake` task.
25+
26+
27+
## Heroku
28+
29+
The app itself is served by Heroku. The app name is `git-scm` (so you
30+
can visit it directly as https://git-scm.herokuapp.com). The site is
31+
owned by the git-scm.com team. If you want to be involved in managing
32+
uptime/deploys/etc, you'll need a Heroku account and request to be added
33+
to that team. The git-scm team receives credits from Heroku so that the
34+
hosting is free.
35+
36+
We use a few Heroku add-ons:
37+
38+
- Bonsai elasticsearch (see below)
39+
40+
- Heroku Postgres as the database
41+
42+
- Heroku Redis for rails caching
43+
44+
- Heroku scheduler for cron jobs
45+
46+
The nightly scheduled jobs are:
47+
48+
- `rake downloads` (pick up newly released git versions)
49+
50+
- `rake preindex` (pull in and format manpages for released git
51+
versions)
52+
53+
- `rake remote_genbook2` (pull in and format progit2 book content,
54+
including translations)
55+
56+
It should be safe to run any of those jobs more frequently. E.g., if you
57+
know there's a new Git release out, then:
58+
59+
heroku run rake preindex
60+
heroku run rake downloads
61+
62+
will get it on the site without waiting for the nightly run.
63+
64+
Merges to the `master` branch on GitHub auto-deploy to Heroku, so unless
65+
you're doing something tricky you generally shouldn't need to manually
66+
deploy.
67+
68+
Note that some of the formatting of manpages and book content happens
69+
when they are imported by the rake tasks. So after fixing some
70+
formatting and deploying, the rake jobs may need to be re-run with a
71+
special flag to re-import (see the individual tasks for details).
72+
73+
74+
## Cloudflare
75+
76+
We get enough requests that it's easy to overwhelm the single Heroku
77+
dyno. So we have Cloudflare sitting in front of it, aggressively caching
78+
everything. That also should make the site faster to serve to regions
79+
far away from Heroku's servers.
80+
81+
The Cloudflare setup is mostly pretty simple:
82+
83+
- they serve DNS for the whole domain (that's where they insert the CDN
84+
magic)
85+
86+
- Cloudflare provides `https://` support to the user. Obviously the
87+
site is totally open and doesn't have any sensitive data, so this is
88+
really more about integrity. The certificate is generated by
89+
Cloudflare (and requires SNI on the browser side).
90+
91+
- the Cloudflare connection to Heroku is passed over TLS; they provide an
92+
"internal" certificate that we ask Heroku to use, so the connection
93+
is secured between the two (again, mostly for integrity)
94+
95+
- the most exotic config is that we use "page rules" to mark the whole
96+
site to be cached aggressively, regardless of any caching headers
97+
sent from Heroku. This is a bit of a hack, but there's very little on
98+
the site that can't be cached (which is perhaps a sign that the rails
99+
setup needs to be tweaked to send more reasonable caching headers,
100+
but this has been simple and effective so far).
101+
102+
There are a few special page rules to lift this caching for cases
103+
where we do server-side logic (e.g.,
104+
https://github.com/git/git-scm.com/issues/1129#issuecomment-363067019"),
105+
but the long-term goal is to push that logic onto the client side as
106+
much as possible.
107+
108+
Both domains (c.f., the section on [DNS](#DNS) below) are owned by a
109+
Cloudflare "Team", and membership of that team is required to
110+
administrate the domains. Similar to the Heroku setup, you can ask to
111+
join this team if you wish to help out. The information about the team
112+
setup is in escrow with the Git PLC at Software Freedom Conservancy.
113+
Cloudflare provides the project with enough credits that it doesn't cost
114+
anything (though we're not using very many features, so it's possible
115+
that a free account would be sufficient, too).
116+
117+
## Bonsai Elasticsearch
118+
119+
The search functionality on the site is served by an elasticsearch
120+
cluster. The index can be populated by running `rake search_index`
121+
(manpages) and `rake search_index_book` (book) on Heroku (we only index
122+
the manpages and book). This perhaps should be run nightly, or at least
123+
after pulling in new content, but it currently isn't done automatically.
124+
125+
The elasticsearch cluster is provided by Bonsai via their Heroku plugin.
126+
Our needs are larger than their free tier provides, but we receive
127+
credits from them that provide the service for free.
128+
129+
130+
## DNS
131+
132+
The actual DNS service is provided by Cloudflare (see above). The domain
133+
itself is registered with Gandi, and is owned by the project via
134+
Software Freedom Conservancy. Funds for the registration are provided
135+
from the Git project's Conservancy funds, and both the Git PLC and
136+
Conservancy have credentials to modify the setup.
137+
138+
Note that we own both git-scm.com and git-scm.org; the latter redirects
139+
to the former.
140+
141+
142+
## Manual Intervention
143+
144+
The site mostly just runs without intervention:
145+
146+
- code merged to `master` is auto-deployed
147+
148+
- new git versions are detected daily and manpages and download links
149+
updated
150+
151+
- book updates (including translations) are picked up daily
152+
153+
There are a few tasks that still need to be handled by a human:
154+
155+
- new images added to the book have to be copied manually from
156+
progit/progit2
157+
158+
- new languages for book translations need to be added to
159+
`lib/tasks/book2.rake`
160+
161+
- forced re-imports of content (e.g., a formatting fix to imported
162+
manpages) must be triggered manually

0 commit comments

Comments
 (0)