your programing

개발 환경 설정을 자동화하는 방법은 무엇입니까?

lovepro 2020. 10. 10. 10:45
반응형

개발 환경 설정을 자동화하는 방법은 무엇입니까?


새로운 개발자가 팀에 합류하거나 개발자가 변경 사항을 사용하는 컴퓨터에 합류 할 때마다 개발자는 현재 프로젝트가 작동하도록 로컬 개발 환경을 설정하기 위해 많은 작업을 수행해야합니다. SCRUM 팀으로서 우리는 배포 및 테스트를 포함한 모든 것을 자동화하려고 노력하고 있으므로 제가 묻고있는 것은 로컬 개발 환경 설정을 자동화 할 수있는 도구 또는 관행이 있습니까?

예를 들어 환경을 설정하려면 먼저 eclipse를 설치 한 다음 SVN, Apache, Tomcat, MySQL, PHP를 설치해야했습니다. 그 후 DB를 채우고 다양한 구성 파일 등을 약간 변경해야했습니다.이 작업을 한 번의 클릭으로 줄일 수있는 방법이 있습니까?


몇 가지 옵션이 있으며 때로는 이들의 조합이 유용합니다.

  • 자동 설치
  • 디스크 이미징
  • 가상화
  • 소스 코드 제어

다양한 옵션에 대한 세부 정보 :

  1. 설치 자동화 된 워크 스테이션의 다양한 서비스, 도구 및 설정 파일의 설치 및 구성을 자동화하기위한 도구 :

    • Puppet 은 학습 곡선이 있지만 강력합니다. 시스템 클래스 (개발 상자, 웹 서버 등)를 정의한 다음 상자를 적절한 상태로 설치, 구성 및 유지하는 데 필요한 작업을 수행합니다. 원 클릭을 요청했지만 Puppet은 기본적으로 제로 클릭입니다. 주기적으로 컴퓨터를 확인하여 원하는대로 구성되어 있는지 확인하기 때문입니다. 파일이나 모드가 변경되면 감지하고 문제를 해결합니다. 나는 현재 이것을 사용하여 소수의 RedHat Linux 상자를 유지 관리하지만 수천 개를 처리 할 수 ​​있습니다. (2009 년 5 월 8 일 현재 Windows를 지원하지 않습니다.)
    • Cfengine 은 또 다른 것입니다. 나는 이것이 RedHat Linux를 사용하는 70 명의 엔지니어가있는 상점에서 성공적으로 사용되는 것을 보았습니다. 그 한계는 Puppet의 이유 중 일부였습니다.
    • SmartFrog 는 호스트 구성을위한 또 다른 도구입니다. Windows를 지원합니다.
    • 쉘 스크립트. RightScale 에는 셸 스크립트를 사용하여 Amazon EC2 이미지를 구성하는 방법의 예가 있습니다.
    • 패키지를 설치합니다. Unix 상자에서는 패키지로이 작업을 완전히 수행 할 수 있으며 Windows에서는 msi가 옵션 일 수 있습니다. 예를 들어 RubyWorks 는 종속성을 통해 다른 패키지를 차례로 설치하는 하나의 패키지를 설치하여 전체 Ruby on Rails 스택을 제공합니다.
  2. 디스크 이미지 물론 다른 호스트로 복원 할 수 있도록 구성된 호스트의 이미지를 저장하는 디스크 이미징 도구있습니다. 가상화와 마찬가지로 이것은 깨끗한 상태로 물건을 복원하는 것이 쉽기 때문에 테스트 박스에 특히 좋습니다. 지속적으로 최신 상태로 유지하는 것은 여전히 ​​문제입니다. 구성 파일 변경 사항을 전파하기 위해 새 이미지를 만드는 것이 가치가 있습니까?

  3. 가상화 는 Xen, VirtualPC 또는 VMWare 이미지를 복사하여 새 호스트를 만드는 것과 같은 또 다른 옵션입니다. 이것은 테스트 박스에서 특히 유용합니다. 테스트가 어떤 엉망이 되어도 깨끗하고 알려진 상태로 쉽게 복원 할 수 있기 때문입니다. 디스크 이미징 도구와 마찬가지로 호스트를 최신 상태로 유지하려면 자동화 된 설치 / 구성 도구를 사용할 때보 다 더 많은 수동 단계와 경계가 필요합니다.

  4. 소스 코드 제어 필요한 도구를 설치 / 구성했으면 빌드를 수행하는 것은 소스 코드 저장소에서 필요한 것을 확인하고 빌드하는 문제 여야합니다.

