Commit b519269b authored by Jon Moore's avatar Jon Moore
Browse files

added files for workshop

parent 301da193
Pipeline #39417 passed with stage
in 7 minutes and 28 seconds
File added
**/node_modules
**/dist
DockerFile
.git
root = true
[*.js]
indent_style = space
indent_size = 2
end_of_line = lf
ALIAS=zenhub
INTERNAL_VIP=10.128.46.132
ACCESS_TOKEN=sNF3SnNWu6RMAtpzybcOqkHKUlMnEUwrNre0OlD9G8UERroN
PUBLIC_URL=https://live-zengenti-zenhub.cloud.contensis.com/
PROJECT=zengenti
CONTENSIS_VERSION=14
ALIAS=-workshops-cte-master
INTERNAL_VIP=10.128.21.82
ACCESS_TOKEN=AfTWtGox8aKdgO85rXXSJrWUXa97BA1aXP4fwaIrliDSvWNz
PUBLIC_URL=https://live-workshops-cte-master.cloud.contensis.com
PROJECT=website
CONTENSIS_VERSION=14
/dist
/node_modules
/docs
\.*
/src/contensis-delivery-api
const path = require('path');
module.exports = {
plugins: ['prettier', 'react', 'react-hooks', 'flowtype'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:flowtype/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
'prettier',
'prettier/react',
'prettier/flowtype',
],
env: {
browser: true,
node: true,
jest: true,
mocha: true,
es6: true,
},
globals: {
__isBrowser__: true,
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
modules: true,
experimentalObjectRestSpread: true,
},
},
rules: {
'react/require-default-props': 0,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'no-debugger': 0,
'no-alert': 0,
'no-console': [
'error',
{
allow: ['error', 'info'],
},
],
quotes: [
2,
'single',
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
'prettier/prettier': [
'error',
{
trailingComma: 'es5',
singleQuote: true,
printWidth: 80,
endOfLine: 'auto',
},
],
},
settings: {
flowtype: {
onlyFilesWithFlowAnnotation: true,
},
react: {
version: '^16.0.0',
flowVersion: '^0.81.0',
},
'import/resolver': {
webpack: {
config: path.resolve(__dirname, './webpack/webpack.config.base.js'),
},
},
},
};
node_modules
image: docker:stable
stages:
- storybook-latest-build
- latest-build
- live-build
- development-release-build
variables:
DOCKER_DRIVER: overlay2
STORYBOOK: ''
APP_BUILDER_IMAGE: '$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME/app-builder'
APP_IMAGE: '$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME/app'
STORYBOOK_BUILDER_IMAGE: '$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME/storybook-builder'
STORYBOOK_IMAGE: '$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME/storybook'
MASTER_APP: '$CI_REGISTRY_IMAGE/master/app'
DEVELOP_APP: '$CI_REGISTRY_IMAGE/develop/app'
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN gitlab.zengenti.com:4567
build-latest-code:
stage: latest-build
except:
- tags
script:
- docker pull $APP_BUILDER_IMAGE:latest || true
- echo "{\"commitRef\":\"$CI_COMMIT_SHA\",\"pipelineIID\":\"$CI_PIPELINE_IID\",\"pipelineUrl\":\"$CI_PIPELINE_URL\",\"buildNo\":\"$CI_PIPELINE_ID\",\"branchName\":\"$CI_COMMIT_REF_NAME\",\"registryImage\":\"$CI_REGISTRY_IMAGE\"}" > version.json
- docker build --force-rm --cache-from $APP_BUILDER_IMAGE:latest -t $APP_BUILDER_IMAGE:latest -f docker/nodebuilder.DockerFile .
- docker push $APP_BUILDER_IMAGE:latest
- docker pull $APP_IMAGE:latest || true
- docker build --force-rm --cache-from $APP_IMAGE:latest -t $APP_IMAGE:latest --build-arg builder_image=$APP_BUILDER_IMAGE:latest -f docker/ci-build.DockerFile .
- docker push $APP_IMAGE:latest
environment:
name: latest
url: http://dev.preview.$CI_PROJECT_NAME.contensis.cloud
build-storybook:
stage: storybook-latest-build
except:
- tags
- /^release-.*$/
only:
variables:
- $STORYBOOK == 'true'
script:
- docker pull $STORYBOOK_BUILDER_IMAGE:latest || true
- docker build --compress --force-rm --cache-from $STORYBOOK_BUILDER_IMAGE:latest -t $STORYBOOK_BUILDER_IMAGE:latest -f docker/storybook-builder.DockerFile .
- docker push $STORYBOOK_BUILDER_IMAGE:latest
- docker build --compress --force-rm -t $STORYBOOK_IMAGE:latest --build-arg builder_image=$STORYBOOK_BUILDER_IMAGE:latest -f docker/storybook-http.DockerFile .
- docker push $STORYBOOK_IMAGE:latest
environment:
name: storybook
url: http://storybook.latest.$CI_PROJECT_NAME.contensis.cloud
build-live-code-for-production:
stage: live-build
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /^release-.*$/
except:
- branches
script:
- docker pull "$MASTER_APP:latest"
- docker tag "$MASTER_APP:latest" "$MASTER_APP:release"
- docker push "$MASTER_APP:release"
- docker tag "$MASTER_APP:latest" "$MASTER_APP:$CI_COMMIT_TAG"
- docker push "$MASTER_APP:$CI_COMMIT_TAG"
environment:
name: live
url: http://preview.$CI_PROJECT_NAME.contensis.cloud
build-live-code-for-development:
stage: development-release-build
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /^devrelease-.*$/
script:
- docker pull "$DEVELOP_APP:latest"
- docker tag "$DEVELOP_APP:latest" "$DEVELOP_APP:release"
- docker push "$DEVELOP_APP:release"
environment:
name: live
url: http://preview.$CI_PROJECT_NAME.contensis.cloud
This source diff could not be displayed because it is too large. You can view the blob instead.
/dist
/docs
/node_modules
/public/styles
{
"trailingComma": "es5",
"singleQuote": true
}
const NODE_TARGET = 9;
// const presetEnv = {
// "targets": {
// "node": NODE_TARGET
// }
// }
const presetEnv = {
targets: {
browsers: ['last 2 versions', 'IE >= 11'],
},
//useBuiltIns: 'usage',
};
// if (process.env.NODE_ENV !== 'test') {
// presetEnv.modules = false;
// }
module.exports = {
presets: [['@babel/preset-env', presetEnv], '@babel/preset-react'],
plugins: [
[
'babel-plugin-styled-components',
{
displayName: true,
ssr: true,
},
],
'react-hot-loader/babel',
'react-loadable/babel',
'@babel/plugin-transform-runtime',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-export-default-from',
'@babel/plugin-proposal-export-default-from',
],
env: {
test: {
plugins: ['babel-plugin-dynamic-import-node'],
},
},
};
import '@storybook/addon-knobs/register';
import '@storybook/addon-jest/register';
import { configure, addDecorator, addParameters } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import { withTests } from '@storybook/addon-jest';
import results from '../.jest-test-results.json';
import StoryRouter from 'storybook-react-router';
addDecorator(StoryRouter());
addDecorator(
withTests({
results,
})
);
addParameters({
options: {
isFullscreen: false,
showNav: true,
showPanel: true,
panelPosition: 'right',
hierarchySeparator: /\/|\./,
hierarchyRootSeparator: /\|/,
sidebarAnimations: true,
enableShortcuts: true,
isToolshown: true,
theme: undefined,
storySort: undefined,
},
});
addDecorator(withKnobs, {
knobs: {
timestamps: true,
escapeHTML: true,
},
});
const req = require.context('../src/app/', true, /.stories.js$/);
function loadStories() {
req.keys().forEach(req);
}
configure(loadStories, module);
// you can use this file to add your custom webpack plugins, loaders and anything you like.
// This is just the basic way to add additional webpack configurations.
// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config
// IMPORTANT
// When you add this file, we won't add the default configurations which is similar
// to "React Create App". This only has babel loader to load JavaScript.
const path = require('path');
const webpack = require('webpack');
const packagejson = require('../package.json');
const defineConfig = require('../webpack/define-config-webpack').base;
module.exports = {
plugins: [
new webpack.DefinePlugin(defineConfig),
new webpack.DefinePlugin({
__isBrowser__: 'true',
}),
],
module: {
rules: [
// add your custom rules.
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: [
'file-loader',
{
loader: 'image-webpack-loader',
options: {
bypassOnDebug: true, // webpack@1.x
disable: true, // webpack@2.x and newer
},
},
],
},
{
test: /\.(eot|woff|woff2|ttf)$/,
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]',
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
alias: {
'~': path.resolve(__dirname, '../src/app'),
app: path.resolve(__dirname, '../src/app'),
},
},
externals: {
jsdom: 'window',
cheerio: 'window',
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': 'window',
'react/addons': true,
},
watchOptions: {
ignored: ['node_modules', 'dist'],
},
};
{
"processors": ["stylelint-processor-styled-components"],
"extends": [
"stylelint-config-recommended",
"stylelint-config-styled-components"
],
"rules": {
"no-descending-specificity": null,
"property-no-vendor-prefix": null,
"value-no-vendor-prefix": null
}
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
//
// TO USE VSCODE DEBUGGING, INSTALL "DEBUGGER FOR CHROME" EXTENSION IN VSCODE,
// ENSURE APPROPRIATE DEV/STORYBOOK TERMINAL IS RUNNING AND THEN HIT F5 TO
// RUN THE SELECTED LAUNCH CONFIG TO OPEN UP A SPECIAL DEBUGGING BROWSER.
// BREAKPOINTS AND WATCHES WILL WORK.
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Debug Storybook in Chrome against localhost",
"url": "http://localhost:6006",
"webRoot": "${workspaceFolder}"
},
{
"type": "chrome",
"request": "launch",
"name": "Debug App in Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"skipFiles": ["${workspaceFolder}/node_modules/**/*.js"]
},
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "127.0.0.1",
"port": 9229,
"localRoot": "${workspaceFolder}\\",
"remoteRoot": "${workspaceFolder}\\",
"smartStep": true,
// Note: These are the mappings that are included by default out of the box, with examples of how they could be resolved in different scenarios. These are not mappings that would make sense together in one project.
"sourceMapPathOverrides": {
"webpack:///./~/*": "${workspaceFolder}/node_modules/*", // Example: "webpack:///./~/querystring/index.js" -> "/Users/me/project/node_modules/querystring/index.js"
"webpack:///./*": "${workspaceFolder}/*", // Example: "webpack:///./src/app.js" -> "/Users/me/project/src/app.js",
"webpack:///*": "*", // Example: "webpack:///project/app.ts" -> "/project/app.ts"
"webpack:///src/*": "${workspaceFolder}/*", // Example: "webpack:///src/app.js" -> "/Users/me/project/app.js"
"meteor://💻app/*": "${workspaceFolder}/*" // Example: "meteor://💻app/main.ts" -> "/Users/me/project/main.ts"
}
},
{
"type": "node",
"request": "launch",
"name": "Run server - debug",
"program": "${workspaceFolder}/src/server/server.js",
"runtimeExecutable": "nodemon",
"runtimeArgs": [
"--exec",
"${workspaceRoot}/node_modules/.bin/babel-node"
],
"smartStep": true,
"internalConsoleOptions": "neverOpen",
"restart": true,
"cwd": "${workspaceRoot}",
"console": "internalConsole",
"outFiles": [],
"env": {
"NODE_ENV": "test"
},
"sourceMaps": true
}
]
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment