cuelang.org/go@v0.10.1/internal/_e2e/testdata/script/gcloud_upload.txtar (about)

     1  # Publish a version for a simple CUE module via "cue mod publish"
     2  # to an off-the-shelf OCI registry which requires authentication.
     3  # Then fetch that module as a dependency via cmd/cue.
     4  
     5  gcloud-auth-docker # sets: MODULE, CUE_REGISTRY, CUE_REGISTRY_HOST, CLOUDSDK_CONFIG
     6  env DOCKER_CONFIG=$WORK/docker-config
     7  env-fill docker-config/config.json
     8  
     9  env VERSION=v0.0.1
    10  env MODVER=${MODULE}@v0
    11  
    12  cd publish
    13  
    14  exec cue mod init --source self ${MODVER}
    15  exec cue mod publish ${VERSION}
    16  
    17  cd ../depend
    18  
    19  env-fill out_foo.cue
    20  exec cue mod init --source self depend.localhost
    21  exec cue mod tidy
    22  exec cue export
    23  cmp stdout export.golden
    24  
    25  -- docker-config/config.json --
    26  {"credHelpers": {"${CUE_REGISTRY_HOST}": "gcloud"}}
    27  -- publish/foo.cue --
    28  package publish
    29  
    30  foo: "foo value"
    31  
    32  -- depend/out_foo.cue --
    33  package depend
    34  
    35  import mt "${MODVER}:publish"
    36  
    37  out: mt.foo
    38  -- depend/export.golden --
    39  {
    40      "out": "foo value"
    41  }