Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
webdif committed Dec 21, 2018
0 parents commit a8e19d9
Show file tree
Hide file tree
Showing 333 changed files with 28,218 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,102 @@
#############################################################################
# Javascript Node CircleCI 2.0 configuration file
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#############################################################################
version: 2
jobs:
build:
docker:
- image: circleci/node:8

working_directory: ~/deviensdev

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run:
name: Install dependencies
command: yarn install --pure-lockfile

- save_cache:
paths:
- node_modules
key: dependencies-{{ checksum "package.json" }}

# run tests!
- run:
name: Run tests
command: yarn test

# Deploy to preprod
test_and_deploy_preprod:
docker:
- image: circleci/node:8

steps:
- checkout

- add_ssh_keys:
fingerprints:
- $SSH_FINGERPRINT

- run:
name: Add to known_hosts
command: ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts

- run:
name: Deploy
command: |
git remote add preprod dokku@$SSH_HOST:deviensdev-preprod
git push preprod
# Deploy to prod
test_and_deploy_prod:
docker:
- image: circleci/node:8

steps:
- checkout

- add_ssh_keys:
fingerprints:
- $SSH_FINGERPRINT

- run:
name: Add to known_hosts
command: ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts

- run:
name: Deploy
command: |
git remote add prod dokku@$SSH_HOST:deviensdev-prod
git push prod
workflows:
version: 2

test_and_deploy:
jobs:
- build

- test_and_deploy_preprod:
requires:
- build

filters:
branches:
only: develop

- test_and_deploy_prod:
requires:
- build

filters:
branches:
only: master
12 changes: 12 additions & 0 deletions .dockerignore
@@ -0,0 +1,12 @@
.cache
CHANGELOG.md
.circleci
CONTRIBUTING.md
deploy
deploy-prebuilt
.git
.gitignore
LICENSE
node_modules
public
README.md
1 change: 1 addition & 0 deletions .env
@@ -0,0 +1 @@
DEVIENSDEV_GITHUB_TOKEN=6d71277b5c9d568970fcdba9b55c937915c12283
3 changes: 3 additions & 0 deletions .eslintignore
@@ -0,0 +1,3 @@
/public
/node_modules
/vendor
63 changes: 63 additions & 0 deletions .eslintrc
@@ -0,0 +1,63 @@
{
"parser": "babel-eslint",
"extends": [
"airbnb",
"prettier",
"prettier/react"
],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"plugins": [
"prettier",
"react",
"jsx-a11y",
"import",
"graphql"
],
"env": {
"browser": true
},
"globals": {
"graphql": true,
"config": true
},
"rules": {
# Style
"brace-style": ["error", "stroustrup", { allowSingleLine: true }],
"class-methods-use-this": "off",
"function-paren-newline": "off",
"import/prefer-default-export": "off",
"max-len": ["error", { ignorePattern: "\\s*<|\\s*className|^import|^\\s*\\{.*\\},$" }],
"no-console": "warn",
"no-debugger": "warn",
"no-irregular-whitespace": ["error", { skipTemplates: true }],
"no-mixed-operators": ["error", { allowSamePrecedence: true }],
"no-param-reassign": ["error", { props: false }],
"no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
"no-trailing-spaces": ["error", { skipBlankLines: true }],
"no-underscore-dangle": "off",
# Jsx a11y
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/anchor-is-valid": "off",
# React
"react/destructuring-assignment": "off",
"react/jsx-filename-extension": "off",
"react/no-danger": "off",
"react/forbid-prop-types": "off",
"react/no-unused-prop-types": "off"
},
settings: {
"import/core-modules": [
"react",
"prop-types"
],
"import/resolver": {
"node": {
"paths": ["./"]
}
}
}
}
15 changes: 15 additions & 0 deletions .gitignore
@@ -0,0 +1,15 @@
# Thumbs Files
.DS_Store
Thumbs.db

# Dependencies NPM / Yarn
/node_modules
/.cache

# Build Compiled.
/public

