Skip to content

Commit

Permalink
start
Browse files Browse the repository at this point in the history
  • Loading branch information
zozi91 committed Apr 15, 2021
0 parents commit 9083bea
Show file tree
Hide file tree
Showing 2,285 changed files with 148,559 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
"transform-es2015-modules-commonjs"
]
}

3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*Dockerfile*
*docker-compose*
node_modules
1 change: 1 addition & 0 deletions .domains
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
localhost,.app.local,.openware.com,.devkube.com,.terakube.com,.openware.work
161 changes: 161 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
kind: pipeline
name: "Push"

concurrency:
limit: 2

steps:
- name: "Test & Build"
image: node:12.13.1
commands:
- export REACT_APP_GIT_SHA=$(git rev-parse --short HEAD)
- echo $REACT_APP_GIT_SHA > .tags
- export BUILD_DOMAIN=$(cat .domains)
- export BUILD_EXPIRE=$(date -d "+1 month" +%s000)
- npm -g install yarn
- yarn install
- yarn lint
- yarn test:ci --collectCoverage=true
- yarn build

- name: "Stage with mock server"
image: instrumentisto/rsync-ssh
environment:
PRIVATE_KEY:
from_secret: deploy_key
commands:
- echo "$PRIVATE_KEY" | base64 -d > id_rsa
- chmod 0600 id_rsa
- cd build/config/
- echo "window.env={api:{authUrl:'http://api-v2.mock.openware.work/api/v2/barong',tradeUrl:'http://api-v2.mock.openware.work/api/v2/peatio',applogicUrl:'http://api-v2.mock.openware.work/api/v2/applogic',rangerUrl:'ws://ranger.mock.openware.work/api/v2/ranger'}};" > env.js
- cat env.js
- cd /drone/src
- rsync -avzhre "ssh -i id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" build/ mock@mock.openware.work:/home/mock/builds/${DRONE_COMMIT_SHA:0:7}
- rsync -avzhre "ssh -i id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" coverage/ mock@mock.openware.work:/home/mock/builds/${DRONE_COMMIT_SHA:0:7}-coverage
- echo "http://${DRONE_COMMIT_SHA:0:7}.mock.openware.work"
- echo "http://${DRONE_COMMIT_SHA:0:7}-coverage.mock.openware.work"

