Skip to content

Commit

Permalink
Feat: add gitlab ci (#209)
Browse files Browse the repository at this point in the history
* feat: add ci

* fix: ci

* fix: ci

* fix: ci

* fix: chmod script

* feat: move .ci to webapp

* feat: add envs
  • Loading branch information
nachomazzara committed Jul 30, 2020
1 parent 13317c7 commit 506903d
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
image: decentraland/ci-node:latest

build:
only:
- master
- staging
- release
script:
- cd webapp
- ./setupEnv.sh
- npm install && npm run build
- dcl-lock-sync
- cd .ci && npm install && dcl-up website-market
- dcl-sync-release && cd ..
- dcl-upload build
- cd .ci && dcl-cache-invalidation
17 changes: 17 additions & 0 deletions webapp/.ci/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ALL
REACT_APP_NETWORK=ropsten
REACT_APP_BUY_MANA_URL=https://google.com
REACT_APP_MARKETPLACE_ADAPTER_FEE_PER_MILLION=25000
REACT_APP_MAX_PRICE_INCREASE_PERCENTAGE=15
# ROPSTEN
# APIs
REACT_APP_MARKETPLACE_URL=https://api.thegraph.com/subgraphs/name/decentraland/marketplace-ropsten
REACT_APP_LAND_URL=https://api.decentraland.zone/v1
REACT_APP_COINGECKO_API_URL=https://api.coingecko.com/api/v3
REACT_APP_SUPER_RARE_API_URL=https://dev.pixura.io/sr-json/v0
REACT_APP_SUPER_RARE_API_KEY=eyJhbGciOiJIUzUxMiJ9.eyJkYXQiOiJEQ0wifQ.UADwL-MaLbS4NmMIGc87iztzGIttxQ0rVCRCRYBHYMs4CKySywpb0esh68lgcHxb6hODxLHEJjNxgwdPATLkfg
REACT_APP_MAKERS_PLACE_API_URL=https://makersplace.com/api
# Tokens
REACT_APP_MANA_ADDRESS=0x2a8fd99c19271f4f04b1b7b9c4f7cf264b626edb
REACT_APP_CONVERTER_ADDRESS=0x2782eb28Dcb1eF4E7632273cd4e347e130Ce4646
REACT_APP_CONVERTER_EXCHANGE=uniswap
21 changes: 21 additions & 0 deletions webapp/.ci/.env.prd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Network
REACT_APP_NETWORK=mainnet
# Settings
REACT_APP_BUY_MANA_URL=https://kyberswap.com/swap/eth-mana
# APIs
REACT_APP_MARKETPLACE_URL=https://api.thegraph.com/subgraphs/name/decentraland/marketplace
REACT_APP_LAND_URL=https://api.decentraland.org/v1
REACT_APP_COINGECKO_API_URL=https://api.coingecko.com/api/v3
REACT_APP_SUPER_RARE_API_URL=https://superrare.co/sr-json/v0
REACT_APP_SUPER_RARE_API_KEY=eyJhbGciOiJIUzUxMiJ9.eyJkYXQiOiJEQ0wifQ.UADwL-MaLbS4NmMIGc87iztzGIttxQ0rVCRCRYBHYMs4CKySywpb0esh68lgcHxb6hODxLHEJjNxgwdPATLkfg
REACT_APP_MAKERS_PLACE_API_URL=https://makersplace.com/api
REACT_APP_CONVERTER_EXCHANGE=kyber_network
# Market
REACT_APP_MARKETPLACE_ADAPTER_FEE_PER_MILLION=25000
REACT_APP_MAX_PRICE_INCREASE_PERCENTAGE=15
# Tokens
REACT_APP_MANA_ADDRESS=0x0f5d2fb29fb7d3cfee444a200298f468908cc942
REACT_APP_CONVERTER_ADDRESS=0x2859581da59bd4e16a866dd06b461b76d8e489a4
# Third party
REACT_APP_INTERCOM_APP_ID=z0h94kay
REACT_APP_SEGMENT_API_KEY=HiNNHH80CETcqzfPBY4jJgJJlFAWbzNp
21 changes: 21 additions & 0 deletions webapp/.ci/.env.stg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Network
REACT_APP_NETWORK=mainnet
# Settings
REACT_APP_BUY_MANA_URL=https://kyberswap.com/swap/eth-mana
# APIs
REACT_APP_MARKETPLACE_URL=https://api.thegraph.com/subgraphs/name/decentraland/marketplace
REACT_APP_LAND_URL=https://api.decentraland.org/v1
REACT_APP_COINGECKO_API_URL=https://api.coingecko.com/api/v3
REACT_APP_SUPER_RARE_API_URL=https://superrare.co/sr-json/v0
REACT_APP_SUPER_RARE_API_KEY=eyJhbGciOiJIUzUxMiJ9.eyJkYXQiOiJEQ0wifQ.UADwL-MaLbS4NmMIGc87iztzGIttxQ0rVCRCRYBHYMs4CKySywpb0esh68lgcHxb6hODxLHEJjNxgwdPATLkfg
REACT_APP_MAKERS_PLACE_API_URL=https://makersplace.com/api
REACT_APP_CONVERTER_EXCHANGE=kyber_network
# Market
REACT_APP_MARKETPLACE_ADAPTER_FEE_PER_MILLION=25000
REACT_APP_MAX_PRICE_INCREASE_PERCENTAGE=15
# Tokens
REACT_APP_MANA_ADDRESS=0x0f5d2fb29fb7d3cfee444a200298f468908cc942
REACT_APP_CONVERTER_ADDRESS=0x2859581da59bd4e16a866dd06b461b76d8e489a4
# Third party
REACT_APP_SEGMENT_API_KEY=
REACT_APP_INTERCOM_APP_ID=
1 change: 1 addition & 0 deletions webapp/.ci/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions webapp/.ci/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: market-static
runtime: nodejs
description: Website for the market
15 changes: 15 additions & 0 deletions webapp/.ci/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { env, envTLD } from 'dcl-ops-lib/domain'
import { buildStatic } from 'dcl-ops-lib/buildStatic'

async function main() {
const market = buildStatic({
domain: `market.decentraland.${env === 'prd' ? 'org' : envTLD}`,
defaultPath: 'index.html',
})

return {
cloudfrontDistribution: market.cloudfrontDistribution,
bucketName: market.contentBucket,
}
}
export = main
14 changes: 14 additions & 0 deletions webapp/.ci/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "market-static",
"devDependencies": {
"@types/node": "^14.0.13"
},
"dependencies": {
"@pulumi/aws": "^2.9.1",
"@pulumi/awsx": "^0.20.0",
"@pulumi/eks": "^0.19.2",
"@pulumi/kubernetes": "^2.3.1",
"@pulumi/pulumi": "^2.4.0",
"dcl-ops-lib": "^3.1.7"
}
}
17 changes: 17 additions & 0 deletions webapp/.ci/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"strict": true,
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true
},
"include": ["*.ts", "**/*.ts"]
}
6 changes: 6 additions & 0 deletions webapp/setupEnv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /bin/bash

set -e

source dcl-env
cp .ci/.env.${ENVIRONMENT} .env

0 comments on commit 506903d

Please sign in to comment.