gactions icon indicating copy to clipboard operation
gactions copied to clipboard

Unable to run gactions in CLI

Open davidvc opened this issue 4 years ago • 2 comments

I have a script I try to run in CircleCI inside a Linux container. It fails saying "[ERROR] command requires authentication. try to run "gactions login" first". When I run gactions login --help there are apparently no flags to login with a token.

So apparently I can't do automated deploys of my Google conversational actions, I have to deploy manually? I'm hoping very much you have a solution! I'm trying to set up a fully automated build/test/deploy pipeline.

Thanks!

David

Here's the script (.circleci/deploy_preview.sh)

#!/bin/bash

set -euxo pipefail

wget https://dl.google.com/gactions/v3/release/gactions-sdk_linux.tar.gz
tar xzvf gactions-sdk_linux.tar.gz

GACTIONS="./aog_cli/gactions"
chmod +x $GACTIONS

gactions login
$GACTIONS deploy preview

Here's the CircleCI config.yml file:

version: 2.1
orbs:
  node: circleci/[email protected]
executors:
  venus-executor:
    docker:
      - image: cimg/node:15.14.0
jobs:
  build:
    executor: venus-executor
    steps:
      - checkout
      - run:
          command: |
            cd functions
            npm install
  deploy-preview:
    executor: venus-executor
    steps:
      - checkout
      - run:
          command: |
            .circleci/deploy_preview.sh
workflows:
  version: 2
  merge:
    jobs:
      - build
      - deploy-preview:
          requires:
            - build

davidvc avatar Apr 19 '21 05:04 davidvc

I found a workaround. I created an environment variable in the CircleCI settings which contains the credentials JSON in my ~/.credentials directory.

Then as part of the job script I copy the contents of the environment variable into ~/.credentials/gactions-actions.googleapis.com-go.json

davidvc avatar Apr 19 '21 05:04 davidvc

Thanks for your feedback. I'm glad you got it to work and would definitely like to learn more about the CI system you are putting together.

Can you elaborate more on the kinds of tokens you may want, perhaps with an example, or maybe some additional documentation you want?

Fleker avatar Apr 19 '21 16:04 Fleker