Add docker container for testing
This commit is contained in:
Родитель
cbc0605795
Коммит
ac1e6e6454
|
@ -0,0 +1,27 @@
|
|||
FROM node:lts-stretch-slim
|
||||
|
||||
# Install Ruby & Bourbon
|
||||
# Only required once to init project
|
||||
# RUN apk update && apk upgrade && apk --update add \
|
||||
# ruby ruby-dev ruby-ffi ruby-irb ruby-rake ruby-io-console ruby-bigdecimal ruby-json ruby-bundler \
|
||||
# libstdc++ tzdata bash ca-certificates \
|
||||
# && echo 'gem: --no-document' > /etc/gemrc
|
||||
# RUN gem install bourbon
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y chromium firefox-esr && \
|
||||
rm -rf /var/lib/apt/
|
||||
|
||||
# Install node packages
|
||||
RUN npm install -g grunt-cli
|
||||
|
||||
# Environment vars
|
||||
ENV DOCKER="True"
|
||||
|
||||
# Copy files
|
||||
RUN mkdir -p /passman
|
||||
WORKDIR /passman
|
||||
COPY . /passman
|
||||
|
||||
# Install project dependencies
|
||||
RUN npm install
|
|
@ -1,10 +1,14 @@
|
|||
// Karma configuration
|
||||
// Generated on Mon Oct 17 2016 15:46:52 GMT+0200 (CEST)
|
||||
var isTravis = (process.env.TRAVIS_BUILD_NUMBER) ? true : false;
|
||||
var isDocker = (process.env.DOCKER) ? true : false;
|
||||
var browsers = ['Firefox'];
|
||||
if(!isTravis){
|
||||
browsers = ['Chrome'];
|
||||
}
|
||||
if(isDocker){
|
||||
browsers = ['Chromium_Docker', 'Firefox_Docker'];
|
||||
}
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
|
||||
|
@ -62,6 +66,16 @@ module.exports = function (config) {
|
|||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: browsers,
|
||||
customLaunchers: {
|
||||
Chromium_Docker: {
|
||||
base: 'Chromium',
|
||||
flags: ['--headless', '--disable-gpu', '--remote-debugging-port=9222', '--no-sandbox']
|
||||
},
|
||||
Firefox_Docker: {
|
||||
base: 'Firefox',
|
||||
flags: ['--headless']
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Continuous Integration mode
|
||||
|
|
Загрузка…
Ссылка в новой задаче