deployctl icon indicating copy to clipboard operation
deployctl copied to clipboard

`deployctl deploy` on CircleCI errors out

Open lambtron opened this issue 1 year ago • 3 comments

my circleci config.yml:

version: 2.1
jobs:
  build_and_deploy:
    docker:
      - image: denoland/deno:alpine
    steps:
      # Clone repo
      - checkout
      # Replace this with steps to deploy to users
      - run:
          name: install deployctl
          command: deno install -qArf https://deno.land/x/deploy/deployctl.ts 
      - run:
          name: deploy project
          command: deployctl deploy --token=$DENO_DEPLOY_TOKEN hello.ts
workflows:
  example:
    jobs:
      - build_and_deploy

and when i run it

#!/bin/sh -eo pipefail
deployctl deploy --token=$DENO_DEPLOY_TOKEN hello.ts
-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C[-1C

ad infinitum.

but i can confirm that deployctl is installed properly and the DENO_DEPLOY_TOKEN is set.

lambtron avatar Feb 14 '24 17:02 lambtron

Seems like the output is ascii escape key as deployctl is searching for a tty to display interactive prompt.

lambtron avatar Feb 14 '24 17:02 lambtron

Apparently CI platforms commonly set a CI envvar that other systems use to detect and disable TTY.

  • https://github.com/orgs/community/discussions/26628
  • https://circleci.com/docs/variables/#built-in-environment-variables

We should teach deployctl a non-interactive mode flag or perhaps auto-detect this env var and toggle non-interactive mode.

rbetts avatar Feb 14 '24 18:02 rbetts

Anyone been able to get this up and running in CircleCI?

EDIT: For context, this is how I'm trying to deploy:

version: 2.1
executors:
  deno:
    resource_class: small
    docker:
      - image: denoland/deno:alpine-2.1.4
jobs:
  deploy:
    executor:
      name: deno
    steps:
      - checkout
      - restore_cache:
          key: &deno-cache deno-{{ .Branch }}-{{ checksum "deno.lock" }}
      - run:
          name: Deno install
          command: deno install --frozen=true
      - save_cache:
          key: *deno-cache
          paths: [/deno-dir]
      - run: deno task build
      - run: deno install --no-prompt --global --allow-all --reload --force jsr:@deno/deployctl
      - run: deployctl deploy
workflows:
  deploy:
    jobs: [deploy]

I have set the DENO_DEPLOY_TOKEN as an environment variable. I've configured deploy inside my deno.json. Running the commands locally on my computers works just fine. I've even tried spinning up a denoland/deno:alpine-2.1.4 locally and running the commands above just fine as well. But I can't seem to get it to work in CircleCI.

Ekman avatar Dec 20 '24 11:12 Ekman