보충 인자와 설정
보충 인자와 설정
GitHub Actions Importer에는 마이그레이션 과정을 목적에 맞게 조정하기 위한 여러 보충 인자와 설정이 있어요. 마이그레이션을 더 세밀하게 제어하고 싶을 때 필요한 내용이에요.
출처: 문서
본문
GitHub Actions Importer에는 마이그레이션 과정을 목적에 맞게 조정하기 위한 여러 보충 인자와 설정이 있습니다.
이 문서는 선택적 파라미터, 경로 인자, 네트워크 설정 같은 GitHub Actions Importer의 보충 인자와 설정을 구성하는 일반적인 정보를 제공합니다.
선택적 파라미터
GitHub Actions Importer에는 마이그레이션 과정을 사용자 지정하는 데 사용할 수 있는 여러 선택적 파라미터가 있습니다.
허용되는 액션 제한하기
다음 옵션은 변환된 워크플로에서 허용되는 액션을 제한하는 데 사용할 수 있습니다. 조합해서 사용하면 허용되는 액션 목록이 확장됩니다. 이 옵션 중 아무것도 제공하지 않으면 모든 액션이 허용됩니다.
-
--allowed-actions는 변환된 워크플로에서 허용할 액션 목록을 지정합니다. 와일드카드가 지원됩니다. 제공된 것 외의 다른 액션은 허용되지 않습니다.예를 들어:
--allowed-actions actions/checkout@v6 actions/upload-artifact@* my-org/*빈 목록을 제공해서 모든 액션을 허용하지 않을 수 있습니다. 예를 들어
--allowed-actions=. -
--allow-verified-actions는 검증된 작성자의 모든 액션이 허용되도록 지정합니다. -
--allow-github-created-actions는github또는actions조직에서 게시된 액션이 허용되도록 지정합니다.예를 들어 이러한 액션에는
github/super-linter와actions/checkout이 포함됩니다.이 옵션은
--allowed-actions actions/* github/*와 동일합니다.
인증용 자격 증명 파일 사용하기
--credentials-file 파라미터는 GitHub Actions Importer가 인증할 수 있는 서로 다른 서버에 대한 자격 증명이 들어 있는 파일의 경로를 지정합니다. 이는 빌드 스크립트(예: .travis.yml 또는 jenkinsfile)가 여러 GitHub Enterprise Server 인스턴스에 저장된 경우에 유용합니다.
자격 증명 파일은 서버와 액세스 토큰 조합의 목록을 포함하는 YAML 파일이어야 합니다. GitHub Actions Importer는 이루어지는 네트워크 요청에 가장 근접하게 일치하는 URL에 대한 자격 증명을 사용합니다.
예를 들어:
- url: https://github.com
access_token: «redacted:ghp_…»
- url: https://github.com/specific_org/
access_token: «redacted:ghp_…»
- url: https://jenkins.org
access_token: abc123
username: marty_mcfly
위 자격 증명 파일에서 GitHub Actions Importer는 specific_org 조직의 저장소에 대한 네트워크 요청이 아닌 https://github.com에 대한 모든 네트워크 요청을 인증하는 데 액세스 토큰 «redacted:ghp_…»을 사용합니다. 그 경우에는 대신 «redacted:ghp_…» 토큰이 인증에 사용됩니다.
대체 소스 코드 공급자
GitHub Actions Importer는 GitHub가 아닌 저장소에서 소스 코드를 자동으로 가져올 수 있습니다. 자격 증명 파일은 provider, 공급자 URL, 그리고 소스 코드를 가져오는 데 필요한 자격 증명을 지정할 수 있습니다.
예를 들어:
- url: https://gitlab.com
access_token: super_secret_token
provider: gitlab
위 예시에서 GitHub Actions Importer는 https://gitlab.com에 호스팅된 소스 코드를 가져오는 데 super_secret_token 토큰을 사용합니다.
provider에 대해 지원되는 값은 다음과 같습니다:
github(기본값)gitlabbitbucket_serverazure_devops
선택적 기능 제어하기
--features 옵션을 사용해서 GitHub Actions Importer가 만드는 워크플로에서 사용되는 기능을 제한할 수 있습니다. 이는 더 오래된 GitHub Enterprise Server 인스턴스로 마이그레이션할 때 워크플로에서 최신 GitHub Actions 구문을 제외하는 데 유용합니다. --features 옵션을 사용할 때는 마이그레이션 대상 GitHub Enterprise Server의 버전을 지정해야 합니다.
예를 들어:
gh actions-importer dry-run ... --features ghes-3.3
--features에 대해 지원되는 값은 다음과 같습니다:
all(기본값)ghes-latestghes-<number>, 여기서<number>는 GitHub Enterprise Server의 버전으로3.0이상입니다. 예를 들어ghes-3.3.
GitHub Actions Importer가 사용할 수 있는 기능 플래그 목록은 list-features 명령을 실행해서 볼 수 있습니다. 예를 들어:
gh actions-importer list-features
다음과 비슷한 출력이 표시되어야 합니다.
Available feature flags:
actions/cache (disabled):
Control usage of actions/cache inside of workflows. Outputs a comment if not enabled.
GitHub Enterprise Server >= ghes-3.5 required.
composite-actions (enabled):
Minimizes resulting workflow complexity through the use of composite actions. See https://docs.github.com/en/actions/creating-actions/creating-a-composite-action for more information.
GitHub Enterprise Server >= ghes-3.4 required.
reusable-workflows (disabled):
Avoid duplication by re-using existing workflows. See https://docs.github.com/en/actions/using-workflows/reusing-workflows for more information.
GitHub Enterprise Server >= ghes-3.4 required.
workflow-concurrency-option-allowed (enabled):
Allows the use of the `concurrency` option in workflows. See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency for more information.
GitHub Enterprise Server >= ghes-3.2 required.
Enable features by passing --enable-features feature-1 feature-2
Disable features by passing --disable-features feature-1 feature-2
기능 플래그를 전환하려면 다음 방법 중 하나를 사용할 수 있습니다:
gh actions-importer명령을 실행할 때--enable-features와--disable-features옵션을 사용합니다.- 각 기능 플래그에 대해 환경 변수를 사용합니다.
--enable-features와 --disable-features 옵션을 사용해서 명령 기간 동안 활성화하거나 비활성화할 특정 기능을 선택할 수 있습니다.
예를 들어 다음 명령은 actions/cache와 composite-actions의 사용을 비활성화합니다:
gh actions-importer dry-run ... --disable-features=composite-actions actions/cache
configure --features 명령을 사용해서 기능 플래그를 대화형으로 구성하고 환경에 자동으로 기록할 수 있습니다:
$ gh actions-importer configure --features
✔ Which features would you like to configure?: actions/cache, reusable-workflows
✔ actions/cache (disabled): Enable
? reusable-workflows (disabled):
› Enable
Disable
네트워크 응답 캐싱 비활성화하기
기본적으로 GitHub Actions Importer는 네트워크 요청의 응답을 캐싱해서 네트워크 부하와 실행 시간을 줄입니다. --no-http-cache 옵션을 사용해서 네트워크 캐시를 비활성화할 수 있습니다. 예를 들어:
gh actions-importer forecast ... --no-http-cache
경로 인자
GitHub Actions Importer를 실행할 때 경로 인자는 컨테이너의 디스크에 상대적이므로, 컨테이너의 호스트 머신에 상대적인 절대 경로는 지원되지 않습니다. GitHub Actions Importer가 실행되면 컨테이너의 /data 디렉터리가 GitHub Actions Importer가 실행되는 디렉터리에 마운트됩니다.
예를 들어 다음 명령은 /Users/mona 디렉터리에서 사용될 때 GitHub Actions Importer 감사 요약을 /Users/mona/out 디렉터리에 출력합니다:
gh actions-importer audit --output-dir /data/out
프록시 사용하기
HTTP 프록시로 구성된 서버에 접근하려면 프록시의 URL과 함께 다음 환경 변수를 설정해야 합니다:
OCTOKIT_PROXY: 모든 GitHub 서버용.HTTP_PROXY(또는HTTPS_PROXY): 다른 모든 서버용.
예를 들어:
export OCTOKIT_PROXY=https://proxy.example.com:8443
export HTTPS_PROXY=$OCTOKIT_PROXY
프록시에 인증이 필요하면 프록시 URL에 사용자 이름과 비밀번호가 포함되어야 합니다. 예를 들어 https://username:[email protected]:port.
SSL 인증서 검증 비활성화하기
기본적으로 GitHub Actions Importer는 네트워크 요청을 할 때 SSL 인증서를 검증합니다. --no-ssl-verify 옵션으로 SSL 인증서 검증을 비활성화할 수 있습니다. 예를 들어:
gh actions-importer audit --output-dir ./output --no-ssl-verify
법적 고지
일부 내용은 MIT 라이선스에 따라 https://github.com/github/gh-actions-importer/에서 각색되었습니다:
MIT License
Copyright (c) 2022 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.