Auto-build Win/Linux/macOS meteor app + push to Docker

I’ve been working on a Meteor app (Tdarr) for a few months and the update process has become quite tiring as I have to do it all manually. I’m looking for ways to automate the following process:

  • Build Win/Linux/macOS packages and add to Github release.
  • Build 2 Docker containers and push to Docker.

From my understanding, the Win/Linux/macOS packages have to be built on their respective operating systems as if they are built on another operating system then the wrong dependancies will be installed by npm.

I’ve tested using Github actions but the build process takes so long due to 40,000 or so files per package.

Anyone have any suggestions/experience with this sort of workflow?

You can use Gitlab CI/CD to this. I used and worked fine.

Okay thanks I’ll have a look at that.

I’m using Jenkins and it required a bit of setup at first to get pipelines automated properly, but I suggest you try Gitlab CI/CD first.

One example:

stages:
  - build
  - deploy
docker-build:
  stage: build
  image: stieneee/docker-in-ubuntu:latest
  services:
    - docker:dind
  before_script:
    - echo CI_PIPELINE_ID $CI_PIPELINE_ID
    - curl -sL https://deb.nodesource.com/setup_8.x | bash -
    - apt-get update
    - apt-get install -y nodejs build-essential git
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
    - curl https://install.meteor.com/ | sh
    - mkdir -p /tmp/meteor-build/
  script:
    - npm i
    - meteor build --allow-superuser --directory /tmp/meteor-build/
    - cp Dockerfile /tmp/meteor-build/bundle/
    - cd /tmp/meteor-build/bundle/
    - docker build -t registry.gitlab.com/mygroup/myproject:$CI_PIPELINE_ID .
    - docker push registry.gitlab.com/mygroup/myproject:$CI_PIPELINE_ID
    - docker tag registry.gitlab.com/mygroup/myproject:$CI_PIPELINE_ID registry.gitlab.com/mygroup/myproject:latest
    - docker push registry.gitlab.com/mygroup/myproject:latest

You need to create a .gitlab-ci.yml at root of your project.

This process build Meteor app, create a Docker Image and push it at Gitlab Registry.

1 Like