Windows에서 CodeArtifact(Maven)용 토큰을 자동으로 생성하는 방법
3612 단어 codeartifactwindowsmavenaws
잠시 후 사용자 변수를 생성하여 작업을 단순화할 수 있는 PowerShell 스크립트를 생각해 냈습니다.
$AWS_ACCOUNT_ID='ID'
$DOMAIN='CODE_ARTIFACT_DOMAIN'
$env:CODEARTIFACT_AUTH_TOKEN = aws codeartifact get-authorization-token --domain $DOMAIN --domain-owner $AWS_USER_ACCOUNT --query authorizationToken --output text
다음 두 변수만 수정하면 됩니다.
$AWS_ACCOUNT_ID, 여기에서 가져옵니다:

$DOMAIN, 여기에서 가져옵니다:

그런 다음 스크립트를 .ps1 파일로 저장하고 다음 명령을 사용하여 PowerShell에서 실행할 수 있습니다.
powershell -ExecutionPolicy Bypass -File "MY_PATH\UpdateTokenNoAdmin.ps1"
MY_PATH는 파일을 저장한 위치를 나타냅니다.
마지막 부분은 매일 재생을 자동화하는 것입니다. 이를 위해 작업 스케줄러를 사용할 것입니다.

첫 번째 단계는 새 작업을 생성하는 것입니다.

그런 다음 이름을 지정합니다.

다음으로 트리거를 구성합니다(저는 로그온할 때를 선호하지만 매일 가능합니다).

마지막으로 이전 명령을 기반으로 새 작업을 추가합니다.
powershell -ExecutionPolicy Bypass -File "MY_PATH\UpdateTokenNoAdmin.ps1"

이제 환경 변수(CODEARTIFACT_AUTH_TOKEN)가 자동 생성됩니다!
나를 팔로우하세요:
링크드인
유튜브
인스 타 그램
사이버 예언자
당신의 이야기를 공유




배너 크레딧:
AWS
Reference
이 문제에 관하여(Windows에서 CodeArtifact(Maven)용 토큰을 자동으로 생성하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/fanmixco/automatic-token-generation-for-maven-in-codeartifact-in-windows-15k6텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)