현재 위의 조합을 사용하여 다음과 같이 프로세스를 자동화합니다.

  • VMWare 게스트에서 베어 본 OS 설치로 시작
  • 셸 스크립트를 실행하여 Puppet을 설치하고 소스 코드 제어에서 해당 구성을 검색합니다.
  • 도구 / 구성 요소 / 구성을 설치하는 Puppet
  • 소스 코드 제어에서 파일을 확인하여 웹 애플리케이션을 빌드하고 배포합니다.

나는이 질문을 우연히 발견했고 아무도 아직 Vagrant 를 언급하지 않았다는 사실에 매우 놀랐습니다 .

방랑자

Pete TerMaat 등이 언급했듯이 가상화는 개발 환경을 관리하고 자동화하는 좋은 방법입니다. Vagrant는 기본적으로 이러한 가상 상자를 설정하는 데 따른 고통을 덜어줍니다.

몇 분 안에 좋아하는 Linux 배포판의 완전히 새로운 복사본을 실행 하여 프로덕션 서버와 똑같은 방식으로 프로비저닝 할 수 있습니다.

PHP, MySQL 등을 설치하기 위해 OSX 또는 Windows와 더 이상 싸우지 않아도됩니다. 모든 소프트웨어는 가상 머신 내에서 살고 실행됩니다. 당신은 vagrant ssh. 실수를하거나 무언가를 부수는 경우에는 그냥 vagrant destroy하고 vagrant up새로 시작하십시오.

Vagrant는 로컬 파일 시스템에 동기화 된 폴더자동으로 생성 하므로 가상 머신 내에서 개발할 필요가 없습니다 (예 : Vim 사용). 원하는 편집기를 사용하십시오.

나는 이제 내가하는 거의 모든 프로젝트에 대해 새로운 "Vagrant box"를 만듭니다. 내 모든 설정은 프로젝트 저장소에 저장되므로 다른 팀원을 쉽게 가져올 수 있습니다. 그들은 단순히 repo를 당겨서 실행하기 만하면 vagrant up말 그대로 갈 준비가 된 것입니다.

또한 소프트웨어 요구 사항이 다른 프로젝트를 훨씬 쉽게 처리 할 수 ​​있습니다. PHP 5.3에 의존하는 프로젝트가 있지만 PHP 5.4를 실행하는 새로운 프로젝트가있을 수 있습니다. 해당 프로젝트에 원하는 버전을 설치하기 만하면됩니다.

확인 해봐!


한 가지 중요한 점은 체크 아웃 후 즉시 빌드, 배포 및 실행할 수 있도록 소스 제어에서 프로젝트를 설정하는 것입니다.

즉, Makefile, ant 빌드 파일 등과 같은 도우미 인프라와 IDE 프로젝트 파일과 같은 도구 설정도 확인해야합니다.

개별 프로젝트의 설정 번거 로움을 처리해야합니다.

기본 컴퓨터 설정의 경우 표준 이미지를 사용할 수 있습니다. 또 다른 옵션은 플랫폼의 도구를 사용하여 설치를 자동화하는 것입니다. Linux에서는 필요한 모든 패키지에 의존하는 메타 패키지를 만들 수 있습니다. Windows에서는 MSI 등을 사용하여 비슷한 일이 가능해야합니다.

편집하다:

