From 270cbcf1157145dc3e53a359fe870e27d52f6e08 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Jun 2020 11:57:35 +0200 Subject: [PATCH] Updating cirleci config to add docker to docker hub for remix --- .circleci/config.yml | 28 ++++++++++++++++++++++++++- .env | 6 +++--- Dockerfile | 19 ++++++++++++++++++ Dockerfile.dev | 20 +++++++++++++++++++ ci/build_and_publish_docker_images.sh | 9 +++++++++ docker-compose.yaml | 18 +++++++++++++++++ 6 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 Dockerfile create mode 100644 Dockerfile.dev create mode 100755 ci/build_and_publish_docker_images.sh create mode 100644 docker-compose.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c921ed1c3..ea5aeda39e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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 @@ -190,4 +216,4 @@ workflows: - remix-ide-run-deploy filters: branches: - only: master \ No newline at end of file + only: master diff --git a/.env b/.env index b08c745d22..c03ce830c2 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -gist_token = -account_passphrase = -account_password = \ No newline at end of file +gist_token= +account_passphrase= +account_password= diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..79d8a6a499 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000000..b5a988c9a7 --- /dev/null +++ b/Dockerfile.dev @@ -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"] diff --git a/ci/build_and_publish_docker_images.sh b/ci/build_and_publish_docker_images.sh new file mode 100755 index 0000000000..c9d197f98e --- /dev/null +++ b/ci/build_and_publish_docker_images.sh @@ -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 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000000..c9b5759611 --- /dev/null +++ b/docker-compose.yaml @@ -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