Skip to content

Commit

Permalink
Deploy Staging into Production (#506)
Browse files Browse the repository at this point in the history
* update ual dependencies (#503)

* fix(UAL): update ual dependencies

* fix(UAL): add logic to bp file

* Update project dependencies (#504)

* fix(FE): update dependencies

* fix(FE): remove eslint config options

* configure a storageclass for the eos rate. refs #509 (#510)

* Remove HoC (#513)

* fix(FE): update dependencies

* fix(FE): remove HoCs

* fix(FE): use Hook instead HoC

* fix(FE): fix multiple callback to get_account UAL

* fix(FE): clear eslintrc file

* fix(FE): code review

* Create versioning and release workflow (#512)

* create releasing and versioning of eos-rate. refs #511

* fix development branch in release documentation. refs #511

* add link to relase documentation in the readme. refs #511

Co-authored-by: Teto Gomez <[email protected]>
Co-authored-by: Andres Gomez <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2021
1 parent b333e51 commit 20ed4fe
Show file tree
Hide file tree
Showing 108 changed files with 7,075 additions and 6,984 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/push-master-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build images from latest master branch

on:
push:
branches:
- master
tags:
- v*

jobs:
create-master-image:
Expand Down Expand Up @@ -87,7 +87,9 @@ jobs:
with:
args: apply -f build_k8s -n mainnet-eosrate

# - name: Verify deployment
# id: verify_deployment
# run: |
# kubectl rollout status deployment/hapi
- name: Create Release
id: create_release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
57 changes: 57 additions & 0 deletions docs/create-a-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Creating a new release

These are the steps:
```bash
# Set and replace the version you need to tag and deploy
VERSION='v0.1.x'

# Checked out into develop branch
git checkout staging

# Fetched all remote updates
git remote update

# Update local develop branch with remote copy
git pull origin staging

# Created a release branch that tracks origin/develop
git checkout -b release/$VERSION origin/staging

# Pushed release branch to remote repository
git push origin release/$VERSION

# Opened a "pull request" in GitHub for team to verify the release

# Checkout into master branch
git checkout master

# Updated local master branch with remote copy
git pull origin master

# Merged release branch into master branch
git merge release/$VERSION

# Tagged the release point by creating a new tag
git tag -a $VERSION -m "Create release tag $VERSION"

# Pushed master branch to remote repository
git push origin master

# Pushed the tags to remote repository
git push origin --tags

# Checkout into develop branch
git checkout staging

# Merged release branch into develop branch
git merge release/$VERSION

# Pushed develop branch to remote repository
git push origin staging

# Removed release branch from the local repository
git branch -D release/$VERSION

# Removed release branch from the remote repository
git push origin :release/$VERSION
```
2 changes: 1 addition & 1 deletion kubernetes/postgres-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
name: postgres
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: jungle
storageClassName: eosrate-storage
resources:
requests:
storage: 100Gi
14 changes: 14 additions & 0 deletions kubernetes/storageclass.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: eosrate-storage
labels:
version: ${VERSION}
parameters:
fromBackup: ""
numberOfReplicas: "1"
staleReplicaTimeout: "2880"
provisioner: driver.longhorn.io
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Each EOS account can submit their rating for each BP as many times as they like
- [Development Setup](#development-setup)
- [Install Global Dependencies](#install-global-dependencies)
- [Run EOS Rate on your Computer](#run-eos-rate-on-your-computer)
- [Create a new release](docs/create-a-release.md)
- [Design Assets](#design-assets)
- [Contributing](#contributing)
- [About EOS Costa Rica](#about-eos-costa-rica)
Expand Down
10 changes: 7 additions & 3 deletions services/frontend/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
REACT_APP_GRAPHQL_HTTP_URL=https://graphql-jungle.eosrate.io/v1alpha1/graphql
REACT_APP_API_URL=https://jungle.eosio.cr
REACT_APP_GRAPHQL_HTTP_URL=http://localhost:8088/v1alpha1/graphql
REACT_APP_GRAPHQL_WS_URL=ws://localhost:8088/v1alpha1/graphql
REACT_APP_EOS_API_URL=https://jungle.eosio.cr
REACT_APP_GRAPHQL_WS_URL=wss://graphql-jungle.eosrate.io/v1alpha1/graphql
REACT_APP_EOS_API_URL=https://jungle.eosio.cr
REACT_APP_EOS_API_HOST=jungle.eosio.cr
REACT_APP_EOS_API_PORT=443
REACT_APP_EOS_API_PROTOCOL=https
REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
2 changes: 1 addition & 1 deletion services/frontend/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ REACT_APP_EOS_API_URL=https://jungle.eosio.cr
REACT_APP_EOS_API_HOST=jungle.eosio.cr
REACT_APP_EOS_API_PORT=443
REACT_APP_EOS_API_PROTOCOL=https
REACT_APP_EOS_CHAIN_ID=e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473
REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
10 changes: 8 additions & 2 deletions services/frontend/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"parser": "babel-eslint",
"extends": [
"standard",
"standard-react"
"standard-react",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
},
"rules": {
"multiline-ternary": "off",
"space-before-function-paren": "off"
}
}
56 changes: 32 additions & 24 deletions services/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@
"now-start": "serve --single ./build"
},
"dependencies": {
"@eoscostarica/eoscr-components": "^1.0.5",
"@eoscostarica/eoscr-components": "^3.1.0",
"@material-ui/core": "^4.9.12",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.51",
"@reach/router": "^1.3.3",
"@rematch/core": "^1.4.0",
"@rematch/persist": "^1.1.6",
"@rematch/core": "^2.0.0",
"@rematch/persist": "^2.0.0",
"apollo-cache-inmemory": "^1.6.5",
"apollo-client": "^2.6.8",
"apollo-link": "^1.2.13",
"apollo-link-http": "^1.5.16",
"apollo-link-ws": "^1.0.19",
"apollo-utilities": "^1.3.3",
"babel-loader": "~8.0.6",
"babel-loader": "~8.1.0",
"chart.js": "^2.9.3",
"classnames": "^2.2.6",
"env-cmd": "^10.1.0",
"eosjs": "^20.0.3",
"eosjs": "^21.0.3",
"filter-objects": "^2.1.1",
"graphql": "^14.6.0",
"graphql": "^15.5.0",
"graphql-tag": "^2.10.3",
"i18n-iso-countries": "^5.0.0",
"i18n-iso-countries": "^6.5.0",
"i18next": "^19.3.2",
"i18next-browser-languagedetector": "^4.0.2",
"i18next-browser-languagedetector": "^6.0.1",
"lodash.get": "^4.4.2",
"lodash.isempty": "^4.4.0",
"lodash.set": "^4.3.2",
Expand All @@ -53,13 +53,13 @@
"qs": "^6.9.1",
"random-color-rgb": "^1.1.1",
"rc-slider": "^9.2.2",
"react": "^16.13.0",
"react": "17.0.1",
"react-apollo": "^3.1.3",
"react-autosuggest": "^9.4.3",
"react-autosuggest": "^10.1.0",
"react-chartjs-2": "^2.9.0",
"react-dom": "16.13.0",
"react-ga": "^2.7.0",
"react-helmet": "^5.2.1",
"react-dom": "17.0.1",
"react-ga": "^3.3.0",
"react-helmet": "^6.1.0",
"react-highlighter": "^0.4.3",
"react-i18next": "^11.3.3",
"react-placeholder": "^4.0.0",
Expand All @@ -69,27 +69,35 @@
"serve": "^11.3.0",
"subscriptions-transport-ws": "^0.9.16",
"text-encoding": "^0.7.0",
"ual-anchor": "^0.5.0",
"ual-anchor": "^1.0.0",
"ual-ledger": "^0.3.0",
"ual-lynx": "^0.4.0",
"ual-meetone": "^0.1.1",
"ual-reactjs-renderer": "^0.3.1",
"ual-scatter": "^0.3.0",
"ual-token-pocket": "^0.3.0",
"yup": "0.28.3"
"yup": "0.32.9"
},
"devDependencies": {
"eslint-config-standard": "^14.1.0",
"eslint-config-standard-react": "^9.2.0",
"eslint-config-prettier": "^8.0.0",
"eslint-config-standard": "^16.0.2",
"eslint-config-standard-react": "^11.0.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-standard": "^4.0.1",
"husky": "^4.2.3",
"eslint-plugin-standard": "^5.0.0",
"husky": "^5.1.1",
"lint-staged": "^10.0.8",
"prettier": "^1.19.1",
"pretty-quick": "^2.0.1",
"react-scripts": "3.4.0",
"snazzy": "^8.0.0",
"standard": "^14.3.1"
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0",
"react-scripts": "4.0.2",
"snazzy": "^9.0.0",
"standard": "^16.0.3"
},
"resolutions": {
"react": "17.0.1",
"react-dom": "17.0.1",
"**/react": "17.0.1",
"**/react-dom": "17.0.1"
},
"lint-staged": {
"*.js": [
Expand Down
43 changes: 19 additions & 24 deletions services/frontend/src/app.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { useSelector } from 'react-redux'
import { Router } from '@reach/router'

import Spinner from 'components/spinner'
import Layout from 'components/layout'
import NotFound from 'routes/not-found'
import routes from 'routes'

const App = ({ isContentLoading, ual }) => (
<>
<Spinner isLoading={isContentLoading} />
<Layout ual={ual}>
<Router>
{routes.map(({ path, Component }) => (
<Component key={`path-${path}`} path={path} ual={ual} />
))}
<NotFound default />
</Router>
</Layout>
</>
)
const App = ({ ual }) => {
const { isContentLoading } = useSelector((state) => state.isLoading)

App.propTypes = {
isContentLoading: PropTypes.bool,
ual: PropTypes.object
return (
<>
<Spinner isLoading={isContentLoading} />
<Layout ual={ual}>
<Router>
{(routes || []).map(({ path, Component }) => (
<Component key={`path-${path}`} path={path} ual={ual} />
))}
<NotFound default />
</Router>
</Layout>
</>
)
}

App.defaultProps = {
isContentLoading: false
App.propTypes = {
ual: PropTypes.object
}

const mapStateToProps = state => ({
isContentLoading: state.isLoading.isContentLoading
})

export default connect(mapStateToProps, null)(App)
export default App
Loading

0 comments on commit 20ed4fe

Please sign in to comment.