이상적으로는 헬퍼 인프라를 체크인하는 대신 빌드 에서 헬퍼 인프라 생성 할 수있는 정보를 체크인합니다 . 이것은 예를 들어 GNU 빌드 시스템 (autotools 등) 또는 Maven이 취하는 접근 방식입니다. 이것은 (이론적으로) 모든 (지원되는) 빌드 환경에 대한 인프라를 생성 할 수 있기 때문에 훨씬 더 우아합니다. 따라서 하나의 특정 IDE에 묶이지 않고 도우미 인프라 (경로 등)의 설정을 복제 할 필요가 없습니다. 주요 프로젝트 설정.

그러나 이것은 또한 더 복잡한 접근 방식이므로 작동하지 않으면 IDE 파일과 같은 항목을 직접 체크인하는 것이 허용됩니다.


I like to use Virtual PC or VMware to virtualize the development environment. This provides a standard "dev environment" that could be shared among developers. You don't have to worry about software that the user could add to their system that may conflict with your development environment. It also provides me a way to work to two projects where the development environments can't both be on one system (using two different versions of a core technology).


Use puppet to configure both your development and production environment. Using a top-notch automation system is the only way to scale your ops.


There's always the option of using virtual machines (see e.g. VMWare Player). Create one environment and copy it over for each new employee with minimal configuration needed.


At a prior place we had everything (and I mean EVERYTHING) in SCM (clearcase then SVN). When a new developer can in they installed ClearCase|SVN and sucked down the repository. This also handles the case when you need to update a particular lib/tool as you can just have the dev teams update their environment.

We used two repo's for this so code and tools/config lived in separate places.


I highly recommend Blueprint from DevStructure. It's open-source and your use case is actually the exact reason we originally wrote the software. Our goals have somewhat changed, but it still is the perfect tool for what you are describing. In short, you can create reusable server configs - dead simple configuration management. I hope this helps!

https://github.com/devstructure/blueprint (Blueprint @ Github)


I've been thinking about this myself. There are some other technologies that you could throw into the mix. Here's what I'm currently setting up:

  • PXE based pre-seeded installation images (Debian Squeeze). You can start up a bare-metal machine (or new virtual appliance) and select the image from the PXE boot menu. This has the major advantage of being able to install your environment on physical machines (in addition to virtual appliances).
  • Someone already mentioned Puppet. I use CFEngine but it's a similar deal. Essentially your configuration is documented and centralized in policy files which are continually enforced by an agent on the client.
  • if you don't want a rigid environment (i.e. developers may choose a combination of tool-sets) you can roll your own deb packages so new devs can type sudo apt-get install acmecorp-eclipse-env or sudo apt-get install acmecorp-intellij-env, for example.
  • Slightly off-topic, but if you run a Debian based environment (i.e. Ubuntu), consider installing apt-cacher (package proxy). In addition to saving bandwidth, it will make your installations much faster (since packages are cached on your local network).

If you're using OSX and working with Rails. I'd suggest either:


If you use machines in a standard configuration, you can image the disk with a fresh perfectly configured install -- that's a very popular approach in many corporations (and not just for developers, either). If you need separately configured OS's, you can tar-bz2 all the added and changed files once a configured OS is turned into your desired setup, and just untar it as root to make your desired environment from scratch.


if you're using a linux flavor, you've probably got a package management system: thinks .rpm for fedora/redhat, or .deb for ubuntu/debian. many of the things you describe already have packages available: svn, eclipse, etc. you could roll your own packages for company specific software, create a repository (perhaps only available on the local network) and then your setup could be reduced to a single bash script which would add the company repo to /etc/apt/sources.list (debian/ubuntu) and then call a command like,


/home/newhire$ apt-get update && apt-get install some complete package list

you could use buildbot to then automate regular builds for company packages that change often.


http://nsnihalsahu.github.io/devscript 에서 DevScript를 사용해보세요 . , devscript lamp또는 devscript laravel또는 같은 하나의 명령 devscript django. 인터넷 공동 속도에 따라 약 몇 분 안에

참고 URL : https://stackoverflow.com/questions/839360/how-to-automate-development-environment-setup

반응형