Artifact Registry์ Go ๋ชจ๋ ์ ์ฅ
๋น๊ณต๊ฐ Artifact Registry Go ์ ์ฅ์๋ฅผ ์ค์ ํ๊ณ , ์ ์ฅ์์ ๋ชจ๋์ ์ ๋ก๋ํ๊ณ , ๋ชจ๋์ ์ข ์ ํญ๋ชฉ์ผ๋ก ์ฌ์ฉํฉ๋๋ค.
์์ํ๊ธฐ ์ ์
-
Sign in to your Google Account.
If you don't already have one, sign up for a new account.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Artifact Registry API.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Artifact Registry API.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
- Go 1.15 ์ด์์ ์ค์นํฉ๋๋ค.
package-go-module
gcloud CLI ๋ถ๊ฐ๊ธฐ๋ฅ์ธ
์ ์ค์นํฉ๋๋ค.gcloud components install package-go-module
์ ์ฅ์ ๋ง๋ค๊ธฐ
์ ์ ์ฅ์๋ฅผ ๋ง๋ค๊ณ ๊ตฌ์ฑํ๋ ค๋ฉด ๋ค์ ์๋ด๋ฅผ ๋ฐ๋ฅด์ธ์.
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ์ ์ ์ฅ์๋ฅผ ๋ง๋ญ๋๋ค.
gcloud artifacts repositories create REPOSITORY \ --repository-format=go \ --location=LOCATION \ --description=DESCRIPTION
๋ค์์ ๋ฐ๊ฟ๋๋ค.
- REPOSITORY์ ์ ์ฅ์ ์ด๋ฆ์ ๋๋ค. ํ๋ก์ ํธ์ ์ ์ฅ์ ์์น๋ง๋ค ์ ์ฅ์ ์ด๋ฆ์ด ๊ณ ์ ํด์ผ ํฉ๋๋ค.
- LOCATION์ ์ ์ฅ์์ ๋ฆฌ์ ๋๋ ๋ฉํฐ ๋ฆฌ์ ์์น์
๋๋ค. ๊ธฐ๋ณธ๊ฐ์ ์ค์ ํ๋ ๊ฒฝ์ฐ ์ด ํ๋๊ทธ๋ฅผ ์๋ตํ ์ ์์ต๋๋ค.
์ง์๋๋ ์ ์ฅ์ ์์น ๋ชฉ๋ก์ ๋ณด๋ ค๋ฉด
gcloud artifacts locations list
๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค. - DESCRIPTION์ ์ ํ์ฌํญ์ผ๋ก, ์ ์ฅ์์ ์ค๋ช ์ ๋๋ค. ์ ์ฅ์ ์ค๋ช ์ ์ํธํ๋์ง ์์ผ๋ฏ๋ก ๋ฏผ๊ฐํ ์ ๋ณด๋ ํฌํจํ์ง ๋ง์ธ์.
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ์ ์ฅ์ ์ธ๋ถ์ ๋ณด๋ฅผ ํ์ธํฉ๋๋ค.
gcloud artifacts repositories describe --location=LOCATION REPOSITORY
๋ค์๊ณผ ์ ์ฌํ ๊ฒฐ๊ณผ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
Encryption: Google-managed key Repository Size: 0.000MB createTime: '2022-06-03T20:20:01.644813Z' format: GO mode: STANDARD_REPOSITORY name: projects/my-project/locations/us-west1/repositories/my-repo updateTime: '2022-06-03T20:20:01.644813Z'
gcloud ๋ช ๋ น์ด ๊ธฐ๋ณธ๊ฐ ์ค์
ํ๋ก์ ํธ, ์ ์ฅ์, ์์น ๊ฐ์ ๊ธฐ๋ณธ๊ฐ์ ๊ตฌ์ฑํ์ฌ gcloud CLI
๋ช
๋ น์ด๋ฅผ ๋จ์ํํ ์ ์์ต๋๋ค. ๊ธฐ๋ณธ๊ฐ์ด ๊ตฌ์ฑ๋๋ฉด --project
, --location
, --repository
ํ๊ทธ๊ฐ ํ์ํ์ง ์์ต๋๋ค.
Go ๋ชจ๋ ํจํค์ง ๋ฐ ์ ๋ก๋
package-go-module
gcloud CLI ๋ถ๊ฐ๊ธฐ๋ฅ์ Go ๋ชจ๋์ ํจํค์งํ์ฌ gcloud
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํ Artifact Registry ๋ฒ์ ์ง์ ๋ฐ ์
๋ก๋๋ฅผ ์ง์ํฉ๋๋ค.
Go ๋ชจ๋ ๋ง๋ค๊ธฐ
๋จผ์ ์ ์ฅ์์ ์ ๋ก๋ํ ๊ฐ๋จํ Go ๋ชจ๋์ ๋ง๋ญ๋๋ค.
ํ ๋๋ ํฐ๋ฆฌ์์ ๋ชจ๋์ 'foo'๋ผ๋ ๋๋ ํฐ๋ฆฌ๋ฅผ ๋ง๋ญ๋๋ค.
mkdir foo
๋๋ ํฐ๋ฆฌ๋ฅผ ๋ชจ๋ ๋๋ ํฐ๋ฆฌ๋ก ๋ณ๊ฒฝํ๊ณ
go mod init
๋ฅผ ์คํํ์ฌ ๋ชจ๋์ฉ go.mod ํ์ผ์ ๋ง๋ญ๋๋ค.cd foo \ go mod init example.com/foo
example.com/foo
๋ฅผ ๋ชจ๋ ๊ฒฝ๋ก๋ก ๋ฐ๊ฟ๋๋ค. ์์ธํ ๋ด์ฉ์ Go ๋ชจ๋ ์ฐธ์กฐ๋ฅผ ํ์ธํ์ธ์.๋ค์ ์ฝํ ์ธ ๋ก foo ๋๋ ํฐ๋ฆฌ์
foo.go
๋ผ๋ ํ์ผ์ ๋ง๋ญ๋๋ค.package foo const HelloWorld = "Hello World!"
๋ชจ๋ ํจํค์ง ๋ฐ ์ ๋ก๋
๋ชจ๋์ ํจํค์งํ๊ณ ์ ์ฅ์์ ์ ๋ก๋ํฉ๋๋ค.
gcloud artifacts go upload --project=PROJECT \ --repository=REPOSITORY \ --location=LOCATION \ --module-path=example.com/foo \ --version=VERSION \ --source=SOURCE_LOCATION
๋ค์์ ๋ฐ๊ฟ๋๋ค.
- PROJECT๋ฅผ Google Cloud ํ๋ก์ ํธ ID๋ก ๋ฐ๊ฟ๋๋ค.
- REPOSITORY๋ฅผ ํจํค์ง๊ฐ ์ ์ฅ๋ ์ ์ฅ์์ ์ด๋ฆ์ผ๋ก ๋ฐ๊ฟ๋๋ค.
- LOCATION์ ์ ์ฅ์์ ๋ฆฌ์ ๋๋ ๋ฉํฐ ๋ฆฌ์ ์์น๋ก ๋ฐ๊ฟ๋๋ค.
example.com/foo
๋ฅผ ๋ชจ๋ ๊ฒฝ๋ก๋ก ๋ฐ๊ฟ๋๋ค. ์์ธํ ๋ด์ฉ์ Go ๋ชจ๋ ์ฐธ์กฐ๋ฅผ ํ์ธํ์ธ์.- VERSION์
vX.Y.Z
ํ์์ผ๋ก ๋ ๋ชจ๋์ ์๋งจํฑ ๋ฒ์ ์ผ๋ก ๋ฐ๊ฟ๋๋ค. ์ฌ๊ธฐ์X
๋ ์ฃผ ๋ฒ์ ์ด๊ณY
๋ ๋ถ ๋ฒ์ ์ด๊ณZ
๋ ํจ์น ๋ฒ์ ์ ๋๋ค. - SOURCE_LOCATION์ Go ๋ชจ๋์ ๋ฃจํธ ๋๋ ํฐ๋ฆฌ ๊ฒฝ๋ก๋ก ๋ฐ๊ฟ๋๋ค.
--source
ํ๋๊ทธ๋ฅผ ์๋ตํ๋ฉด ๊ธฐ๋ณธ๊ฐ์ ํ์ฌ ๋๋ ํฐ๋ฆฌ์ ๋๋ค.
๋ชจ๋์ด Artifact Registry์ ์ ๋ก๋๋ฉ๋๋ค.
Go ๋ชจ๋ ๋ง๋ค๊ธฐ์ ๋ํ ์์ธํ ๋ด์ฉ์ ์ด ํํ ๋ฆฌ์ผ์ ์ฐธ์กฐํ์ธ์.
๋ชจ๋ ๋์ด
๊ธฐ๋ณธ๊ฐ์ด ๊ตฌ์ฑ๋ ๊ฒฝ์ฐ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ๊ธฐ๋ณธ ํ๋ก์ ํธ, ์ ์ฅ์, ์์น์์ ์ ๋ก๋๋ Go ๋ชจ๋์ ๊ฒ์ฌํฉ๋๋ค.
gcloud artifacts packages list
๋ค์๊ณผ ์ ์ฌํ ๊ฒฐ๊ณผ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
Listing items under project my-project, location us-west1, repository my-repo. PACKAGE CREATE_TIME UPDATE_TIME example.com/foo 2022-06-03T20:43:39 2022-06-20T20:37:40
๋ชจ๋ ๋ฒ์ ์ธ๋ถ์ ๋ณด ๋ณด๊ธฐ
๊ธฐ๋ณธ๊ฐ์ด ๊ตฌ์ฑ๋ ๊ฒฝ์ฐ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ๊ธฐ๋ณธ ํ๋ก์ ํธ, ์ ์ฅ์, ์์น์ ๋ชจ๋ ๋ฒ์ ์ ํ์ธํฉ๋๋ค.
gcloud artifacts versions list --package=MODULE_PATH
๋ค์๊ณผ ์ ์ฌํ ๊ฒฐ๊ณผ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
Listing items under project my-project, location us-west1, repository my-repo, package example.com/foo. VERSION DESCRIPTION CREATE_TIME UPDATE_TIME v0.1.0 2022-06-03T20:43:39 2022-06-03T20:43:39 v0.1.1 2022-06-20T20:37:40 2022-06-20T20:37:40
๋ชจ๋ ๋ค์ด๋ก๋
Artifact Registry์ ์ ์ฅ๋ ๋ชจ๋์ ๊ฐ์ ธ์ค๋ ค๋ฉด Artifact Registry์์ ์ข ์ ํญ๋ชฉ์ ์ฐพ๊ณ ์ฒดํฌ์ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ฐํํ๋๋ก Go์ ์ง์ํด์ผ ํฉ๋๋ค.
Go ํ๊ฒฝ ์ค์
Artifact Registry์์ ๋ชจ๋, ๊ณต๊ฐ Go ๋ชจ๋ ํ๋ก์, ๊ทธ๋ฆฌ๊ณ ์์ค์ ์์๋๋ก ๋ค์ด๋ก๋ํ๋๋ก Go์ ์ง์ํฉ๋๋ค.
export GOPROXY=https://LOCATION-go.pkg.dev/PROJECT/REPOSITORY,https://proxy.golang.org,direct
๋ค์์ ๋ฐ๊ฟ๋๋ค.
- LOCATION์ ์ ์ฅ์์ ๋ฆฌ์ ๋๋ ๋ฉํฐ ๋ฆฌ์ ์์น์ ๋๋ค.
- PROJECT๋ Google Cloud ํ๋ก์ ํธ ID์ ๋๋ค.
- REPOSITORY๋ ํจํค์ง๊ฐ ์ ์ฅ๋ ์ ์ฅ์์ ์ด๋ฆ์ ๋๋ค.
๊ณต๊ฐ ์ฒดํฌ์ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ฌ์ฉํ์ฌ ๋ชจ๋์ ๊ฒ์ฌ์์ ์ ์ธํฉ๋๋ค.
export GONOSUMDB=MODULE_PATH_REGEX
์ฌ๋ฌ ๋ชจ๋์ ์ ์ธํ๋ ค๋ฉด MODULE_PATH_REGEX๋ฅผ ๋ชจ๋ ๊ฒฝ๋ก ๋๋ ์ ๊ท์์ผ๋ก ๋ฐ๊ฟ๋๋ค.
๊ณต๊ฐ ์ฒดํฌ์ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ฌ์ฉํ์ฌ
example.com/foo
๋ชจ๋์ด ๊ฒ์ฌ๋์ง ์๋๋ก ์ ์ธํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.export GONOSUMDB=example.com/foo
example.com
์ผ๋ก ์์ํ๋ ๋ชจ๋ ๊ฒฝ๋ก๊ฐ ์๋ ๋ชจ๋ ๋ชจ๋์ด ๊ณต๊ฐ ์ฒดํฌ์ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ฌ์ฉํ์ฌ ๊ฒ์ฌ๋์ง ์๋๋ก ์ ์ธํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.export GONOSUMDB=example.com/*
Artifact Registry์ ์ธ์ฆ
Artifact Registry์์ ์ข ์ ํญ๋ชฉ์ผ๋ก ์ฌ์ฉํ๊ธฐ ์ํด ํจํค์ง๋ Go ๋ชจ๋์ ๋ค์ด๋ก๋ํ ๋ Go ๋ฐ์ด๋๋ฆฌ๋ netrc ํ์ผ์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ฌ์ฉํ์ฌ Artifact Registry์ ์ธ์ฆํฉ๋๋ค. ์ธ์ฆ ํ๋ก์ธ์ค๋ฅผ ๋จ์ํํ๋ ค๋ฉด Go ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋์ฐ๋ฏธ๋ฅผ ์ฌ์ฉํ์ฌ Artifact Registry์ ์ธ์ฆํ ์ ์๋๋ก netrc ํ์ผ์ ํ ํฐ์ ์๋ก๊ณ ์นจํ๋ฉด ๋ฉ๋๋ค.
netrc ํ์ผ์ ์์น๋ netrc ํ๊ฒฝ ๋ณ์๋ก ์ค์ ํ ์ ์์ต๋๋ค.
NETRC
๋ณ์๊ฐ ์ค์ ๋์ง ์์ ๊ฒฝ์ฐ go
๋ช
๋ น์ด๋ UNIX ๊ณ์ด ํ๋ซํผ์์ $HOME/.netrc
๋ฅผ, Windows์์๋ %USERPROFILE%\_netrc
๋ฅผ ์ฝ์ต๋๋ค.
Artifact Registry๋ ๋ค์๊ณผ ๊ฐ์ ์ธ์ฆ ๋ฐฉ๋ฒ์ ์ง์ํฉ๋๋ค.
- ๋จ๊ธฐ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด(๊ถ์ฅ)
- Artifact Registry Go ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋์ฐ๋ฏธ ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ netrc ํ์ผ์ ์ธ์ฆ ํ ํฐ์ ์ ๋ฐ์ดํธํฉ๋๋ค.
- ์๋น์ค ๊ณ์ ํค ์ฌ์ฉ
์ฌ์ฉ์ ํ๊ฒฝ์์ ์ธ์ฆ์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ฌ์ฉํ ์ ์๋ ๊ฒฝ์ฐ ์ด ์ต์ ์ ์ฌ์ฉํ์ธ์. netrc ํ์ผ์ ์ํธํ๋์ง ์์ ์๋น์ค ๊ณ์ ํค๋ฅผ ์ถ๊ฐํฉ๋๋ค.
GONOPROXY
์ Go ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋์ฐ๋ฏธ ์ถ๊ฐ
Go ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋์ฐ๋ฏธ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ GONOPROXY
๋ชฉ๋ก์ ์ถ๊ฐํ์ฌ Go๊ฐ GitHub์์ ์ง์ ๋ค์ด๋ก๋ํ๋๋ก ํด์ผ ํฉ๋๋ค. ์์ค์์ ์ง์ ๋ค์ด๋ก๋ํ๋ ค๋ ๋ค๋ฅธ ๋ชจ๋์ด ์๋ ๊ฒฝ์ฐ ๋ค์ ์์์ ๊ฐ์ด ์ผํ๋ก ๊ตฌ๋ถ๋ ๋ชฉ๋ก์ ์ถ๊ฐํ ์ ์์ต๋๋ค.
export GONOPROXY=MODULE_PATH1, MODULE_PATH2
์ฌ๊ธฐ์ MODULE_PATH1 ๋ฐ MODULE_PATH2๋ ์์ค์์ ๋ค์ด๋ก๋ํ ๋ชจ๋์ ๋ชจ๋ ๊ฒฝ๋ก์ ๋๋ค.
Go ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋์ฐ๋ฏธ๋ฅผ GONOPROXY
๋ชฉ๋ก์ ์ถ๊ฐํ๊ณ ์คํํ์ฌ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํ๋ ค๋ฉด ๋ค์ ์๋ด๋ฅผ ๋ฐ๋ฅด์ธ์.
Go ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋์ฐ๋ฏธ๋ฅผ
GONOPROXY
์ ์ถ๊ฐexport GONOPROXY=github.com/GoogleCloudPlatform/artifact-registry-go-tools
๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ Go ๋ชจ๋ ํจํค์ง ๋๊ตฌ๋ก Artifact Registry ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ netrc ํ์ผ์ ์ถ๊ฐํฉ๋๋ค.
GOPROXY=proxy.golang.org \ go run github.com/GoogleCloudPlatform/artifact-registry-go-tools/cmd/auth@v0.1.0 \ add-locations --locations=LOCATION \ [--json_key=path/to/service/account/key.json]
์ฌ๊ธฐ์ LOCATION์ ์ ์ฅ์์ ๋ฆฌ์ ๋๋ ๋ฉํฐ ๋ฆฌ์ ์์น์ ๋๋ค. ์ฌ๋ฌ ์์น๋ฅผ ์ถ๊ฐํ๋ ค๋ฉด ์ผํ๋ก ๊ตฌ๋ถ๋ ๋ชฉ๋ก์ผ๋ก ์ ๋ ฅํฉ๋๋ค.
Go ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋์ฐ๋ฏธ๋ Artifact Registry ์ธ์ฆ์ ์ํด netrc ํ์ผ์ ์ค์ ์ ์ถ๊ฐํฉ๋๋ค.
--json_key
ํ๋๊ทธ๋ฅผ ์ ๋ฌํ๋ฉด ํค๋ ๋น๋ฐ๋ฒํธ ์ธ์ฆ์ ์ฌ์ฉ๋๋ netrc ํ์ผ์ ์ถ๊ฐ๋ฉ๋๋ค.
๋ชจ๋์ ์ข ์ ํญ๋ชฉ์ผ๋ก ์ฌ์ฉ
Artifact Registry์ ์ธ์ฆํ๋ ๋ฐ ๋จ๊ธฐ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ OAuth ํ ํฐ์ ์๋ก๊ณ ์นจํด์ผ ํฉ๋๋ค.
GOPROXY=proxy.golang.org \ go run github.com/GoogleCloudPlatform/artifact-registry-go-tools/cmd/auth@v0.1.0 refresh
ํ ๋๋ ํฐ๋ฆฌ์ 'bar'๋ผ๋ ๋๋ ํฐ๋ฆฌ๋ฅผ ๋ง๋ญ๋๋ค.
mkdir bar
๋๋ ํฐ๋ฆฌ๋ฅผ ๋ชจ๋ ๋๋ ํฐ๋ฆฌ๋ก ๋ณ๊ฒฝํ๊ณ
go mod init
๋ฅผ ์คํํ์ฌ ํจํค์ง์ฉgo.mod
ํ์ผ์ ๋ง๋ญ๋๋ค.cd bar \ go mod init example.com/bar
example.com/bar
๋ฅผ ๋ชจ๋ ๊ฒฝ๋ก๋ก ๋ฐ๊ฟ๋๋ค. ์์ธํ ๋ด์ฉ์ Go ๋ชจ๋ ์ฐธ์กฐ๋ฅผ ํ์ธํ์ธ์.Artifact Registry์ ์ ์ฅ๋ foo ๋ฒ์ ์ ์๊ตฌํ๋ ค๋ฉด
go.mod
ํ์ผ์ ๋ค์๊ณผ ๋น์ทํ๊ฒ ์์ ํฉ๋๋ค.module example.com/bar go 1.19 require example.com/foo v0.1.0
๋ค์์ ๋ฐ๊ฟ๋๋ค.
example.com/foo
๋ ํ์ ๋ชจ๋์ ๋ชจ๋ ๊ฒฝ๋ก์ ๋๋ค.v0.1.0
์ Artifact Registry์ ์ ์ฅ๋ ๋ฒ์ ์ ๋๋ค.
๋ค์ ์ฝํ ์ธ ๋ก
bar
๋๋ ํฐ๋ฆฌ์main.go
๋ผ๋ ํ์ผ์ ๋ง๋ญ๋๋ค.package main import ( "fmt" foo "example.com/foo" ) func main() { fmt.Println(foo.HelloWorld) }
foo ํจํค์ง๋ฅผ ํฌํจํ์ฌ ์ข ์ ํญ๋ชฉ์ ๋ค์ด๋ก๋ํ๋ ค๋ฉด go mod tidy๋ฅผ ์คํํฉ๋๋ค.
go mod tidy
bar ๋ชจ๋์ ์คํํฉ๋๋ค.
go run .
๋ค์๊ณผ ์ ์ฌํ ๊ฒฐ๊ณผ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
Hello World!
์ญ์
์ด ํ์ด์ง์์ ์ฌ์ฉํ ๋ฆฌ์์ค ๋น์ฉ์ด Google Cloud ๊ณ์ ์ ์ฒญ๊ตฌ๋์ง ์๋๋ก ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ์ํํฉ๋๋ค.
์ด ํ์ด์ง์์ ์ฌ์ฉํ ๋ฆฌ์์ค ๋น์ฉ์ด Google Cloud ๊ณ์ ์ ์ฒญ๊ตฌ๋์ง ์๋๋ก ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ์ํํฉ๋๋ค. ์ ์ฅ์๋ฅผ ์ญ์ ํ๊ธฐ ์ ์, ๋ณด๊ดํ ๋ชจ๋์ ๋ค๋ฅธ ์์น์์ ์ฌ์ฉํ ์ ์๋์ง ํ์ธํฉ๋๋ค.
์ ์ฅ์๋ฅผ ์ญ์ ํ๋ ค๋ฉด ๋ค์ ์๋ด๋ฅผ ๋ฐ๋ฅด์ธ์.
gcloud artifacts repositories delete \ --location=LOCATION \ --project=PROJECT \ REPOSITORY
๋ค์์ ๋ฐ๊ฟ๋๋ค.
- LOCATION์ ์ ์ฅ์์ ๋ฆฌ์ ๋๋ ๋ฉํฐ ๋ฆฌ์ ์์น๋ก ๋ฐ๊ฟ๋๋ค.
- PROJECT๋ฅผ Google Cloud ํ๋ก์ ํธ ID๋ก ๋ฐ๊ฟ๋๋ค.
- REPOSITORY๋ฅผ ์ ์ฅ์ ์ด๋ฆ์ผ๋ก ๋ฐ๊ฟ๋๋ค.
ํ์ฑ gcloud ๊ตฌ์ฑ์ ์ง์ ํ ๊ธฐ๋ณธ ์ ์ฅ์์ ์์น ์ค์ ์ ์ญ์ ํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
gcloud config unset artifacts/repository gcloud config unset artifacts/location
๋ค์ ๋จ๊ณ
- ์ธ์ฆ ๊ตฌ์ฑ ์์ธํ ์์๋ณด๊ธฐ
- ์ ์ฅ์ ๊ด๋ฆฌ ์์๋ณด๊ธฐ
- Go ๋ชจ๋ ๊ด๋ฆฌ ์์๋ณด๊ธฐ
- DevOps ๊ด๋ จ ๋ฆฌ์์ค๋ฅผ ์ฝ๊ณ DevOps ์ฐ๊ตฌ ๋ฐ ํ๊ฐ ์ฐ๊ตฌ ํ๋ก๊ทธ๋จ ์ดํด๋ณด๊ธฐ