Skip to content

Commit

Permalink
services version bump
Browse files Browse the repository at this point in the history
npm ci publish fix

npm publish requires lint and tests

deploy.sh cleanup
  • Loading branch information
DeFiYaco committed Jan 20, 2021
1 parent 87bfe97 commit d4bfa43
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 134 deletions.
208 changes: 101 additions & 107 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
aliases:
- &docker-base
docker:
- image: circleci/node:10.19.0-buster
steps:
docker:
- image: circleci/node:10.19.0-buster
steps:
- checkout
- run:
name: "Pull Submodules"
Expand All @@ -11,87 +11,57 @@ aliases:
git submodule update --remote
- setup_remote_docker
- run:
name: Build and push docker images
command: |
CIRCLE_BRANCH=${CIRCLE_BRANCH} ./scripts/build_and_publish_docker_images.sh
- &deploy-base
docker:
- image: circleci/node:10.19.0-buster
steps:
- checkout
- setup_remote_docker
- add_ssh_keys:
fingerprints:
- "a9:2f:97:c3:64:10:80:c7:8e:2f:db:f7:a3:4a:53:66"
- run:
name: Deploy
no_output_timeout: 30m
name: Build and push docker images
command: |
CIRCLE_BRANCH=${CIRCLE_BRANCH} ./scripts/deploy.sh
CIRCLE_BRANCH=${CIRCLE_BRANCH} ./scripts/build_and_publish_docker_images.sh
- &filter-base
filters:
branches:
only:
filters:
branches:
only:
- staging
- master
- &node-base
working_directory: ~/source-verify
docker:
- image: circleci/node
- image: circleci/node
parameters:
run_coveralls:
type: boolean
default: false
steps:
- run:
name: Versions
command: npm version
- checkout
# Caching is disabled because lerna does not like cached node_modules
# - restore_cache:
# key: dependency-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
- run:
name: install-npm
command: npx lerna bootstrap
- run:
name: lint
command: npm run lint
- run:
name: tsc and test
command: npx lerna run build && npx lerna run test
# - save_cache:
# key: dependency-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
# paths:
# - ./node_modules
- run:
name: Versions
command: npm version
- checkout
- run:
name: install dependencies
command: npx lerna bootstrap
- run:
name: lint
command: npm run lint
- run:
name: tsc and test
command: npx lerna run build && npx lerna run test
- &monitor-e2e-base
working_directory: ~/source-verify
docker:
- image: circleci/node
- image: circleci/node
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
- run:
name: install-npm
command: npm install
- run:
name: monitor test
command: npm run monitor:ci
no_output_timeout: 30m
- save_cache:
key: dependency-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
paths:
- ./node_modules
- &npm-publish-base
working_directory: ~/source-verify
docker:
- image: circleci/node
steps:
- checkout
- run:
name: Publish npm package
command: ./scripts/publish_to_npm.sh

- checkout
- restore_cache:
key: dependency-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
- run:
name: install-npm
command: npm install
- run:
name: monitor test
command: npm run monitor:ci
no_output_timeout: 30m
- save_cache:
key: dependency-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
paths:
- ./node_modules

version: 2
workflows:
version: 2
Expand All @@ -101,71 +71,72 @@ workflows:
filters:
branches:
only:
- staging
- master
# - build-push-localchain:
# filters:
# branches:
# only:
# - staging
# - master
- staging
- master
- build-push-monitor:
filters:
branches:
only:
- staging
- master
- staging
- master
- build-push-repository:
filters:
branches:
only:
- staging
- master
- staging
- master
- build-push-s3:
filters:
branches:
only:
- staging
- master
- staging
- master
- build-push-server:
filters:
branches:
only:
- staging
- master
- staging
- master
- build-push-ui:
filters:
branches:
only:
- staging
- master
- staging
- master
- deploy:
filters:
branches:
only:
- staging
- master
- staging
- master
requires:
- build-push-ipfs
# - build-push-localchain
- build-push-monitor
- build-push-repository
- build-push-s3
- build-push-server
- build-push-ui
- build-push-ipfs
- build-push-monitor
- build-push-repository
- build-push-s3
- build-push-server
- build-push-ui
- monitor-e2e:
filters:
branches:
only:
- staging
- master
- staging
- master
requires:
- deploy
- deploy

node-multi-build:
jobs:
- node-v10
- node-v12
- npm-publish:
filters:
branches:
only:
- master
requires:
- node-v10
- node-v12

nightly:
triggers:
Expand All @@ -177,15 +148,14 @@ workflows:
- master
jobs:
- monitor-e2e

