Skip to content

Instantly share code, notes, and snippets.

@torchhound
Last active November 2, 2017 21:49
Show Gist options
  • Save torchhound/1ffeec980d85c8183830cbcdc758474e to your computer and use it in GitHub Desktop.
Save torchhound/1ffeec980d85c8183830cbcdc758474e to your computer and use it in GitHub Desktop.
purescript-pux-codedeploy
# deploy/after_install
#!/bin/bash
sudo systemctl reload nginx
version: 0.0
os: linux
files:
- source: static/
destination: /var/www/html/static/
hooks:
BeforeInstall:
- location: deploy/before_install.sh
timeout: 300
runas: admin
AfterInstall:
- location: deploy/after_install.sh
timeout: 300
runas: admin
# deploy/before_install
#!/bin/bash
sudo rm -rf /var/www/html/static
sudo mkdir /var/www/html/static
version: 0.1
phases:
install:
commands:
- apt-get update -y
- apt-get install -y curl
- apt-get purge nodejs npm
- curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- apt-get install -y nodejs
- node --version
pre_build:
commands:
- echo Installing dependencies
- npm install
- npm install -g bower
- bower install --allow-root
build:
commands:
- echo Build started
- npm run build
post_build:
commands:
- echo Build completed
artifacts:
files:
- static/index.html
- static/index.css
- static/images/*
- static/dist/bundle.js
- appspec.yml
- deploy/before_install.sh
- deploy/after_install.sh
discard-paths: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment