HsuTing / generator-cat

Generate project.
MIT License
2 stars 2 forks source link

auto deploy #62

Open HsuTing opened 6 years ago

HsuTing commented 6 years ago

https://github.com/HsuTing/notes/issues/10 https://github.com/HsuTing/notes/issues/60

HsuTing commented 6 years ago

Heroku

wget https://cli-assets.heroku.com/branches/stable/heroku-linux-amd64.tar.gz mkdir -p /usr/local/lib /usr/local/bin tar -xvzf heroku-linux-amd64.tar.gz -C /usr/local/lib ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku

cat > ~/.netrc << EOF machine api.heroku.com login $EMAIL password $HEROKU_API_KEY EOF

cat >> ~/.ssh/config << EOF VerifyHostKeyDNS yes StrictHostKeyChecking no EOF

HsuTing commented 6 years ago

hjb# Godaddy

files

install node

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash . ~/.bashrc nvm install node

install yarn

curl -o- -L https://yarnpkg.com/install.sh | bash echo "export PATH=\"\$HOME/.yarn/bin:\$HOME/.config/yarn/global/node_modules/.bin:\$PATH\"" >> ~/.bashrc . ~/.bashrc

install pm2

yarn global add pm2

add .htaccess

rm ~/public_html/.htaccess cat <> ~/public_html/.htaccess Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^index.html.var\$ "http://localhost:8000/" [P] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\$ "http://localhost:8000/\$1" [P] EOT


- ecosystem.json
```json
{
  "apps" : [{
    "name": "server",
    "script": "lib/server.js",
    "env": {
      "PORT": 8000
    }   
  }], 
  "deploy": { 
    "production": { 
      "user": "<user>",
      "host": ["<host>"],
      "ref": "origin/master",
      "repo": "git@github.com:<user name>/<project name>.git",
      "path": "/home/<user>",
      "ssh_options": "StrictHostKeyChecking=no",
      "pre-setup": "./.circleci/setup-godaddy.sh",
      "post-setup": "ls -la",
      "post-deploy": "yarn install; yarn prod; pm2 startOrRestart ecosystem.json"
    }   
  }
}
HsuTing commented 6 years ago

add cache to travis

HsuTing commented 6 years ago

add export env to .circleci, .travis with files