Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit 2593184f authored by Stefan Probst's avatar Stefan Probst
Browse files

build: hello autodevops

parent a6ef245f
Pipeline #206469 passed with stages
in 14 minutes and 24 seconds
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
# vercel
.vercel
# caches
.eslintcache
*.tsbuildinfo
# auto-generated favicons
public/android-chrome-192x192.png
public/android-chrome-512x512.png
public/apple-touch-icon.png
public/favicon-16x16.png
public/favicon-32x32.png
public/favicon.ico
public/site.webmanifest
# auto-generated sitemap
public/robots.txt
public/sitemap.xml
# auto-generated api clients
# src/api/sshoc/index.ts
GITLAB_BASE_URL=https://gitlab.gwdg.de
GITLAB_REPOSITORY=sshoc/sshoc-marketplace-frontend
SSHOC_OPENAPI_DOCUMENT_URL=https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at/v3/api-docs
NEXT_PUBLIC_SSHOC_BASE_URL=https://sshoc-marketplace.acdh-dev.oeaw.ac.at
NEXT_PUBLIC_SSHOC_API_BASE_URL=https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at
# NEXT_PUBLIC_RECAPTCHA_SITE_KEY=
NEXT_PUBLIC_MATOMO_BASE_URL=https://matomo.acdh.oeaw.ac.at/
NEXT_PUBLIC_MATOMO_SITE_ID=190
### BUILDTIME CONFIG ##########################################################
### used for creating oauth2 links
### frontend base url, defaults to http://localhost:3000
# NEXT_PUBLIC_SSHOC_BASE_URL=https://sshoc-marketplace.acdh-dev.oeaw.ac.at
### backend base url, defaults to http://localhost:8080
# NEXT_PUBLIC_SSHOC_API_BASE_URL=https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at
### recaptcha key for contact form
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=
### sshoc marketplace openapi document used to build the api client, defaults to http://localhost:8080/v3/api-docs
# SSHOC_OPENAPI_DOCUMENT_URL=https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at/v3/api-docs
### gitlab repository is used to get "last updated" timestamp for static content pages
### if not provided, current date will be used for timestamps
GITLAB_BASE_URL=https://gitlab.gwdg.de
GITLAB_REPOSITORY=sshoc/sshoc-marketplace-frontend
# GITLAB_REPOSITORY_BRANCH=main
### optional access token for non-public repository
# GITLAB_ACCESS_TOKEN=
### Matomo analytics
# NEXT_PUBLIC_MATOMO_BASE_URL=
# NEXT_PUBLIC_MATOMO_SITE_ID=
### RUNTIME CONFIG ############################################################
### Email for contact form submissions
# SMTP_SERVER=
# SMTP_PORT=
# SSHOC_CONTACT_EMAIL=
SMTP_SERVER=smtp.oeaw.ac.at
SMTP_PORT=25
SSHOC_CONTACT_EMAIL=sshopenmarketplace@sshopencloud.eu
# stage instance
GITLAB_BASE_URL=https://gitlab.gwdg.de
GITLAB_REPOSITORY=sshoc/sshoc-marketplace-frontend
GITLAB_REPOSITORY_BRANCH=stage
NEXT_PUBLIC_SSHOC_BASE_URL=https://sshoc-marketplace-stage.acdh-dev.oeaw.ac.at
NEXT_PUBLIC_SSHOC_API_BASE_URL=https://sshoc-marketplace-api-stage.acdh-dev.oeaw.ac.at
SSHOC_OPENAPI_DOCUMENT_URL=https://sshoc-marketplace-api-stage.acdh-dev.oeaw.ac.at/v3/api-docs
NEXT_PUBLIC_MATOMO_BASE_URL=https://matomo.acdh.oeaw.ac.at/
NEXT_PUBLIC_MATOMO_SITE_ID=198
include:
- template: Auto-DevOps.gitlab-ci.yml
stages:
- build
- package
- test
- deploy
- review
- dast
- staging
- canary
- production
- incremental rollout 10%
- incremental rollout 25%
- incremental rollout 50%
- incremental rollout 100%
- performance
- cleanup
variables:
YARN_CACHE_FOLDER: '${CI_PROJECT_DIR}/.cache/yarn'
.cache:
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- .cache/yarn
install:
stage: build
extends: .cache
image: node:14-alpine
before_script:
- apk update && apk upgrade && apk add --no-cache git
script:
- yarn --frozen-lockfile --silent
only:
changes:
- yarn.lock
.docker:
image: docker:19-dind
services:
- name: docker:19-dind
command: ['--mtu=1450']
tags:
- cluster
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ''
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
.frontend:
script:
- docker pull $DOCKER_RELEASE_IMAGE || true
- docker build --cache-from $DOCKER_RELEASE_IMAGE --build-arg
GITLAB_BASE_URL --build-arg GITLAB_REPOSITORY --build-arg
GITLAB_REPOSITORY_BRANCH --build-arg GITLAB_ACCESS_TOKEN --build-arg
SSHOC_OPENAPI_DOCUMENT_URL --build-arg NEXT_PUBLIC_SSHOC_BASE_URL
--build-arg NEXT_PUBLIC_SSHOC_API_BASE_URL --build-arg
NEXT_PUBLIC_RECAPTCHA_SITE_KEY --build-arg NEXT_PUBLIC_MATOMO_BASE_URL
--build-arg NEXT_PUBLIC_MATOMO_SITE_ID --tag $DOCKER_CURRENT_IMAGE --tag
$DOCKER_RELEASE_IMAGE .
- docker push $DOCKER_CURRENT_IMAGE
- docker push $DOCKER_RELEASE_IMAGE
package:frontend:main:acdh:
stage: package
extends:
- .docker
- .frontend
variables:
DOCKER_RELEASE_IMAGE: ${CI_REGISTRY_IMAGE}/frontend:latest
DOCKER_CURRENT_IMAGE: ${CI_REGISTRY_IMAGE}/frontend:$CI_COMMIT_SHORT_SHA
GITLAB_BASE_URL: https://gitlab.gwdg.de
GITLAB_REPOSITORY: sshoc/sshoc-marketplace-frontend
SSHOC_OPENAPI_DOCUMENT_URL: https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at/v3/api-docs
NEXT_PUBLIC_SSHOC_BASE_URL: https://sshoc-marketplace.acdh-dev.oeaw.ac.at
NEXT_PUBLIC_SSHOC_API_BASE_URL: https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at
NEXT_PUBLIC_MATOMO_SITE_ID: 190
# NEXT_PUBLIC_RECAPTCHA_SITE_KEY:
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
package:frontend:tags:acdh:
stage: package
extends:
- .docker
- .frontend
variables:
DOCKER_RELEASE_IMAGE: ${CI_REGISTRY_IMAGE}/frontend:release
DOCKER_CURRENT_IMAGE: ${CI_REGISTRY_IMAGE}/frontend:$CI_COMMIT_TAG
GITLAB_BASE_URL: https://gitlab.gwdg.de
GITLAB_REPOSITORY: sshoc/sshoc-marketplace-frontend
SSHOC_OPENAPI_DOCUMENT_URL: https://marketplace-api.sshopencloud.eu/v3/api-docs
NEXT_PUBLIC_SSHOC_BASE_URL: https://marketplace.sshopencloud.eu
NEXT_PUBLIC_SSHOC_API_BASE_URL: https://marketplace-api.sshopencloud.eu
# NEXT_PUBLIC_RECAPTCHA_SITE_KEY:
NEXT_PUBLIC_MATOMO_BASE_URL: https://matomo.acdh.oeaw.ac.at/
NEXT_PUBLIC_MATOMO_SITE_ID: 179
rules:
- if: '$CI_COMMIT_TAG != null'
FROM node:14-alpine
WORKDIR /usr/src/app
# git is needed for openapi-ts-client
RUN apk update && apk upgrade && apk add --no-cache git
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --quiet
COPY . .
ARG NEXT_TELEMETRY_DISABLED=1
ARG GITLAB_BASE_URL
ARG GITLAB_REPOSITORY
ARG GITLAB_REPOSITORY_BRANCH
ARG GITLAB_ACCESS_TOKEN
ARG SSHOC_OPENAPI_DOCUMENT_URL
ARG NEXT_PUBLIC_SSHOC_BASE_URL
ARG NEXT_PUBLIC_SSHOC_API_BASE_URL
ARG NEXT_PUBLIC_RECAPTCHA_SITE_KEY
ARG NEXT_PUBLIC_MATOMO_BASE_URL
ARG NEXT_PUBLIC_MATOMO_SITE_ID
RUN yarn build
EXPOSE 3000
USER node
# run docker with --init flag to handle SIGTERM/SIGKILL
CMD ["yarn", "start"]
version: '2'
services:
frontend:
image: docker.gitlab.gwdg.de/sshoc/sshoc-marketplace-frontend/frontend:latest
container_name: sshoc-marketplace-frontend-frontend
volumes:
- image_cache:/usr/src/app/.next/cache/images
labels:
- traefik.backend=marketplace
- traefik.frontend.rule=Host:marketplace.sisyphos.arz.oeaw.ac.at
- traefik.docker.network=web
- traefik.port=3000
- ID=15819
- BackendConnection=none
networks:
- web
volumes:
image_cache:
networks:
web:
external:
name: web
version: '2'
services:
frontend:
image: docker.gitlab.gwdg.de/sshoc/sshoc-marketplace-frontend/frontend:release
container_name: sshoc-marketplace-frontend-frontend-prod
volumes:
- image_cache:/usr/src/app/.next/cache/images
labels:
- traefik.backend=marketplace-prod
- traefik.frontend.rule=Host:marketplace-prod.sisyphos.arz.oeaw.ac.at,sshoc-marketplace.acdh.oeaw.ac.at,marketplace.sshopencloud.eu,marketplace.sshoc.eu
- traefik.docker.network=web
- traefik.port=3000
- ID=17467
- BackendConnection=none
networks:
- web
volumes:
image_cache:
networks:
web:
external:
name: web
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
- GITLAB_BASE_URL
- GITLAB_REPOSITORY
- GITLAB_REPOSITORY_BRANCH
- GITLAB_ACCESS_TOKEN
- SSHOC_OPENAPI_DOCUMENT_URL
- NEXT_PUBLIC_SSHOC_BASE_URL
- NEXT_PUBLIC_SSHOC_API_BASE_URL
- NEXT_PUBLIC_RECAPTCHA_SITE_KEY
- NEXT_PUBLIC_MATOMO_BASE_URL
- NEXT_PUBLIC_MATOMO_SITE_ID
environment:
- SSHOC_API_BASE_URL=http://marketplace:8080
volumes:
- image_cache:/usr/src/app/.next/cache/images
ports:
- 3000:3000
networks:
- sshoc-marketplace-backend_default
volumes:
image_cache:
networks:
sshoc-marketplace-backend_default:
external: true
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
- GITLAB_BASE_URL
- GITLAB_REPOSITORY
- GITLAB_REPOSITORY_BRANCH
- GITLAB_ACCESS_TOKEN
- SSHOC_OPENAPI_DOCUMENT_URL
- NEXT_PUBLIC_SSHOC_BASE_URL
- NEXT_PUBLIC_SSHOC_API_BASE_URL
- NEXT_PUBLIC_RECAPTCHA_SITE_KEY
- NEXT_PUBLIC_MATOMO_BASE_URL
- NEXT_PUBLIC_MATOMO_SITE_ID
volumes:
- image_cache:/usr/src/app/.next/cache/images
ports:
- 3000:3000
volumes:
image_cache:
......@@ -38,6 +38,19 @@ const withSvg = createSvgPlugin({
})
const nextConfig = {
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'X-Robots-Tag',
value: 'noindex, nofollow',
},
],
},
]
},
images: {},
poweredByHeader: false,
reactStrictMode: true,
......
......@@ -2,7 +2,7 @@ import { loadEnvConfig } from '@next/env'
import prettierConfig from '@stefanprobst/prettier-config'
import { existsSync, promises as fs } from 'fs'
import fetch from 'node-fetch'
import { generate } from 'openapi-ts-client'
// import { generate } from 'openapi-ts-client'
import { join } from 'path'
import { log } from '@/utils/log'
......@@ -17,22 +17,24 @@ const outputFolder = join(process.cwd(), 'src', 'api', 'sshoc')
const outputFile = join(outputFolder, 'index.ts')
async function run() {
log.info(`Generating sshoc api client from ${openApiDocumentUrl}.`)
// log.info(`Generating sshoc api client from ${openApiDocumentUrl}.`)
const response = await fetch(openApiDocumentUrl)
const openApiDocument = await response.json()
// const response = await fetch(openApiDocumentUrl)
// const openApiDocument = await response.json()
const client = await generate({
openApiDocument,
prettierConfig,
})
// const client = await generate({
// openApiDocument,
// prettierConfig,
// })
if (!existsSync(outputFolder)) {
await fs.mkdir(outputFolder, { recursive: true })
}
await fs.writeFile(outputFile, client, { encoding: 'utf-8' })
// if (!existsSync(outputFolder)) {
// await fs.mkdir(outputFolder, { recursive: true })
// }
// await fs.writeFile(outputFile, client, { encoding: 'utf-8' })
log.success('Successfully generated sshoc api client.')
// log.success('Successfully generated sshoc api client.')
log.error('SSHOC client generation currently disabled')
}
run().catch(log.error)
This diff is collapsed.
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