Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitLab support #8

Open
almereyda opened this issue Jun 13, 2023 · 8 comments
Open

GitLab support #8

almereyda opened this issue Jun 13, 2023 · 8 comments

Comments

@almereyda
Copy link

The documentation page at

suggests Windmill could integrate with GitLab.

How would an adapted .gitlab-ci.yaml file look like?

@rubenfiszel
Copy link
Contributor

@almereyda
I don't know gitlab-ci but I assume it would be really easy to setup:
Push on merge, see: https://github.com/windmill-labs/windmill-sync-example/blob/main/.github/workflows/push-on-merge.yaml
Pull regularly, see: https://github.com/windmill-labs/windmill-sync-example/blob/main/.github/workflows/pull-workspace.yaml

Most of it is running the deno cli directly:

          deno run --unstable -A  https://deno.land/x/[email protected]/main.ts workspace add __automation ${{ env.WMILL_WORKSPACE }} ${{ env.WMILL_URL }} --token ${{ secrets.WMILL_TOKEN }}
          deno run --unstable -A  https://deno.land/x/[email protected]/main.ts sync push --yes --fail-conflicts

The first command link a workspace to the ephemeral env using the remote informations
The second just run wmill sync push --yes --fail-conflicts

I would assume it's possible to run deno in gitlab and that's the only thing necessary.

@almereyda
Copy link
Author

almereyda commented Jun 14, 2023

This sounds marvellous. I would like to give it a try within the next few weeks, and report back here.

@rubenfiszel
Copy link
Contributor

When you figure it out, if you can share your .gitlab-ci.yaml, we would be grateful for it.

@antonionicampos
Copy link

@almereyda Did you manage to advance at this point? There are other people interested in this integration with GitLab.

@rubenfiszel It would even be very interesting for the dissemination of the tool as a whole. I work at a big company that only uses GitLab.

Thank you in advance.

@almereyda
Copy link
Author

I'm not actively working on this right now.

@rubenfiszel
Copy link
Contributor

@antonionicampos if you're evaluating using windmill in an enterprise setting, we would be happy to prioritize this for a PoC. Just book a slot with me: www.windmill.dev/ruben-30min

@ghost
Copy link

ghost commented Jun 25, 2024

It would be nice to have a command like wmill sync diff --push|--pull that only returns the diff, which can then be compared against a Git diff inside a merge request, so we can make sure that Git changes represent actual changes or spot discrepancies (e.g. someone messed with it online) before execution.

The super simple pipeline step we are using at the moment is this:

variables:
  WMILL_VERSION: "v1.349.1"
  WMILL_USER: "gitlab-ci"
  WMILL_WORKSPACE_ID: "..."
  WMILL_WORKSPACE_NAME: "..."

windmill-sync:
  stage: sync
  image:
    name: denoland/deno:debian
    entrypoint: ["/usr/bin/bash"]
  script: |
    set -e

    deno run --unstable -A "https://deno.land/x/wmill@${WMILL_VERSION}/main.ts" \
        --token "${WMILL_TOKEN}" \
        workspace add \
          --create \
          --create-workspace-name "${WMILL_WORKSPACE_NAME}" \
          --create-username "${WMILL_USER}" \
          "${WMILL_WORKSPACE_NAME}" \
          "${WMILL_WORKSPACE_ID}" \
          "${WMILL_URL}"

    deno run --unstable -A "https://deno.land/x/wmill@${WMILL_VERSION}/main.ts" \
        --token "${WMILL_TOKEN}" \
        sync push \
          --yes \
          --fail-conflicts

Variables WMILL_URL and WMILL_TOKEN are configured as CI variables.

Once we get windmill-labs/windmill#3943 this will be even simpler and much faster in execution (as long as the actual Docker image is going to be relatively small), since then we don't need to download windmill and all its dependencies each time.

@rubenfiszel
Copy link
Contributor

windmill cli available at: https://github.com/windmill-labs/windmill/pkgs/container/windmill-cli (image itself at: ghcr.io/windmill-labs/windmill-cli)

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

No branches or pull requests

3 participants