Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

The add-path command is disabled #64

Closed
DarkLite1 opened this issue Nov 17, 2020 · 7 comments
Closed

The add-path command is disabled #64

DarkLite1 opened this issue Nov 17, 2020 · 7 comments

Comments

@DarkLite1
Copy link

Since today we receive the following error when triggering a new build with GitHub Actions:

Unable to process command '::add-path::/home/runner/work/_temp/1d927908-5f05-4a72-851f-c106a7be6583' successfully.
The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

CD.yml

name: Continuous deployment

on:
  workflow_dispatch:
  repository_dispatch:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # Run OpenShift build process
      - name: Start OpenShift build
        uses: redhat-developer/openshift-actions@v2.1.0
        with:
          version: '3.11.230'
          openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
          parameters: '{"apitoken": "${{ secrets.OPENSHIFT_API_TOKEN }}", "acceptUntrustedCerts": "true"}'
          cmd: |
            oc project hip
            oc start-build backend-graphql-server --follow

A similar issue has been reported here for another project. So at this time we are now longer able to publish new version to OpenShift.

Thank you for having a look at this.

@lstocchi
Copy link
Collaborator

lstocchi commented Nov 17, 2020

@DarkLite1 we are working on a new set of gh actions so this one if going to be deprecated soon. What i can suggest you is to change a bit you workflow for the moment this way.

name: Continuous deployment

on:
  workflow_dispatch:
  repository_dispatch:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # Run OpenShift build process
     - name: Install oc
       uses: redhat-actions/oc-installer@v1
       with:
         version: '3.11.230'         
     - name: Execute oc commands
       run: |
         oc login --insecure-skip-tls-verify --token ${{ secrets.OPENSHIFT_API_TOKEN }} ${{ secrets.OPENSHIFT_SERVER_URL }}
         oc project hip
         oc start-build backend-graphql-server --follow

For the new coming actions give a look at https://github.com/redhat-actions ;)
Then not sure if using the oc 3.11.230 is a real need but if you are using the latest ubuntu environment it already comes with oc (4.5) pre-installed and you can skip the installation step https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md#cli-tools

@DarkLite1
Copy link
Author

DarkLite1 commented Nov 17, 2020

Thank you for getting back to me.

Using this:

  build:
    runs-on: ubuntu-latest
    steps:
      Run OpenShift build process    
     - name: Execute oc commands
       run: |
         oc login --insecure-skip-tls-verify --token ${{ secrets.OPENSHIFT_API_TOKEN }} ${{ secrets.OPENSHIFT_SERVER_URL }}
         oc project hip
         oc start-build backend-graphql-server --follow

Fails with the error below while I'm 100% certain we have a project:
image

Using this config:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      Run OpenShift build process
       - name: Install oc
         uses: redhat-actions/oc-installer@v1
         with:
           oc_version: '3.11.230'         
     - name: Execute oc commands
       run: |
         oc login --insecure-skip-tls-verify --token ${{ secrets.OPENSHIFT_API_TOKEN }} ${{ secrets.OPENSHIFT_SERVER_URL }}
         oc project hip
         oc start-build backend-graphql-server --follow

Also fails:
image

*I had to rename version to oc_version. Can you see where I'm going wrong?

@lstocchi
Copy link
Collaborator

lstocchi commented Nov 17, 2020

@DarkLite1 the first error i guess it is due to incompatibility between the oc 4.5 and your cluster. Are you using Openshift 3?

The second i guess there is an error in the line below steps in the line 15. Either you add a # to make the sentence Run OpenShift build process a comment or you delete it otherwise it will be considered a command but it will cause a failure as it is written in an invalid yaml syntax.

Let me know if this fixes the error

P.S: sorry for the version/oc_version change, you are right. My fault.

@jeffmaury
Copy link
Member

My understanding is that you have no projects on the cluster and oc project hip tries to set current project to hip but does not create the project. Use oc new-project to create it

@DarkLite1
Copy link
Author

DarkLite1 commented Nov 17, 2020

Thank you for being so helpful. This works fine now:


on:
  workflow_dispatch:
  repository_dispatch:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # Run OpenShift build process
      - name: Install oc
        uses: redhat-actions/oc-installer@v1
        with:
          oc_version: '3.11.230'         
      - name: Execute oc commands
        run: |
          oc login --insecure-skip-tls-verify --token ${{ secrets.OPENSHIFT_API_TOKEN }} ${{ secrets.OPENSHIFT_SERVER_URL }}
          oc project hip
          oc start-build backend-graphql-server --follow

We are on version:

OpenShift Master: v3.11.0+56691f4-502
Kubernetes Master: v1.11.0+d4cacc0
OpenShift Web Console: v3.11.0+ea42280

image

@jeffmaury when I try the code below, will it not erase my project?

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # Run OpenShift build process 
      - name: Execute oc commands
        run: |
          oc login --insecure-skip-tls-verify --token ${{ secrets.OPENSHIFT_API_TOKEN }} ${{ secrets.OPENSHIFT_SERVER_URL }}
          oc new-project hip
          oc project hip
          oc start-build backend-graphql-server --follow

@jeffmaury
Copy link
Member

No if hip exists, then oc new-project will fail

@DarkLite1
Copy link
Author

It does exist as you can see in the screenshot. I'll close this one and keep the code that works for now.
Thanks guys, appreciate the help 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants