Skip to content

Commit

Permalink
Merge branch 'OY-4695-update-versions' into MERGE__OY-4459__OY-4695
Browse files Browse the repository at this point in the history
  • Loading branch information
vaeinoe committed Feb 26, 2024
2 parents c4bdde1 + d87f16b commit d977c87
Show file tree
Hide file tree
Showing 45 changed files with 9,648 additions and 10,471 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

28 changes: 0 additions & 28 deletions .eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/actions/prepare-clojure-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ runs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'

- uses: szenius/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
git clone https://github.com/Opetushallitus/ci-tools.git
source ci-tools/common/setup-tools.sh
export BASE_IMAGE="baseimage-fatjar-openjdk11:master"
export BASE_IMAGE="baseimage-fatjar-openjdk21:master"
./ci-tools/common/pull-image.sh
cp -v ./target/maksut.jar $DOCKER_BUILD_DIR/artifact/maksut.jar
cp -vr ./oph-configuration $DOCKER_BUILD_DIR/config/
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ pom.xml
.lsp/
/maksut.iws
/maksut.ipr

.clj-kondo/
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.0.15
21.0.2
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

124 changes: 62 additions & 62 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
NODE_MODULES = node_modules
PM2 = PM2_HOME=.pm2 npx pm2
DOCKER_COMPOSE=COMPOSE_PARALLEL_LIMIT=8 $(if $(DOCKER_SUDO),sudo )docker-compose

$(NODE_MODULES): package.json package-lock.json
npm install
touch $(NODE_MODULES)

start-docker:
@$(DOCKER_COMPOSE) up -d maksut-nginx-local

start-docker-db:
@$(DOCKER_COMPOSE) up -d maksut-db-local

start-docker-local:
@$(DOCKER_COMPOSE) up -d maksut-nginx-local
@$(DOCKER_COMPOSE) up -d maksut-db-local

start-docker-cypress:
@$(DOCKER_COMPOSE) up -d maksut-nginx-local
@$(DOCKER_COMPOSE) up -d maksut-e2e-db-local

kill-docker:
@$(DOCKER_COMPOSE) kill

kill-docker-cypress:
@$(DOCKER_COMPOSE) kill maksut-e2e-db-local

start: $(NODE_MODULES) start-docker
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend

start-local: $(NODE_MODULES) start-docker-local
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend

log: $(NODE_MODULES)
@$(PM2) logs --timestamp

logs: log

status: $(NODE_MODULES)
@$(PM2) status

kill: $(NODE_MODULES) kill-docker
@$(PM2) kill

start-cypress: start-docker-cypress
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend-cypress

kill-cypress: kill-docker-cypress
@$(PM2) stop pm2.config.js --only maksut-backend-cypress

restart: kill start
restart-local: kill start-local
restart-cypress: kill-cypress start-cypress

reload:
@$(PM2) kill
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend
NODE_MODULES = node_modules
PM2 = PM2_HOME=.pm2 npx pm2
DOCKER_COMPOSE=COMPOSE_PARALLEL_LIMIT=8 $(if $(DOCKER_SUDO),sudo )docker-compose

$(NODE_MODULES): package.json package-lock.json
npm ci
touch $(NODE_MODULES)

start-docker:
@$(DOCKER_COMPOSE) up -d maksut-nginx-local

start-docker-db:
@$(DOCKER_COMPOSE) up -d maksut-db-local

start-docker-local:
@$(DOCKER_COMPOSE) up -d maksut-nginx-local
@$(DOCKER_COMPOSE) up -d maksut-db-local

start-docker-test:
@$(DOCKER_COMPOSE) up -d maksut-nginx-local
@$(DOCKER_COMPOSE) up -d maksut-e2e-db-local

kill-docker:
@$(DOCKER_COMPOSE) kill

kill-docker-test:
@$(DOCKER_COMPOSE) kill maksut-e2e-db-local

start: $(NODE_MODULES) start-docker
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend

start-local: $(NODE_MODULES) start-docker-local
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend

log: $(NODE_MODULES)
@$(PM2) logs --timestamp

logs: log

status: $(NODE_MODULES)
@$(PM2) status

kill: $(NODE_MODULES) kill-docker
@$(PM2) kill

start-test: start-docker-test
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend-test

kill-test: kill-docker-test
@$(PM2) stop pm2.config.js --only maksut-backend-test

restart: kill start
restart-local: kill start-local
restart-test: kill-test start-test

