fix: set .npmrc in HOME dir before publishing (#206)
This commit is contained in:
parent
cd1ddcb4f1
commit
3073c67861
|
@ -9,7 +9,6 @@ ENV NODE_VERSION_MAJOR=20
|
||||||
ENV DOCKER_CLI_VERSION=26.1.3
|
ENV DOCKER_CLI_VERSION=26.1.3
|
||||||
ENV BUILDX_VERSION=v0.14.0
|
ENV BUILDX_VERSION=v0.14.0
|
||||||
|
|
||||||
|
|
||||||
# Install dependencies for adding NodeSource repository, gcloud, and other tools
|
# Install dependencies for adding NodeSource repository, gcloud, and other tools
|
||||||
# - curl: for downloading files
|
# - curl: for downloading files
|
||||||
# - gnupg: for managing GPG keys (used by NodeSource & Google Cloud SDK)
|
# - gnupg: for managing GPG keys (used by NodeSource & Google Cloud SDK)
|
||||||
|
|
|
@ -3,10 +3,6 @@ steps:
|
||||||
entrypoint: 'npm'
|
entrypoint: 'npm'
|
||||||
args: ['install']
|
args: ['install']
|
||||||
|
|
||||||
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
|
||||||
entrypoint: 'npm'
|
|
||||||
args: ['run', 'auth']
|
|
||||||
|
|
||||||
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||||
entrypoint: 'npm'
|
entrypoint: 'npm'
|
||||||
args:
|
args:
|
||||||
|
@ -22,6 +18,15 @@ steps:
|
||||||
entrypoint: 'npm'
|
entrypoint: 'npm'
|
||||||
args: ['run', 'prerelease:deps', '--workspaces']
|
args: ['run', 'prerelease:deps', '--workspaces']
|
||||||
|
|
||||||
|
# A bit of a hack to get the .npmrc into the Dockerfile.sandbox. Should probably streamline this.
|
||||||
|
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||||
|
entrypoint: 'cp'
|
||||||
|
args: ['/workspace/.npmrc', '/builder/home/.npmrc']
|
||||||
|
|
||||||
|
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||||
|
entrypoint: 'npm'
|
||||||
|
args: ['run', 'auth']
|
||||||
|
|
||||||
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||||
entrypoint: 'npm'
|
entrypoint: 'npm'
|
||||||
args: ['publish', '--tag=head', '--workspace=@gemini-code/cli']
|
args: ['publish', '--tag=head', '--workspace=@gemini-code/cli']
|
||||||
|
|
|
@ -35,4 +35,3 @@ COPY packages/server/dist/gemini-code-server-*.tgz /usr/local/share/npm-global/g
|
||||||
RUN npm install -g /usr/local/share/npm-global/gemini-code-cli.tgz /usr/local/share/npm-global/gemini-code-server.tgz \
|
RUN npm install -g /usr/local/share/npm-global/gemini-code-cli.tgz /usr/local/share/npm-global/gemini-code-server.tgz \
|
||||||
&& npm cache clean --force \
|
&& npm cache clean --force \
|
||||||
&& rm -f /usr/local/share/npm-global/gemini-code-{cli,server}.tgz
|
&& rm -f /usr/local/share/npm-global/gemini-code-{cli,server}.tgz
|
||||||
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
@gemini-code:registry=https://us-west1-npm.pkg.dev/gemini-code-dev/gemini-code/
|
|
||||||
//us-west1-npm.pkg.dev/gemini-code-dev/gemini-code/:always-auth=true
|
|
|
@ -23,4 +23,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN --mount=type=secret,id=npmrc,dst=/root/.npmrc npm install -g @gemini-code/cli@${CLI_VERSION} --verbose
|
RUN --mount=type=secret,id=npmrc,dst=/root/.npmrc npm install -g @gemini-code/cli@${CLI_VERSION} --verbose
|
||||||
|
|
||||||
ENTRYPOINT 'gemini-code'
|
ENTRYPOINT 'gemini-code'
|
||||||
|
|
|
@ -49,6 +49,4 @@ if [ -n "${COLORTERM:-}" ]; then run_args+=(--env COLORTERM="$COLORTERM"); fi
|
||||||
# this is the preferred mechanism to detect if inside container/sandbox
|
# this is the preferred mechanism to detect if inside container/sandbox
|
||||||
run_args+=(--env "SANDBOX=$IMAGE:$TAG-$INDEX")
|
run_args+=(--env "SANDBOX=$IMAGE:$TAG-$INDEX")
|
||||||
|
|
||||||
node_args=("$CLI_PATH" "$@")
|
docker run "${run_args[@]}" --init --workdir "$WORKDIR" "$REGISTRY/$IMAGE:$TAG"
|
||||||
|
|
||||||
docker run "${run_args[@]}" --init --workdir "$WORKDIR" "$REGISTRY/$IMAGE:$TAG" node "${node_args[@]}"
|
|
Loading…
Reference in New Issue