mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Synchronize dockerfiles, fix cypress
.. make tippy.js a production dependency (was throwing errors on my machine).
This commit is contained in:
parent
10418f061b
commit
bc153ee42e
@ -19,7 +19,7 @@ install:
|
||||
- docker-compose -f docker-compose.yml -f docker-compose.build-and-test.yml build # just tagging, just be quite fast
|
||||
- docker-compose -f docker-compose.yml -f docker-compose.build-and-test.yml up -d
|
||||
- wait-on http://localhost:7474
|
||||
- docker-compose exec neo4j db_setup
|
||||
- docker-compose -f docker-compose.yml -f docker-compose.build-and-test.yml exec neo4j db_setup
|
||||
|
||||
script:
|
||||
- export CYPRESS_RETRIES=1
|
||||
|
||||
@ -2,6 +2,7 @@ FROM node:12.10.0-alpine as base
|
||||
LABEL Description="Backend of the Social Network Human-Connection.org" Vendor="Human Connection gGmbH" Version="0.0.1" Maintainer="Human Connection gGmbH (developer@human-connection.org)"
|
||||
|
||||
EXPOSE 4000
|
||||
CMD ["yarn", "run", "start"]
|
||||
ARG BUILD_COMMIT
|
||||
ENV BUILD_COMMIT=$BUILD_COMMIT
|
||||
ARG WORKDIR=/nitro-backend
|
||||
@ -12,12 +13,10 @@ RUN apk --no-cache add git
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
COPY .env.template .env
|
||||
CMD ["yarn", "run", "start"]
|
||||
|
||||
FROM base as build-and-test
|
||||
RUN yarn install --production=false --frozen-lockfile --non-interactive
|
||||
COPY . .
|
||||
RUN cp .env.template .env
|
||||
RUN NODE_ENV=production yarn run build
|
||||
|
||||
# reduce image size with a multistage build
|
||||
@ -25,4 +24,4 @@ FROM base as production
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=build-and-test /nitro-backend/dist ./dist
|
||||
COPY ./public/img/ ./public/img/
|
||||
RUN yarn install --production=true --frozen-lockfile --non-interactive
|
||||
RUN yarn install --production=true --frozen-lockfile --non-interactive --no-cache
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"SEED_SERVER_HOST": "http://localhost:4001",
|
||||
"BACKEND_HOST": "http://localhost:4000",
|
||||
"NEO4J_URI": "bolt://localhost:7687",
|
||||
"NEO4J_USERNAME": "neo4j",
|
||||
"NEO4J_PASSWORD": "letmein"
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,12 +16,24 @@
|
||||
import "cypress-file-upload";
|
||||
import helpers from "./helpers";
|
||||
import users from "../fixtures/users.json";
|
||||
import { GraphQLClient, request } from 'graphql-request'
|
||||
import { gql } from '../../backend/src/jest/helpers'
|
||||
|
||||
const backendHost = Cypress.env('BACKEND_HOST')
|
||||
const switchLang = name => {
|
||||
cy.get(".locale-menu").click();
|
||||
cy.contains(".locale-menu-popover a", name).click();
|
||||
};
|
||||
|
||||
const authenticatedHeaders = async (variables) => {
|
||||
const mutation = gql`
|
||||
mutation($email: String!, $password: String!) {
|
||||
login(email: $email, password: $password)
|
||||
}
|
||||
`
|
||||
const response = await request(backendHost, mutation, variables)
|
||||
return { authorization: `Bearer ${response.login}` }
|
||||
}
|
||||
|
||||
Cypress.Commands.add("switchLanguage", (name, force) => {
|
||||
const { code } = helpers.getLangByName(name);
|
||||
@ -82,6 +94,26 @@ Cypress.Commands.add("createCategories", (id, slug) => {
|
||||
icon: "medkit"
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Cypress.Commands.add(
|
||||
'authenticateAs',
|
||||
async ({email, password}) => {
|
||||
const headers = await authenticatedHeaders({ email, password })
|
||||
console.log(headers)
|
||||
return new GraphQLClient(backendHost, { headers })
|
||||
}
|
||||
)
|
||||
|
||||
Cypress.Commands.add(
|
||||
'mutate',
|
||||
{ prevSubject: true },
|
||||
async (graphQLClient, mutation, variables) => {
|
||||
await graphQLClient.request(mutation, variables)
|
||||
return graphQLClient
|
||||
}
|
||||
)
|
||||
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
|
||||
@ -3,17 +3,18 @@ import { getDriver, neode as getNeode } from '../../backend/src/bootstrap/neo4j'
|
||||
import setupNeode from '../../backend/src/bootstrap/neode'
|
||||
import neode from 'neode'
|
||||
|
||||
const backendHost = Cypress.env('SEED_SERVER_HOST')
|
||||
const neo4jConfigs = {
|
||||
uri: Cypress.env('NEO4J_URI'),
|
||||
username: Cypress.env('NEO4J_USERNAME'),
|
||||
password: Cypress.env('NEO4J_PASSWORD')
|
||||
}
|
||||
const neo4jDriver = getDriver(neo4jConfigs)
|
||||
const factory = Factory({ seedServerHost, neo4jDriver, neodeInstance: setupNeode(neo4jConfigs)})
|
||||
const seedServerHost = Cypress.env('SEED_SERVER_HOST')
|
||||
const factoryOptions = { seedServerHost: backendHost, neo4jDriver, neodeInstance: setupNeode(neo4jConfigs)}
|
||||
const factory = Factory(factoryOptions)
|
||||
|
||||
beforeEach(async () => {
|
||||
await factory.cleanDatabase({ seedServerHost, neo4jDriver })
|
||||
await factory.cleanDatabase()
|
||||
})
|
||||
|
||||
Cypress.Commands.add('neode', () => {
|
||||
@ -35,7 +36,7 @@ Cypress.Commands.add(
|
||||
)
|
||||
|
||||
Cypress.Commands.add('factory', () => {
|
||||
return Factory({ seedServerHost, neo4jDriver, neodeInstance: setupNeode(neo4jConfigs) })
|
||||
return Factory(factoryOptions)
|
||||
})
|
||||
|
||||
Cypress.Commands.add(
|
||||
@ -55,20 +56,3 @@ Cypress.Commands.add(
|
||||
return factory
|
||||
}
|
||||
)
|
||||
|
||||
Cypress.Commands.add(
|
||||
'mutate',
|
||||
{ prevSubject: true },
|
||||
async (factory, mutation, variables) => {
|
||||
await factory.mutate(mutation, variables)
|
||||
return factory
|
||||
}
|
||||
)
|
||||
|
||||
Cypress.Commands.add(
|
||||
'authenticateAs',
|
||||
{ prevSubject: true },
|
||||
(factory, loginCredentials) => {
|
||||
return factory.authenticateAs(loginCredentials)
|
||||
}
|
||||
)
|
||||
|
||||
@ -10,6 +10,8 @@ services:
|
||||
- 3000:3000
|
||||
networks:
|
||||
- hc-network
|
||||
depends_on:
|
||||
- backend
|
||||
volumes:
|
||||
- webapp_node_modules:/nitro-web/node_modules
|
||||
- webapp_nuxt_folder:/nitro-web/.nuxt
|
||||
@ -34,11 +36,12 @@ services:
|
||||
environment:
|
||||
- NEO4J_URI=bolt://neo4j:7687
|
||||
- GRAPHQL_PORT=4000
|
||||
- GRAPHQL_URI=http://localhost:4000
|
||||
- GRAPHQL_URI=http://backend:4000
|
||||
- CLIENT_URI=http://localhost:3000
|
||||
- JWT_SECRET=b/&&7b78BF&fv/Vd
|
||||
- MAPBOX_TOKEN=pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ
|
||||
- PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78
|
||||
- "DEBUG=${DEBUG}"
|
||||
neo4j:
|
||||
image: humanconnection/neo4j:latest
|
||||
build:
|
||||
|
||||
@ -14,14 +14,17 @@ WORKDIR $WORKDIR
|
||||
# See: https://github.com/nodejs/docker-node/pull/367#issuecomment-430807898
|
||||
RUN apk --no-cache add git
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
COPY .env.template .env
|
||||
|
||||
|
||||
FROM base as build-and-test
|
||||
COPY . .
|
||||
RUN cp .env.template .env
|
||||
RUN yarn install --production=false --frozen-lockfile --non-interactive
|
||||
COPY . .
|
||||
RUN NODE_ENV=production yarn run build
|
||||
|
||||
FROM base as production
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --production=true --frozen-lockfile --non-interactive
|
||||
RUN yarn install --production=true --frozen-lockfile --non-interactive --no-cache
|
||||
COPY --from=build-and-test ./nitro-web/.nuxt ./.nuxt
|
||||
COPY nuxt.config.js .
|
||||
COPY locales locales
|
||||
|
||||
@ -74,6 +74,7 @@
|
||||
"nuxt-env": "~0.1.0",
|
||||
"stack-utils": "^1.0.2",
|
||||
"string-hash": "^1.1.3",
|
||||
"tippy.js": "^4.3.5",
|
||||
"tiptap": "~1.25.0",
|
||||
"tiptap-extensions": "~1.27.0",
|
||||
"v-tooltip": "~2.0.2",
|
||||
@ -123,7 +124,6 @@
|
||||
"sass-loader": "~8.0.0",
|
||||
"style-loader": "~0.23.1",
|
||||
"style-resources-loader": "~1.2.1",
|
||||
"tippy.js": "^4.3.5",
|
||||
"vue-jest": "~3.0.5",
|
||||
"vue-loader": "~15.7.0",
|
||||
"vue-svg-loader": "~0.12.0",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user