Skip to content

A docker container to be used with gitlab-runner to provide front-end testing facilities for Angular+Karma with Chrome as the rendering agent.

Notifications You must be signed in to change notification settings

agkunz/angular-karma-chrome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Angular testing container

Introduction

I wanted a docker.io container to do my automated CI / CD testing with GitLab. Thought it smart to have it closely resemble the deployment server.

There are likely more space-efficient containers out there, but this one is mine.

Installation

Based on ubuntu:latest, contains:

  • curl, git, rsync
  • gitlab-runner
  • nodejs
  • chromium-browser
  • @angular/cli

Use $ docker pull agkay/angular-karma-chrome to get it!

Configuration

Karma

Make sure your karma.conf.js is configured correctly.

Add karma-chrome-launcher to your plugins array

    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular-devkit/build-angular/plugins/karma')
    ],

Create a custom launcher and set the --no-sandbox option.

    browsers: ['ChromeHeadlessCI'],
    customLaunchers: {
      ChromeHeadlessCI: {
        base: 'ChromeHeadless',
        flags: ['--no-sandbox']
      }
    },

GitLab

If you use the supplied gitlab-ci.yml to perform a deploy, you will want to define the following environment variables:

  • DEPLOY_SSH_KEY Provide a private key with access to your production server,
  • DEPLOY_SSH_USER Tell us what account to do it with,
  • DEPLOY_SSH_HOST Where the server is,
  • DEPLOY_SSH_DIR And where on the disk you want it to go.

About

A docker container to be used with gitlab-runner to provide front-end testing facilities for Angular+Karma with Chrome as the rendering agent.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published