Skip to content

Commit

Permalink
Docker ci targets/support
Browse files Browse the repository at this point in the history
  • Loading branch information
mayfield committed Mar 13, 2019
1 parent d3d47f6 commit 3896a78
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
1 change: 1 addition & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ steps:
tags: commit-${DRONE_COMMIT},dev-build-${DRONE_BUILD_NUMBER}
build_args:
- source_version=${DRONE_COMMIT}
- build_target=ci
volumes:
- name: docker
path: /var/run/docker.sock
Expand Down
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@ FROM node:10
ENV LC_ALL=C.UTF-8 \
NODE_ENV=production
RUN apt-get update && \
apt-get install -y ruby ruby-dev && \
apt-get install -y \
ruby \
ruby-dev \
libx11-xcb1 \
libxtst6 \
libnss3 \
libxss1 \
libasound2 \
libatk-bridge2.0 \
libgtk-3.0 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN gem install sass
WORKDIR /usr/src
COPY Makefile package.json bower.json semantic.json .bowerrc .npmrc ./
COPY Makefile package.json bower.json semantic.json .bowerrc .npmrc .eslintrc.json ./
COPY semantic/gulpfile.js semantic/
COPY semantic/src semantic/src
COPY semantic/tasks semantic/tasks
Expand All @@ -23,11 +32,11 @@ COPY stylesheets stylesheets
COPY templates templates
COPY tests tests
COPY worker worker
COPY worker worker
COPY .git .git
COPY Gemfile Gemfile.lock Gruntfile.js manifest.json ./
ARG source_version
ARG build_target=build
ENV SOURCE_VERSION=$source_version
RUN make build
RUN make $build_target
EXPOSE 1080
CMD ["npm", "start"]
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,20 @@ $(OEMBED_SYMLINK):

OEMBED_SYMLINK := stylesheets/_oembed.scss

ifneq ($(NODE_ENV),production)
$(LINT): $(SRC) Makefile
$(NPATH)/eslint app lib worker tests
touch $@

$(TEST): $(SRC) $(shell find tests -type f 2>/dev/null) Makefile
$(TEST): $(SRC) $(shell find tests -type f 2>/dev/null) Makefile $(LINT)
node tests/forstaDownTest.js
npm test
touch $@
else
$(LINT):
touch $@

$(TEST):
touch $@
endif

$(GRUNT): $(BOWER) $(SEMANTIC) $(SYMLINKS) Gruntfile.js $(SRC) $(LINT) Makefile
$(GRUNT): $(BOWER) $(SEMANTIC) $(SYMLINKS) Gruntfile.js $(SRC) Makefile
$(NPATH)/grunt default
touch $@

$(BUILD): $(GRUNT) $(TEST) Makefile
$(BUILD): $(GRUNT) Makefile
echo '{"git_commit": "$(or $(SOURCE_VERSION),$(shell git rev-parse HEAD))"}' > $@

clean:
Expand All @@ -90,6 +82,11 @@ lint: $(LINT)

test: $(TEST)

ci: $(BUILD)
npm install --only=dev
$(MAKE) lint
$(MAKE) test

########################################################
# Runtime-only targets
########################################################
Expand Down Expand Up @@ -193,6 +190,9 @@ electron-osx-sign:
docker-build:
docker build -t relay-web-app .

docker-ci:
docker build --build-arg build_target=ci -t relay-web-app .

docker-run:
docker run -it -p 1080:1080 relay-web-app

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"homepage": "https://github.com/forstalabs/relay-web-app",
"main": "./electron/main.js",
"dependencies": {
"bower": "1.8.2",
"bower": "1.8.8",
"emoji-datasource": "4.0.3",
"emoji-datasource-google": "4.0.3",
"emoji-js": "3.4.0",
Expand Down
7 changes: 6 additions & 1 deletion tests/.jest-puppeteer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ module.exports = {
},
launch: {
headless,
devtools: !headless
devtools: !headless,
args: [
'--disable-dev-shm-usage',
'--no-sandbox',
'--disable-setuid-sandbox'
]
}
};

0 comments on commit 3896a78

Please sign in to comment.