-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script infrastructure with Terraform. Utilise Bitbucket Pipelines for…
… CI. Remove config.js nonsense and use env variables. Tidy webpack.configs. Update readme. Update packages. Use Yarn. Add Serverless Web API.
- Loading branch information
Showing
21 changed files
with
2,286 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"presets": ["latest", "react"], | ||
"plugins": [ | ||
"transform-runtime", | ||
"transform-inline-environment-variables", | ||
"transform-class-properties", | ||
"transform-object-rest-spread" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,16 @@ | ||
{ | ||
"extends": "airbnb", | ||
"env": { | ||
"browser": true, | ||
"mocha": true, | ||
"node": true, | ||
"es6": true | ||
extends: "airbnb", | ||
env: { | ||
browser: true, | ||
node: true, | ||
es6: true | ||
}, | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true, | ||
"experimentalObjectRestSpread": true, | ||
}, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"no-const-assign": 1, | ||
"no-extra-semi": 0, | ||
"semi": 0, | ||
"no-fallthrough": 0, | ||
"no-empty": 0, | ||
"no-mixed-spaces-and-tabs": 0, | ||
"no-redeclare": 0, | ||
"no-this-before-super": 1, | ||
"no-undef": 1, | ||
"no-unreachable": 1, | ||
"no-unused-vars": 1, | ||
"no-use-before-define": 0, | ||
"constructor-super": 1, | ||
"curly": 0, | ||
"eqeqeq": 0, | ||
"func-names": 0, | ||
"valid-typeof": 1 | ||
} | ||
parser: "babel-eslint", | ||
rules: { | ||
max-len: ["error", 120, 2], | ||
react/jsx-filename-extension: ["error", { extensions: [".js", ".jsx"] }], | ||
react/forbid-prop-types: 0, | ||
jsx-a11y/no-static-element-interactions: 0, | ||
import/no-extraneous-dependencies: ["error", { devDependencies: true }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ node_modules | |
npm-debug.log | ||
.DS_Store | ||
index.html | ||
semaphore | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
# [603.nu](https://603.nu) | ||
|
||
[](https://semaphoreci.com/jch254/603-nu) | ||
|
||
Source code for https://603.nu. | ||
|
||
## Build | ||
1. Run the following commands in the app's root directory then check the /dist folder | ||
``` | ||
npm install | ||
npm run build | ||
yarn install | ||
yarn run build | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
image: jch254/docker-node-terraform-aws:latest | ||
pipelines: | ||
branches: | ||
master: | ||
- step: | ||
script: | ||
- export AWS_ACCESS_KEY_ID=$AWS_KEY | ||
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET | ||
- export AWS_DEFAULT_REGION=$AWS_REGION | ||
- ./build-artifacts.bash | ||
- ./deploy-infrastructure.bash | ||
- ./upload-artifacts.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
yarn install | ||
export NODE_ENV=production | ||
yarn run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import React from 'react' | ||
import React from 'react'; | ||
|
||
import Head from './Head' | ||
import Header from './Header' | ||
import Main from './Main' | ||
import Footer from './Footer' | ||
import Head from './Head'; | ||
import Header from './Header'; | ||
import Main from './Main'; | ||
import Footer from './Footer'; | ||
|
||
const App = () => ( | ||
<html> | ||
<html lang="en"> | ||
<Head title="603.nu | Web Experiments" /> | ||
<body> | ||
<Header /> | ||
<Main /> | ||
<Footer /> | ||
</body> | ||
</html> | ||
) | ||
); | ||
|
||
export default App | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
import React from 'react' | ||
import React from 'react'; | ||
import { | ||
Banner, | ||
Heading, | ||
} from 'rebass' | ||
} from 'rebass'; | ||
|
||
const Header = () => ( | ||
<Banner | ||
style={{ minHeight: '75vh', backgroundAttachment: 'scroll' }} | ||
backgroundImage="./img/Wolf.jpg" | ||
m={0} | ||
> | ||
<Heading size={1} big children="603.nu" /> | ||
<Heading size={2} children="Web Experiments" /> | ||
<Heading size={1} big> | ||
603.nu | ||
</Heading> | ||
<Heading size={2}> | ||
Web Experiments | ||
</Heading> | ||
</Banner> | ||
) | ||
); | ||
|
||
export default Header | ||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export TF_VAR_route53_zone_id=$ROUTE53_ZONE_ID | ||
export TF_VAR_acm_arn=$ACM_ARN | ||
|
||
cd infrastructure | ||
terraform remote config -backend=s3 \ | ||
-backend-config="bucket=603-terraform-remote-state" \ | ||
-backend-config="key=603.nu.tfstate" \ | ||
-backend-config="region=ap-southeast-2" \ | ||
-backend-config="encrypt=true" | ||
|
||
terraform plan -var-file 603.nu.tfvars | ||
terraform apply -var-file 603.nu.tfvars | ||
cd .. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.