How do I setup auto-deploy from GitLab repo to Meteor Galaxy?


Hello, the idea here is to every time a specific branch of my repository (GitLab) is updated it should make a new deploy to the Meteor Galaxy. Has anyone done it? Do you know a tutorial for this?


We don’t use GitLab, but it looks like GitLab CI/CD is similar to Bitbucket Pipelines, which we do use to deploy to Galaxy on commits to both our staging and production git branches.

It looks like from the quickstart guide that you just need to create a YAML file in your git repo root and configure your project to use Runner. Probably want to make sure to use an OS image with Node 8 installed. Your YAML file will at a minimum need to include some Meteor specific commands to install Meteor and then call the meteor deploy command.

Also, you will need to generate a Meteor login session token (expires I think after 90 days) and copy it into a GitLab environment variable named something like DEPLOY_SESSION_FILE. To generate the token you need to be able to login in to Meteor as your Galaxy user before executing this command from your local development console:

$ METEOR_SESSION_FILE=deployment_token.json meteor login

I can’t give you an exact working script as I have no way to test it. However this should give you a general idea of what you need to put in your YAML file to deploy a staging branch and you can figure out the exact required syntax. Report back when you get a working script.

image: node:8

  - curl | sh
  - meteor npm install

    - echo $DEPLOY_SESSION_FILE > deployment_token.json
    - METEOR_SESSION_FILE=deployment_token.json meteor deploy --allow-superuser --settings config/staging/settings.json --owner username

    - staging
    - docker