#Gitlab CI/CD
1 messages · Page 1 of 1 (latest)
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:
- Navigate to your GitLab repository and click on the CI/CD tab.
- Click on the 'New Pipeline' button.
- Select the 'Use a workflow file' option.
- 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.
this sounds interesting. I will try it and let you know the result. thanks, Tolga!
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
it doesn't work unfortunately
how could I specify the validation file in this solution?
- 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.
I think the easiest solution would be to adapt this docker file(https://github.com/Permify/permify-validate-action/blob/main/Dockerfile) and publish a new docker image for CI/CD usages
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
Alright, @mental roost . We will conduct our tests and provide an update accordingly.
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
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}}
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
Yes, I tried it and it worked. I'll review it again