Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding docker support to circleci #2894

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,27 @@ jobs:
- store_artifacts:
path: ./reports/screenshots

publish-docker:
docker:
# specify the version you desire here
- image: circleci/node:10.19.0-buster

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
resource_class: xlarge
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide

steps:
- checkout
- setup_remote_docker
- run: ./ci/build_and_publish_docker_images.sh

deploy-remix-alpha:
docker:
# specify the version you desire here
Expand Down Expand Up @@ -175,6 +196,11 @@ workflows:
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-run-deploy
- publish-docker:
requires:
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-run-deploy
- deploy-remix-live:
requires:
- remix-ide-chrome
Expand All @@ -190,4 +216,4 @@ workflows:
- remix-ide-run-deploy
filters:
branches:
only: master
only: master
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gist_token = <token>
account_passphrase = <passphrase>
account_password = <password>
gist_token=<token>
account_passphrase=<passphrase>
account_password=<password>
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:10
# Create Remix user, don't use root!
# RUN yes | adduser --disabled-password remix && mkdir /app
# USER remix

# #Now do remix stuff
# USER remix
WORKDIR /home/remix

RUN git clone https://github.com/ethereum/remix-ide.git
RUN git checkout origin remix_live

WORKDIR /home/remix/remix
RUN npm install
RUN npm run build

EXPOSE 8080 65520

CMD ["npm", "run", "serve"]
20 changes: 20 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This dockerfile is to build each branch seperately (for dev purpouses)
FROM node:10
# Create Remix user, don't use root!
# RUN yes | adduser --disabled-password remix && mkdir /app
# USER remix

# #Now do remix stuff
# USER remix
WORKDIR /home/remix

COPY ./ ./

WORKDIR /home/remix/remix
# npm ci would probably be better
RUN npm install
RUN npm run build

EXPOSE 8080 65520

CMD ["npm", "run", "serve"]
9 changes: 9 additions & 0 deletions ci/build_and_publish_docker_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

# If not staging and master branch are existing
export TAG="$CIRCLE_BRANCH"

docker login --username $DOCKER_USER --password $DOCKER_PASS
docker-compose build
docker push remixproject/remix-ide:$TAG
18 changes: 18 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3.7"
x-project-base:
&project-base
restart: always
networks:
- remixide

networks:
remixide:

services:
remixide:
<<: *project-base
image: remixproject/remix-ide:$TAG
container_name: remixide-${TAG}
build:
context: .
dockerfile: Dockerfile.dev