Skip to content

Commit

Permalink
Merge pull request #1 from EricThuaud/develop
Browse files Browse the repository at this point in the history
initialize prohect - first PR
  • Loading branch information
EricThuaud authored Jun 23, 2022
2 parents a9a9d2b + 8b9fb47 commit eadef07
Show file tree
Hide file tree
Showing 88 changed files with 16,414 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SKIP_PREFLIGHT_CHECK=true
ACCESS_API_URL=https://coleman-access-api.dev.insee.io
AUTHENTICATION_MODE=anonymous
27 changes: 27 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parser": "babel-eslint",
"extends": ["airbnb", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"],
"linebreak-style": 0,
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/jsx-curly-brace-presence": "off",
"jsx-a11y/label-has-for": "off",
"no-irregular-whitespace": [1, { "skipStrings": true }]
},
"env": {
"jest": true
},
"settings": {
"import/resolver": {
"node": {
"paths": ["src"]
}
}
},
"globals": {
"fetch": true,
"window": true
}
}
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
pull_request:
branches:
- "*"

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 14C
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn --frozen-lockfile
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn run test
- run: yarn build
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build
path: build
55 changes: 55 additions & 0 deletions .github/workflows/develop-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Candidate

on:
push:
branches:
- 'develop'
tags:
- '*'

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 14C
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn --frozen-lockfile
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn build
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build
path: build
release:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2
- name: Get current version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- run: echo ${{steps.version.outputs.prop}}
- name: Release snapshot
id: release-snapshot
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.version.outputs.prop}}-rc
release_name: Release Candidate ${{steps.version.outputs.prop}}
draft: false
prerelease: false
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release & Docker

on:
push:
branches:
- 'main'
tags:
- '*'

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 14C
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn --frozen-lockfile
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn build
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build
path: build
release:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2
- name: Get current version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- run: echo ${{steps.version.outputs.prop}}
- name: Release snapshot
id: release-snapshot
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.version.outputs.prop}}
release_name: ${{steps.version.outputs.prop}}
draft: false
prerelease: false
docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download build
id: download
uses: actions/download-artifact@v2
with:
name: build
path: build
- name: Get current version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- run: echo ${{steps.version.outputs.prop}}
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: inseefr/coleman-access
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
tags: ${{steps.version.outputs.prop}}

25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build

# misc
/exemple
/graphisme
/specif
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
*.zip

npm-debug.log*
yarn-debug.log*
yarn-error.log*
17 changes: 17 additions & 0 deletions .k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: coleman-access
spec:
replicas: 1
selector:
matchLabels:
app: coleman-access
template:
metadata:
labels:
app: coleman-access
spec:
containers:
- name: coleman-access
image: inseefr/coleman-access:0.10.0
21 changes: 21 additions & 0 deletions .k8s/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: coleman-access-ingress
annotations:
kubernetes.io/ingress.class: nginx
spec:
tls:
- hosts:
- particuliers.dev.insee.io
rules:
- host: particuliers.dev.insee.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: coleman-access-svc
port:
number: 80
11 changes: 11 additions & 0 deletions .k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: coleman-access-svc
spec:
selector:
app: coleman-access
ports:
- protocol: TCP
port: 80
targetPort: 80
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5",
"linebreak-style": "windows"
}
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM nginx
COPY build /usr/share/nginx/html
RUN rm etc/nginx/conf.d/default.conf
COPY nginx-coleman-promotion.conf etc/nginx/conf.d/


# Copy .env file and shell script to container
WORKDIR /usr/share/nginx/html
COPY ./scripts/env.sh .
COPY .env .

# Make shell script executable
RUN chmod +x env.sh

# Start Nginx server
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Portail de promotion des enquêtes ménages de la plateforme coleman mis en place dans le cadre du project Métallica

5 changes: 5 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"baseUrl": "./src"
}
}
29 changes: 29 additions & 0 deletions nginx-coleman-promotion.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
server {
listen 80 default_server;
server_name /usr/share/nginx/html;

root /usr/share/nginx/html;
index index.html;

location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
# access_log logs/static.log; # I don't usually include a static log
}

location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}

# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;
}

# Any route that doesn't have a file extension (e.g. /devices)
location / {
try_files $uri $uri/ /index.html;
}
}
Loading

0 comments on commit eadef07

Please sign in to comment.