npm_package_publish:
jobs:
- npm-publish:
filters:
branches:
only:
- master

- master

jobs:
build-push-ipfs:
Expand Down Expand Up @@ -217,21 +187,45 @@ jobs:
environment:
SERVICE: "ui"
deploy:
<<: *deploy-base
docker:
- image: circleci/node:10.19.0-buster
steps:
- checkout
- setup_remote_docker
- add_ssh_keys:
fingerprints:
- "a9:2f:97:c3:64:10:80:c7:8e:2f:db:f7:a3:4a:53:66"
- run:
name: Deploy
no_output_timeout: 30m
command: |
CIRCLE_BRANCH=${CIRCLE_BRANCH} ./scripts/deploy.sh
node-v10:
<<: *node-base
docker:
- image: circleci/node:10
- image: circleci/node:10
node-v12:
<<: *node-base
docker:
- image: circleci/node:12
- image: circleci/node:12
environment:
run_coveralls: "true"
monitor-e2e:
<<: *monitor-e2e-base
docker:
- image: circleci/node:10
- image: circleci/node:10
npm-publish:
<<: *npm-publish-base

working_directory: ~/source-verify
docker:
- image: circleci/node:12
steps:
- checkout
- run:
name: install dependencies
command: npx lerna bootstrap
- run:
name: build everything
command: npx lerna run build
- run:
name: Publish npm package
command: ./scripts/publish_to_npm.sh
28 changes: 11 additions & 17 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
#!/bin/bash
set -e

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

if [ "$CIRCLE_BRANCH" == "staging" ]; then
export TAG='latest'
export REPO_PATH='/home/sourcify/staging/'
# Do ssh to server
ssh -o "StrictHostKeyChecking no" [email protected] "\
mkdir -p scripts && curl https://raw.githubusercontent.com/ethereum/source-verify/${CIRCLE_BRANCH}/scripts/setup.sh > scripts/setup.sh && chmod +x scripts/setup.sh && chown $USER:$USER ./scripts/setup.sh && \
REPO_PATH='${REPO_PATH}' CIRCLE_BRANCH='${CIRCLE_BRANCH}' TAG='${TAG}' ./scripts/setup.sh"
TAG='latest'
REPO_PATH='/home/sourcify/staging/'
SERVER='[email protected]'
elif [ "$CIRCLE_BRANCH" == "master" ]; then
TAG='stable'
REPO_PATH='/opt/source-verify/production/'
SERVER='[email protected]'
else
echo "Invalid branch $CIRCLE_BRANCH. Check your config.yml"
exit 1
fi

if [ "$CIRCLE_BRANCH" == "master" ]; then
export TAG='stable'
export REPO_PATH='/opt/source-verify/production/'
# Do ssh to server
ssh -o "StrictHostKeyChecking no" [email protected] "\
ssh -o "StrictHostKeyChecking no" $SERVER "\
mkdir -p scripts && curl https://raw.githubusercontent.com/ethereum/source-verify/${CIRCLE_BRANCH}/scripts/setup.sh > scripts/setup.sh && chmod +x scripts/setup.sh && chown $USER:$USER ./scripts/setup.sh && \
REPO_PATH='${REPO_PATH}' CIRCLE_BRANCH='${CIRCLE_BRANCH}' TAG='${TAG}' ./scripts/setup.sh"
fi


2 changes: 1 addition & 1 deletion services/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions services/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethereum-sourcify/core",
"version": "0.1.3",
"version": "0.2.0",
"description": "Sourcify core module with common interfaces, types and methods",
"bin": {
"sourcify-core": "./build/index.js"
Expand All @@ -15,7 +15,6 @@
},
"main": "build/index.js",
"scripts": {
"prepublishOnly": "npm ci && npm run build",
"test": "echo \"Error: no test specified\"",
"build": "rimraf ./build && tsc",
"start": "npm run build && node build/index.js"
Expand Down
2 changes: 1 addition & 1 deletion services/validation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions services/validation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethereum-sourcify/validation",
"version": "0.1.3",
"version": "0.2.0",
"description": "Pre-verification module to check if files are valid and ready to be submitted for verification",
"bin": {
"sourcify-validation": "./build/index.js"
Expand All @@ -14,7 +14,6 @@
},
"main": "build/index.js",
"scripts": {
"prepublishOnly": "npm ci && npm run build",
"test": "npm run build && mocha",
"build": "rimraf ./build && tsc",
"start": "npm run build && node build/index.js"
Expand Down
Loading

0 comments on commit d4bfa43

Please sign in to comment.