I am currently trying to set up continuous deployment on Gitlab so that whenever I merge into develop, it will automatically bundle and deploy to my dev server using mup. I am able to run mup from my local machine and deploy to it, but I’ve been having difficulty getting it to run on the CI/CD.
The first problem I ran into was that there seems to be a bug with CoreOS where the tar command for installing meteor with curl https://install.meteor.com/ | sh fails.
Scratch that, I get the following error when trying access the site:
Error: Cannot find module '../'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/bundle/bundle/programs/server/npm/node_modules/bcrypt/node_modules/.bin/node-pre-gyp:15:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
Any ideas? Nope-Gyp successfully installs from the source on the ci server.
I’m going to take a different approach in the meantime and have the ci trigger the server to build the app itself. I’m having problems on that end as well though. Seems like it might be running out of memory when trying to build?
problem is that the gitlab server needs a private key or password to push it to the remote server. we use a private variable for that and this odd script (under deploy_staging)
Nice, I ended up getting it to work with your docker image. I’ll post the script shortly, just to make sure it works without all the extra cruft I had on it, but basically, I was able to get my Meteor app to get bundled correctly (albeit I had to explicitly add bcrypt to finally get it to deploy without any missing dependencies). So bundled and deployed to a Digital Ocean droplet with Mup on Gitlab CI!
did caching work for you? My builds where very slow because it reinstalled node_modules on every stage.
I also had recently a problem with docker. on every second build i get:
Running with gitlab-ci-multi-runner 1.10.4 (b32125f)
Using Docker executor with image blurri/meteor-node …
ERROR: Preparation failed: cannot connect to Docker endpoint
Caching seems to work between builds, but not for stages. Artifacts are supposed to help between stages, but I opted to just have the deploy stage reinstall every time so I wouldn’t have to worry about it. Not ideal, but I’m sure I can improve this in the future.
A simple repo structure with the .gitlab-ci.yml that I am using.