- name: "Notify staging"
image: plugins/slack
settings:
webhook:
from_secret: baseapp_slack_webhook
channel:
from_secret: baseapp_slack_channel
template: >
{{#success build.status}}
[SUCCESS] (Base Application) Branch {{ build.branch }} by {{ build.author }} staging has succeeded!
Visit http://{{ truncate build.commit 7 }}.mock.openware.work to check it out!
Coverage report: http://{{ truncate build.commit 7 }}-coverage.mock.openware.work
{{else}}
[FAILURE] Branch {{ build.branch }} by {{ build.author }} staging has failed!
{{/success}}
Check the build info here: {{ build.link }}
when:
status: [success, failure]

trigger:
event:
- push
branch:
exclude:
- master
- "2-*-stable"

---
kind: pipeline
name: "New version"

concurrency:
limit: 2

steps:
- name: "Test"
image: node:12.13.1
commands:
- npm -g install yarn
- yarn install
- yarn lint
- yarn test:ci --collectCoverage=true

- name: "Bump & Tag"
image: quay.io/openware/sdk-citools:2.4.5
environment:
BRANCH_NAME: ${DRONE_BRANCH}
REPO_NAME: ${DRONE_REPO}
GITHUB_API_KEY:
from_secret: kite_bot_key
commands:
- BUNDLE_GEMFILE=/sdk/Gemfile bundle exec rake --rakefile=/sdk/Rakefile ci:prebuild


- name: "Build Docker image"
image: plugins/docker
settings:
environment:
REACT_APP_SENTRY_KEY:
from_secret: master_sentry_key
REACT_APP_SENTRY_ORGANIZATION:
from_secret: master_sentry_organization
REACT_APP_SENTRY_PROJECT:
from_secret: master_sentry_project
username:
from_secret: quay_username
password:
from_secret: quay_password
repo:
from_secret: quay_repo
registry: quay.io

- name: "Redeploy on master.devkube.com"
image: rubykube/microkube:0.2.0
environment:
WEBHOOK_JWT_SECRET:
from_secret: devkube_webhook_secret
DOCKER_REPO:
from_secret: quay_repo
commands:
- export latest_image=$DOCKER_REPO:$(cat .tags)
- cd /home/app
- bundle exec rake payload:send[frontend,$latest_image,http://$DRONE_BRANCH.devkube.com:1337]
when:
branch:
- master

- name: "Push and Notify"
image: quay.io/openware/sdk-citools:2.4.5
environment:
BOT_USERNAME: kite-bot
BOT_NAME: Kite Bot
BOT_EMAIL: kite-bot@heliostech.fr
BRANCH_NAME: ${DRONE_BRANCH}
SDK_BRANCH: ${DRONE_BRANCH}
REPO_NAME: ${DRONE_REPO}
TELEGRAM_BOT_TOKEN:
from_secret: baseapp_telegram_bot_token
TELEGRAM_CHAT_ID:
from_secret: baseapp_telegram_chat_id
SLACK_TOKEN:
from_secret: baseapp_slack_token
SLACK_CHANNEL:
from_secret: baseapp_slack_channel
GITHUB_API_KEY:
from_secret: kite_bot_key
commands:
- BUNDLE_GEMFILE=/sdk/Gemfile bundle exec rake --rakefile=/sdk/Rakefile ci:postbuild[/drone/src]
when:
branch:
- master
- "2-*-stable"

trigger:
branch:
- master
- "2-*-stable"
event:
- push

image_pull_secrets:
- dockerconfigjson
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/.npmrc

# dependencies
/node_modules

# testing
/coverage

# production
/build
/.idea

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.env
env.js

npm-debug.log*
yarn-debug.log*
yarn-error.log*
index.css

# environment config
public/config/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v10.11.0
15 changes: 15 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-order"
],
"rules": {
"at-rule-no-unknown": null,
"order/order": [
"custom-properties",
"declarations"
],
"order/properties-alphabetical-order": true,
"no-descending-specificity": null
}
}
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Playground test",
"type": "node",
"request": "launch",
"runtimeExecutable": "/usr/bin/node",
"runtimeArgs": [
"--inspect-brk",
"/usr/bin/yarn",
"test"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}
]
}
45 changes: 45 additions & 0 deletions .yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# test directories
__tests__
test
tests
powered-test

# asset directories
docs
doc
website
images
assets

# examples
example
examples

# code coverage directories
coverage
.nyc_output

# build scripts
Makefile
Gulpfile.js
Gruntfile.js

# configs
appveyor.yml
circle.yml
codeship-services.yml
codeship-steps.yml
wercker.yml
.tern-project
.gitattributes
.editorconfig
.*ignore
.eslintrc
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json
.travis.yml

# misc
*.md
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:12.13.1 AS builder

WORKDIR /home/node
COPY --chown=node:node . .

ARG BUILD_EXPIRE
ARG BUILD_DOMAIN
ARG REACT_APP_SENTRY_KEY=${REACT_APP_SENTRY_KEY:-""}
ARG REACT_APP_SENTRY_ORGANIZATION=${REACT_APP_SENTRY_ORGANIZATION:-""}
ARG REACT_APP_SENTRY_PROJECT=${REACT_APP_SENTRY_PROJECT:-""}

RUN npm i -g yarn

USER node

ENV REACT_APP_SENTRY_KEY=${REACT_APP_SENTRY_KEY}
ENV REACT_APP_SENTRY_ORGANIZATION=${REACT_APP_SENTRY_ORGANIZATION}
ENV REACT_APP_SENTRY_PROJECT=${REACT_APP_SENTRY_PROJECT}

RUN yarn install
RUN chmod -R 777 ./scripts/build.sh
RUN ./scripts/build.sh

FROM nginx:mainline-alpine

COPY --from=builder /home/node/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3000
Loading

0 comments on commit 9083bea

Please sign in to comment.