1

I'm currently developing a project containing an Angular SPA Frontend Repo and a nodeJS backend repo. I've been looking into ways, how to deploy my Applications to RHEL/centOS using Gitlab-CI after compiling/minifying my project. The problem is, I can't figure out, how to use eg. the YUI Compressor for shrinking within the gitlab-ci.yml file. I also have trouble to use eg SSH to deploy my files into my Public Folder on my webserver or to trigger pm2 to reload the application. I'd love to implement a basic unit testing in this approach, but I still can't get the hang of how it's done either. I'd be glad to hear any suggestions from you that could expand my knownledge. Thanks!

1 Answer 1

1

Assuming you're using yuicompressor as a jar, how about writing this in .gitlab-ci.yml:

build:
  script:
  - yuicompressor.sh

Make sure you have a shell script in your path, which chmod +x bit set that does this:

#!/bin/sh
java -jar /path/to/your/yuicompressor-x.y.z.jar

That file must be on your runner vm called yuicompressor.sh. It doesn't seem good to me to hard-code paths to resources on your runners into .gitlab-ci.yml.

Note you might need different args to the java app.

I put all executable tools (mostly scripts) that my runners need into a folder /glrunner/tools and place /glrunner/tools into the PATH of my runner when I start it.

If you're having trouble because you're using Dockerized runners, get everything working OUTSIDE docker with a shell runner on a Linux VM, and later move to containers. This is the number one rookie mistake people make.

Once you're using containers and you have a Dockerfile to bring up your tooling, perhaps you won't need to consider static "tool/script" folders like I have initially suggested, but it's a good way to get started, learn Gitlab CI Runners first, then learn Docker.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.