团队协作
@ 姜波 | 星期六,三月 21 日,2020 年 | 2 分钟阅读 | 更新于 星期六,三月 21 日,2020 年

文档管理

markdown

  • typora

ShowDoc搭建

docker pull star7th/showdoc
mkdir /showdoc_data
mkdir /showdoc_data/html
chmod -R 777 /showdoc_data/
docker run -d --restart=always --name showdoc_test -p 20090:80 -v /showdoc_data/html/:/var/www/html/ star7th/showdoc
docker exec showdoc_test \cp -fr /showdoc_data/html/ /var/www
chmod -R 777 /showdoc_data/

云笔记

  • oneNote

个人博客hexo

npm install hexo-cli -g
hexo init blog
cd blog
npm install
hexo server

npm install hexo-deployer-git --save
ssh-keygen -t rsa -b 4096 -c '197463061@qq.com'// 生成密钥
_config.yml
deploy:
  type: git
  repo: git@github.com:WilberJiang/WilberJiang.github.io.git
  branch: master
  name: WilberJiang
  email: 197463061@qq.com
hexo g //产生静态文件
hexo d //部署

版本管理

版本1.2.3-beta

  • 1-主版本
  • 2-次版本
  • 3-修订号
  • alpha-内部测试版
  • beta-公测版
  • rc-发行候选版
  • release-发行版

git ssh

ssh-keygen -t rsa -b 4096 -c '197463061@qq.com'

工作区

  • git clone
  • git init
  • git add
  • git fetch
  • git pull/push
  • git checkout
  • git log/reflog
  • git config/status
    • git config –global –list
    • git config –global user.name ‘wilber’

暂存区

  • git reset
  • git checkout
  • git stash&apply
    • git stash
    • git stash list
    • git stash pop
    • git stash apply 0
  • git rm
  • git status

本地仓库

  • git branch
  • git merge
  • git diff
  • git remote
  • git rebase
  • git reset

gitlab搭建

docker-compose.yml
version: '2'

services:
  redis:
    restart: always
    image: sameersbn/redis:4.0.9-2
    command:
    - --loglevel warning
    volumes:
    - redis-data:/var/lib/redis:Z

  postgresql:
    restart: always
    image: sameersbn/postgresql:10-2
    volumes:
    - postgresql-data:/var/lib/postgresql:Z
    environment:
    - DB_USER=gitlab
    - DB_PASS=password
    - DB_NAME=gitlabhq_production
    - DB_EXTENSION=pg_trgm

  gitlab:
    restart: always
    image: sameersbn/gitlab:12.9.2
    depends_on:
    - redis
    - postgresql
    ports:
    - "13800:80"
    - "13822:22"
    volumes:
    - gitlab-data:/home/git/data:Z
    environment:
    - DEBUG=false

    - DB_ADAPTER=postgresql
    - DB_HOST=postgresql
    - DB_PORT=5432
    - DB_USER=gitlab
    - DB_PASS=password
    - DB_NAME=gitlabhq_production

    - REDIS_HOST=redis
    - REDIS_PORT=6379

    - TZ=Asia/Kolkata
    - GITLAB_TIMEZONE=Kolkata

    - GITLAB_HTTPS=false
    - SSL_SELF_SIGNED=false

    - GITLAB_HOST=120.76.99.172
    - GITLAB_PORT=13800
    - GITLAB_SSH_PORT=13822
    - GITLAB_RELATIVE_URL_ROOT=
    - GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alphanumeric-string
    - GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alphanumeric-string
    - GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alphanumeric-string

    - GITLAB_ROOT_PASSWORD=jb900801
    - GITLAB_ROOT_EMAIL=197463061@qq.com

    - GITLAB_NOTIFY_ON_BROKEN_BUILDS=true
    - GITLAB_NOTIFY_PUSHER=false

    - GITLAB_EMAIL=notifications@example.com
    - GITLAB_EMAIL_REPLY_TO=noreply@example.com
    - GITLAB_INCOMING_EMAIL_ADDRESS=reply@example.com

    - GITLAB_BACKUP_SCHEDULE=daily
    - GITLAB_BACKUP_TIME=01:00
		- GITLAB_BACKUP_EXPIRY=604800

    - SMTP_ENABLED=false
    - SMTP_DOMAIN=www.example.com
    - SMTP_HOST=smtp.gmail.com
    - SMTP_PORT=587
    - SMTP_USER=mailer@example.com
    - SMTP_PASS=password
    - SMTP_STARTTLS=true
    - SMTP_AUTHENTICATION=login

    - IMAP_ENABLED=false
    - IMAP_HOST=imap.gmail.com
    - IMAP_PORT=993
    - IMAP_USER=mailer@example.com
    - IMAP_PASS=password
    - IMAP_SSL=true
    - IMAP_STARTTLS=false

    - OAUTH_ENABLED=false
    - OAUTH_AUTO_SIGN_IN_WITH_PROVIDER=
    - OAUTH_ALLOW_SSO=
    - OAUTH_BLOCK_AUTO_CREATED_USERS=true
    - OAUTH_AUTO_LINK_LDAP_USER=false
    - OAUTH_AUTO_LINK_SAML_USER=false
    - OAUTH_EXTERNAL_PROVIDERS=

    - OAUTH_CAS3_LABEL=cas3
    - OAUTH_CAS3_SERVER=
    - OAUTH_CAS3_DISABLE_SSL_VERIFICATION=false
    - OAUTH_CAS3_LOGIN_URL=/cas/login
    - OAUTH_CAS3_VALIDATE_URL=/cas/p3/serviceValidate
    - OAUTH_CAS3_LOGOUT_URL=/cas/logout

    - OAUTH_GOOGLE_API_KEY=
    - OAUTH_GOOGLE_APP_SECRET=
    - OAUTH_GOOGLE_RESTRICT_DOMAIN=

    - OAUTH_FACEBOOK_API_KEY=
    - OAUTH_FACEBOOK_APP_SECRET=

    - OAUTH_TWITTER_API_KEY=
    - OAUTH_TWITTER_APP_SECRET=

    - OAUTH_GITHUB_API_KEY=
    - OAUTH_GITHUB_APP_SECRET=
    - OAUTH_GITHUB_URL=
    - OAUTH_GITHUB_VERIFY_SSL=

    - OAUTH_GITLAB_API_KEY=
    - OAUTH_GITLAB_APP_SECRET=

    - OAUTH_BITBUCKET_API_KEY=
    - OAUTH_BITBUCKET_APP_SECRET=

    - OAUTH_SAML_ASSERTION_CONSUMER_SERVICE_URL=
    - OAUTH_SAML_IDP_CERT_FINGERPRINT=
    - OAUTH_SAML_IDP_SSO_TARGET_URL=
    - OAUTH_SAML_ISSUER=
    - OAUTH_SAML_LABEL="Our SAML Provider"
    - OAUTH_SAML_NAME_IDENTIFIER_FORMAT=urn:oasis:names:tc:SAML:2.0:nameid-format:transient
    - OAUTH_SAML_GROUPS_ATTRIBUTE=
    - OAUTH_SAML_EXTERNAL_GROUPS=
    - OAUTH_SAML_ATTRIBUTE_STATEMENTS_EMAIL=
    - OAUTH_SAML_ATTRIBUTE_STATEMENTS_NAME=
    - OAUTH_SAML_ATTRIBUTE_STATEMENTS_USERNAME=
    - OAUTH_SAML_ATTRIBUTE_STATEMENTS_FIRST_NAME=
    - OAUTH_SAML_ATTRIBUTE_STATEMENTS_LAST_NAME=

    - OAUTH_CROWD_SERVER_URL=
    - OAUTH_CROWD_APP_NAME=
    - OAUTH_CROWD_APP_PASSWORD=

    - OAUTH_AUTH0_CLIENT_ID=
    - OAUTH_AUTH0_CLIENT_SECRET=
    - OAUTH_AUTH0_DOMAIN=
    - OAUTH_AUTH0_SCOPE=

    - OAUTH_AZURE_API_KEY=
    - OAUTH_AZURE_API_SECRET=
    - OAUTH_AZURE_TENANT_ID=

