espen42 / mimir

Ny publiseringsløsning for ssb.no (arbeidstittel NYP)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mimir

Getting started

Download and install Node and NPM from https://nodejs.org/en/ Make sure to get the LTS version, not the Current or Latest.

Install latest Enonic XP according to docs for you platform

Installing dependencies

Do not run npm install because this might install the incorrect versions of packages
Gradle will do this for you when you run enonic project deploy

Starting Enonic XP locally in development mode

Start your sandbox

Open your preferred terminal and run:

enonic sandbox start

This will either help you create a new sandbox, or start an existing sandbox

Build and Deploy

After you have your sandbox up and running, you can build and/or deploy the project by using:

enonic project deploy

or

enonic project build

or for a continous build and deploy (needs $XP_HOME and $JAVA_HOME env variables set)

./gradlew deploy -t

Integration tests are run when you build or deploy with Enonic CLI.
To build and deploy your application locally without running tests, run Gradle directly and skip them

./gradlew deploy -x test

Typescript interfaces Code-Gen

We're using the enonic-ts-codegen library. This reads through all .xml config files and automatically creates interface files for all parts, layouts, pages, site-config, and content-types. This is a part of the gradle.build pipeline. So they will be regenerated and overwritten on every build. To change the interface you'll have to change the .xml, not the .ts interface files.

Common Errors

Eslint

Login

Direct yout favorite browser to http://localhost:8080

How to start working on a feature

$ git checkout master
$ git pull
$ git checkout -b add-feature-x
... do changes ...
$ git commit -a -m "detailed commit message"
$ git status
... verify that correct files are included ...
$ git push -u origin add-feature-x
... create pull-request to master ...

Deploying builds to environments

Setup

Upon creating a pull request, Drone builds and tests your branch.
This build must pass in order for you to merge your pull request.
Tests will run again on subsequent commits to the same branch.

Upon merging a branch to Master, Drone builds and deploys to Test automatically.

In order to deploy to QA and PROD, we need to use the drone CLI.
Install instructions for Drone CLI can be found here.

Execution

Replace (build-number) with the build number you want to deploy
Deploying to QA:
drone build promote statisticsnorway/mimir (build-number) qa

Deploing to PROD:
drone build promote statisticsnorway/mimir (build-number) prod

Documentation

About

Ny publiseringsløsning for ssb.no (arbeidstittel NYP)

License:Apache License 2.0


Languages

Language:JavaScript 53.7%Language:TypeScript 35.0%Language:SCSS 6.5%Language:HTML 4.1%Language:Java 0.6%Language:XSLT 0.2%