# Logs
/*.log

# Misc.
9 changes: 9 additions & 0 deletions .prettierignore
@@ -0,0 +1,9 @@
# Dependencies NPM / Yarn
/node_modules
/.cache

# Build Compiled.
/public

# Logs
/*.log
5 changes: 5 additions & 0 deletions .prettierrc
@@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,3 @@
# Changelog

**Ne pas oublier de changer le package.json**
112 changes: 112 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,112 @@
# Contribuer à DeviensDev

DeviensDev est une plateforme d’information sur le métier de développeur qui repose intégralement sur un système de contribution. Ainsi, tous les professionnels du développement qui souhaitent partager leurs connaissances, leurs visions et leur passion du métier sont invités avec plaisir à contribuer à la plateforme.

Si tu souhaites apporter ta pierre à l’édifice DeviensDev, tu peux écrire un article qui sera publié sur le blog de DeviensDev : ParlonsDev ! Jusque-là tu suis ?

Bien ! Pour ce faire, il y a quelques étapes à respecter :

## Tu souhaites proposer un article ?

### Comment contribuer :

- Tu fork le dépôt Github

- Tu crées une branche et tu te positionnes dessus

- `git checkout master`
- `git pull origin master` pour être sûr d'avoir la dernière version du code
- `git checkout -b le-nom-de-ma-branche` (remplace `le-nom-de-ma-branche` avec un nom approprié) pour créer une branche

- Tu crées ton article dans `content/blog/*`

- ⚠️ En respectant bien la convention du nom de fichier `<date>_<titre>/index.md` (par exemple `2018-09-25_devenir-developpeur/index.md`)
- Si jamais tu as un doute, tu peux t'inspirer des autres articles déjà présent

- Tu crées un fichier `.json` dans `content/authors/*` où tu peux y ajouter ton twitter et ta bio.

- ⚠️ En respectant bien la convention du nom de fichier qui doit avoir ton pseudo Github (par exemple `alexandrebourdeaudhui.json`)
- Là aussi, n'hésite pas à t'insipirer de ce que les autres ont déjà fait

### Pour tester le rendu de ton article, en local :

- `yarn` : pour installer les dépendances nécessaires
- `yarn start` : pour lancer le site en local
- `open http://localhost:8000` : pour ouvrir le site sur ton navigateur

### Une fois que tout est prêt :

- Tu push sur ta branche

- `git add -A && git commit -m "Mon message"` (remplace `Mon message` par un nom de commit approprié) pour commiter tes changemens

- Tu fais une demande de `pull-request` de ta branche vers notre branche `master`

- On fait une relecture de l’article pour corriger les éventuelles fautes d’orthographe

- Si des points sont à éclaircir, on en discute ensemble

- On planifie la publication

- On met en ligne l’article

## Tu souhaites corriger un article ?

Si tu souhaites corriger un article déjà en ligne, tu as le choix :

- Suivre la procédure décrite dans « Tu souhaites proposer un article »
- Le faire directement depuis l’interface Github

## Si tu ne sais pas comment t’y prendre…

N’hésite pas à ouvrir une issue sur le dépôt GitHub, et notre équipe viendra te filer un coup de main.

## Guidelines

### Début du fichier `.md`

```markdown
---
author: 'alexandrebourdeaudhui'
category: 'Lifestyle'
title: 'Télétravail : Témoignage de Bobine'
slug: 'teletravail-temoignage-bobine'
---
```

`Author` :
`Category` :
`Title` :
`Slug` :

### Titre

```markdown
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
```

### Sous-titre

```markdown
## Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
```

### Lien

```markdown
[DeviensDev](https://DeviensDev.com)
```

### Image

```markdown
![alt image](./path/to/image)
```

### Citation

```markdown
> Lorem ipsum dolor sit amet, consectetur adipisicing elit,
> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
```
38 changes: 38 additions & 0 deletions Dockerfile
@@ -0,0 +1,38 @@
FROM oclock/static-nginx-nodejs

# Workaround node-gyp requiring make, gcc, g++ & python:
RUN apk update && \
apk add --no-cache --update alpine-sdk python yarn

# Workaround for error: "ERR! sharp Use with musl libc requires manual installation of libvips >= 8.6.1"
# => http://sharp.pixelplumbing.com/en/stable/install/#alpine-linux
# RUN apk add vips-dev fftw-dev build-base --update-cache --repository https://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
# https://bugs.alpinelinux.org/issues/9561 => add edge/main for some of the sub-dependencies
# https://bugs.alpinelinux.org/issues/8087 => don't use https:// for --repository URLs
RUN apk add vips-dev fftw-dev build-base \
--update-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
--repository http://dl-3.alpinelinux.org/alpine/edge/main \
--allow-untrusted

COPY . /src
WORKDIR /src
RUN export $(cat .env | xargs)
ARG NODE_ENV=production

# COPY bin/production-build.sh /bin/production-build.sh
# RUN /bin/production-build.sh

# node-gyp is required by gatsby but not in the project's package.json (add it?)
RUN yarn global add node-gyp && \
yarn --pure-lockfile --non-interactive

# Building the static website :)
RUN rm -rf public .cache && \
./node_modules/.bin/gatsby build && \
mkdir -p /var/www && \
# Working around the * expansion limitation inside running containers not running commands through a shell.
# @see https://stackoverflow.com/questions/44390360/mv-command-throwing-error-but-executing-fine-in-docker
sh -c "mv /src/public/* /var/www/"

CMD while sleep 3600; do :; done
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 gatsbyjs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

0 comments on commit a8e19d9

Please sign in to comment.