reload:
@$(PM2) kill
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Kloonaa ja valmistele omien ohjeiden mukaan käyttökuntoon [local-environment](
Include /polku/local-environment-repositoryysi/docker/ssh/config
```
* Mikäli et halua määrittää kyseistä `Include` -direktiiviä, voit tarjota kyseiset porttiohjauskonfiguraatiot SSH-clientillesi jotenkin toisin.


### Maksuputken testaaminen testiympäristössä

Expand Down Expand Up @@ -175,18 +175,18 @@ Swagger JSON löytyy polusta `/maksut/swagger.json`
npm run lint:clj
```

### Integraatiotestit
### Backend-testit

Käynnistä ensin bäkkäri komennolla

```
make start-cypress
make start-test
```

Aja sen jälkeen lein testit käyttäen lokaalia konfiguraatiotiedostoa:

```
CONFIG=oph-configuration/config.cypress.local-environment.edn lein test
CONFIG=oph-configuration/config.test.local-environment.edn lein test
```

## REPL-yhteys palvelimeen ja selaimeen
Expand Down
23 changes: 7 additions & 16 deletions bin/cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,19 @@ if [[ "${LEIN}" == "" ]]; then
LEIN="./bin/lein"
fi

tsc() {
npm run tsc:type-check
}

lint() {
npm run lint:clj \
&& npm run lint:js
}

test-e2e() {
npm run cypress:run:travis
npm run lint:clj
}

test-lein() {
CONFIG=oph-configuration/config.cypress.github.edn \
CONFIG=oph-configuration/config.test.github.edn \
lein test
}

run-all-tests() {
lint \
&& test-e2e
&& run-mocked-maksut \
&& test-lein
}

create-uberjar() {
Expand All @@ -34,14 +26,13 @@ create-uberjar() {

run-mocked-maksut() {
docker kill maksut-e2e-db || true && docker rm -f maksut-e2e-db || true 2>&1 > /dev/null
docker run --name maksut-e2e-db -d -e POSTGRES_PASSWORD=postgres_password -e POSTGRES_USER=postgres_user -e POSTGRES_DB=maksut -p 5432:5432 postgres:12-alpine
CONFIG=oph-configuration/config.cypress.github.edn java -jar target/maksut.jar &
docker run --name maksut-e2e-db -d -e POSTGRES_PASSWORD=postgres_password -e POSTGRES_USER=postgres_user -e POSTGRES_DB=maksut -p 5432:5432 postgres:15-alpine
CONFIG=oph-configuration/config.test.github.edn java -jar target/maksut.jar &
./bin/wait-for.sh localhost:19033 -t 30
}

run-all-tests-and-create-uberjar() {
tsc \
&& lint \
lint \
&& create-uberjar \
&& run-mocked-maksut \
&& test-lein
Expand Down
5 changes: 0 additions & 5 deletions cypress/.eslintrc

This file was deleted.

Empty file removed cypress/support/commands.ts
Empty file.
Empty file removed cypress/support/index.js
Empty file.
12 changes: 0 additions & 12 deletions cypress/tsconfig.json

This file was deleted.

82 changes: 41 additions & 41 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
version: '3.7'
services:
maksut-nginx-local:
image: nginx
container_name: maksut-nginx-local
networks:
maksut-local-network:
ports:
- "9030:9030"
- "19030:19030"
volumes:
- "./nginx:/etc/nginx"
maksut-e2e-db-local:
image: postgres:12-alpine
container_name: maksut-e2e-db-local
environment:
POSTGRES_PASSWORD: postgres_password
POSTGRES_USER: postgres_user
POSTGRES_DB: maksut
networks:
maksut-local-e2e-network:
ports:
- "15432:15432"
command: -p 15432
maksut-db-local:
image: postgres:12-alpine
container_name: maksut-db-local
environment:
POSTGRES_PASSWORD: postgres_password
POSTGRES_USER: postgres_user
POSTGRES_DB: maksut
TZ: 'Europe/Helsinki'
PGTZ: 'Europe/Helsinki'
networks:
maksut-local-network:
ports:
- "15499:5432"
#command: -p 55499
networks:
maksut-local-network:
maksut-local-e2e-network:
version: '3.7'
services:
maksut-nginx-local:
image: nginx
container_name: maksut-nginx-local
networks:
maksut-local-network:
ports:
- "9030:9030"
- "19030:19030"
volumes:
- "./nginx:/etc/nginx"
maksut-e2e-db-local:
image: postgres:15-alpine
container_name: maksut-e2e-db-local
environment:
POSTGRES_PASSWORD: postgres_password
POSTGRES_USER: postgres_user
POSTGRES_DB: maksut
networks:
maksut-local-e2e-network:
ports:
- "15432:15432"
command: -p 15432
maksut-db-local:
image: postgres:15-alpine
container_name: maksut-db-local
environment:
POSTGRES_PASSWORD: postgres_password
POSTGRES_USER: postgres_user
POSTGRES_DB: maksut
TZ: 'Europe/Helsinki'
PGTZ: 'Europe/Helsinki'
networks:
maksut-local-network:
ports:
- "15499:5432"
#command: -p 55499
networks:
maksut-local-network:
maksut-local-e2e-network:
Loading

0 comments on commit d977c87

Please sign in to comment.