#Gitlab CI/CD

1 messages · Page 1 of 1 (latest)

steel pelican
#

Hi @mental roost , we don't currently have a CLI tool, but it's on our roadmap (https://github.com/Permify/permify/issues/146). In the meantime, how about running GitHub Actions on GitLab?
To use a GitHub Action in GitLab, you can follow these steps:

  1. Navigate to your GitLab repository and click on the CI/CD tab.
  2. Click on the 'New Pipeline' button.
  3. Select the 'Use a workflow file' option.
  4. In the 'Workflow file' field, enter the following YAML code:
          build:
            runs-on: ubuntu-latest
            steps:
                   - uses: actions/checkout@v2
                  - uses: permify/permify-validate-action@v1
    

Click on the 'Create Pipeline' button.
Once the pipeline is created, it will run the GitHub Action in your GitLab repository.

mental roost
#

this sounds interesting. I will try it and let you know the result. thanks, Tolga!

steel pelican
#

Could you try this?

validate_schema:
  stage: validate
  image: 
    name: ghcr.io/permify/permify:v0.4.5
    pull_policy: always
  script:
    - permify validate $INPUT_VALIDATIONFILE
mental roost
mental roost
steel pelican
#
- uses: permify/permify-validate-action@v1
      with:
        validationFile: "test.yaml

this but I'm unsure if GitLab supports the uses: keyword. I'm looking for a different solution.

mental roost
#

such as

FROM ghcr.io/permify/permify:latest as base

FROM ubuntu:22.04
COPY --from=base /usr/local/bin/permify /permify
RUN chmod +x /permify
#

I think this would be enough

steel pelican
#

Alright, @mental roost . We will conduct our tests and provide an update accordingly.

mental roost
#

another way would be to provide a permify-cli tool that is published to major package repositories (e.g. apk) - right now it only available in brew

steel pelican
#

I found a solution like this, @mental roost . What do you think?

.gitlab-ci.yml

image: docker:20.10.11

services:
  - name: docker:dind
  - name: python:3.10

stages:  
  - validate

validate_schema:
  stage: validate
  before_script:
    - apk add --update python3 py3-pip
  script:
    - docker run ghcr.io/permify/permify:v0.4.5 validate {{FILE_PATH}}
mental roost
#

haha, running docker container inside docker container 😂

#

I need to try it out as this may not be permitted by our infra setup

#

by the way, why do you install python3 and py3-pip?

#

nevermind, I may misundertood the services keyword

mental roost
#

I got this error:

#

have you made it work?

steel pelican
#

Yes, I tried it and it worked. I'll review it again