0.0.14 • Published 7 years ago
marco-cloud-wallet v0.0.14
Marco Cloud Wallet
Environment Variables Configuration
View required variables on .env.example
Secure Build
Create KMS Keys to encrypt sensitive files and variables and configure it to be available at build by cloudbuild.yaml
gcloud kms keyrings create finboot-marco-prod  --location=global --project=finboot-kms-resources
gcloud kms keys create finboot-marco-cloud-wallet-cloudbuild-secrets --location=global --keyring=finboot-marco-prod --purpose=encryption --project=finboot-kms-resources
gcloud kms keys add-iam-policy-binding finboot-marco-cloud-wallet-cloudbuild-secrets --location=global --keyring=finboot-marco-prod --member=serviceAccount:274913361067@cloudbuild.gserviceaccount.com --role=roles/cloudkms.cryptoKeyEncrypterDecrypter --project=finboot-kms-resourcesEncrypt NPM Token
gcloud kms encrypt \
  --plaintext-file=.npmtoken \
  --ciphertext-file=.npmtoken-prod.enc \
  --location=global \
  --keyring=finboot-marco-prod \
  --key=finboot-marco-cloud-wallet-cloudbuild-secrets \
  --project=finboot-kms-resourcesBuild project
npm install yarn -g
npm run presetup
npm run setup
npm start buildDocker Image Deployment
Build Docker Image
export NPM_TOKEN=$(cat .npmtoken)
sudo docker run --name test-db -e MYSQL_DATABASE=mysql-db -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_ROOT_PASSWORD=toor -p 3306:3306 -d mysql:5.7
sudo docker build --network host --build-arg NPM_TOKEN=$NPM_TOKEN -t finboot/marco-cloud-wallet .
sudo docker tag finboot/marco-cloud-wallet eu.gcr.io/marco-prod/marco-cloud-wallet:latest
sudo gcloud docker -- push eu.gcr.io/marco-prod/marco-cloud-wallet:latest
sudo docker rm -f test-dbMigrations
Generate migrations from src
ts-node ./node_modules/typeorm/cli.js migrations:generateNote: ./node_modules/typeorm/cli.js is the project local binary of typeorm.
Run generated migrations
npm start db.migrateRevert database
npm start db.revertDrop database
npm start db.dropSeeding Database
npm start db.seedDevelopment
The server address will be displayed to you as http://0.0.0.0:8080.
cp .env.example .envStart DB with Docker:
docker-compose up -dStart Application:
npm start serveTests
- Run the unit tests using npm start test.unit.
- Run the integration tests using npm start test.integration.
- Run the e2e tests using npm start test.e2e.
Docker Launch
Create .env file from .env.example and configure it.
cp .env.example .envBuild Docker Image
docker build -t finboot/marco-resource-deployer .Stat App with Docker
docker run --name explorer-app --env-file .env -d finboot/marco-resource-deployer0.0.14
7 years ago