volumes:
  redis-data:
  postgresql-data:
  gitlab-data:
  
docker-compose up -d
docker logs -f
docker-compose run --rm gitlab app:rake gitlab:backup:create // 手动备份
docker-compose run --rm gitlab app:rake gitlab:backup:restore // 查看备份
docker-compose run --rm gitlab app:rake gitlab:backup:restore BACKUP=1417624827.tar // 恢复备份

gitignore

git rm --cached -r .

缺陷控制

缺陷管理工具

  • 工具类

    • trello
    • teambition
  • 流程类

    • jira
    • 禅道
    • redmine
  • 代码类

    • ESLint
    • JSLint
    • StyleLint

ESLint

npm install eslint --save-dev
vscode eslint插件// setting auto save
npx eslint --init

vscode插件配置-Settings Sync

  • Gist ID: 3defb19cd4f9b9d4f12d85dd74117de8
  • Eslint-plugin-vue

自动化

持续集成CI/持续部署CD

  • CircleCI
  • TravisCI
  • Jenkins

Jenkins搭建

cd /home/
mkdir jenkins
cd jenkins/

docker-compose.yml
version: "3"
services:
  jenkins:
		container_name: "jenkins"
		image: jenkins/jenkins:lts
    restart: always
    user: jenkins:994
    ports:
		- 10050:8080
		- 11100:50000
		- 10051:10051
    volumes:
    - /home/jenkins/data:/var/jenkins_home
    - /usr/bin/docker:/usr/bin/docker
		- /var/run/docker.sock:/var/run/docker.sock
chmod -R 777 /home/jenkins/data/  // 用户权限
docker-compose up -d
//或者docker run --name jenkins_demo -itd -p 10050:8080 -p 11100:50000 jenkins/jenkins:lts

保存docker容器数据

docker ps | grep jenkins
docker commit <id> jenkins:1.0
docker run -itd -v /tmp:/tmp jenkins:1.0
docker exec -it <jenkins:1.0容器名称> cp -r /home/jenkins /tmp

jenkins权限管理

  • PAM Authentication
  • Matrix Authorization Strategy
  • Role-based Authorization Strategy
  • LDAP
  • Gitlab Authentication
  • GitHub

公众号

Image text

QQ

Image text

微信

Image text

微信打赏

Image text

社交链接