Skip to content

Commit

Permalink
Fix: 1145 Rename repos (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
mittistormen authored Feb 5, 2024
1 parent b796a3d commit 0d2b1fe
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 70 deletions.
107 changes: 53 additions & 54 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,35 @@ name: Continuous Integration
on:
push:
branches:
- main
- main
tags:
- production*
- staging*
- production*
- staging*

jobs:

version:
runs-on: ubuntu-latest

steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
- name: 🛎️ Checkout
uses: actions/checkout@v3

- name: 🎫 Update patch verision
run: |
git fetch
git checkout main
git pull origin main
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [[ $GITHUB_REF == refs/tags/production* ]]; then
npm version major
elif [[ $GITHUB_REF == refs/tags/staging* ]]; then
npm version minor
else
npm version patch
fi
git fetch --all
git push origin main
- name: 🎫 Update patch verision
run: |
git fetch
git checkout main
git pull origin main
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [[ $GITHUB_REF == refs/tags/production* ]]; then
npm version major
elif [[ $GITHUB_REF == refs/tags/staging* ]]; then
npm version minor
else
npm version patch
fi
git fetch --all
git push origin main
ci:
runs-on: ubuntu-latest
Expand All @@ -41,41 +40,41 @@ jobs:
strategy:
matrix:
context:
- backend
- frontend
- backend
- frontend

steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
- name: 🛎️ Checkout
uses: actions/checkout@v3

- run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [[ $GITHUB_REF == refs/tags/production* ]]; then
npm version major
elif [[ $GITHUB_REF == refs/tags/staging* ]]; then
npm version minor
else
npm version patch
fi
- run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [[ $GITHUB_REF == refs/tags/production* ]]; then
npm version major
elif [[ $GITHUB_REF == refs/tags/staging* ]]; then
npm version minor
else
npm version patch
fi
- name: 📝 Get Current Version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: 📝 Get Current Version
id: package-version
uses: martinbeentjes/npm-get-version-action@main

- name: 🔐 Login to Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🔐 Login to Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🔧 Build and push Docker Image
uses: docker/build-push-action@v4
with:
build-args: |
BACKEND_URL=/api
context: ./packages/${{ matrix.context }}
push: true
tags: |
ghcr.io/bostads-ab-mimer/yggdrasil-tenant-portal-${{ matrix.context }}:${{ steps.package-version.outputs.current-version}}
- name: 🔧 Build and push Docker Image
uses: docker/build-push-action@v4
with:
build-args: |
BACKEND_URL=/api
context: ./packages/${{ matrix.context }}
push: true
tags: |
ghcr.io/bostads-ab-mimer/onecore-tenant-portal-${{ matrix.context }}:${{ steps.package-version.outputs.current-version}}
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
context: ./packages/${{ matrix.context }}
push: true
tags: |
ghcr.io/bostads-ab-mimer/yggdrasil-tenant-portal-${{ matrix.context }}:release-${{ github.event.release.tag_name }}
ghcr.io/bostads-ab-mimer/onecore-tenant-portal-${{ matrix.context }}:release-${{ github.event.release.tag_name }}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "yggdrasil-tenant-portal",
"name": "onecore-tenant-portal",
"version": "1.0.51",
"description": "Tenant web portal",
"main": "index.js",
Expand All @@ -8,13 +8,13 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Bostads-AB-Mimer/yggdrasil-tenant-portal.git"
"url": "git+https://github.com/Bostads-AB-Mimer/onecore-tenant-portal.git"
},
"author": "Anders Norrback Bornholm",
"license": "ISC",
"bugs": {
"url": "https://github.com/Bostads-AB-Mimer/yggdrasil-tenant-portal/issues"
"url": "https://github.com/Bostads-AB-Mimer/onecore-tenant-portal/issues"
},
"homepage": "https://github.com/Bostads-AB-Mimer/yggdrasil-tenant-portal#readme",
"homepage": "https://github.com/Bostads-AB-Mimer/onecore-tenant-portal#readme",
"dependencies": {}
}
10 changes: 5 additions & 5 deletions packages/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ Backend for the tenant portal for Mimer.

Start the development server: `npm run dev`

Note: You need to have yggdrasil-core and yggdrasil-tenants-leases running for this application to work.
Note: You need to have onecore-core, onecore-leasing and onecore-property-management running for this application to work.

## Env

- CORE\_\_URL - Url to yggdrasil-core
- CORE\_\_USERNAME - Username for service account in yggdrasil-core (configured in that application)
- CORE\_\_PASSWORD - Password for service account in yggdrasil-core (configured in that application)
- CORE\_\_URL - Url to onecore-core
- CORE\_\_USERNAME - Username for service account in onecore-core (configured in that application)
- CORE\_\_PASSWORD - Password for service account in onecore-core (configured in that application)
- AUTH\_\_COOKIE_DOMAIN - Set to "localhost" for local dev environment
- AUTH**TEST_ACCOUNT**ID - National registration number of a contact present in the database for yggdrasil-tenants-leases
- AUTH**TEST_ACCOUNT**ID - National registration number of a contact present in the database for onecore-leasing
- AUTH**TEST_ACCOUNT**USERNAME - Login username for the (currently only) user in the portal
- AUTH**TEST_ACCOUNT**SALT - Salt for portal user (create with /auth/generate-hash)
- AUTH**TEST_ACCOUNT**HASH - Password hash for user (create with /auth/generate-hash)
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const publicRouter = new KoaRouter()
authRoutes(publicRouter)
app.use(publicRouter.routes())

app.use(jwt({ secret: config.auth.secret, cookie: 'yggdrasil' }))
app.use(jwt({ secret: config.auth.secret, cookie: 'onecore' }))

app.use(api.routes())

Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/services/auth-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const routes = (router: KoaRouter) => {
})

router.get('(.*)/auth/logout', async (ctx) => {
ctx.cookies.set('yggdrasil', null, {
ctx.cookies.set('onecore', null, {
httpOnly: true,
overwrite: true,
sameSite: 'lax',
Expand All @@ -28,7 +28,7 @@ export const routes = (router: KoaRouter) => {

const token = await createToken(personalNumber)

ctx.cookies.set('yggdrasil', token.token, {
ctx.cookies.set('onecore', token.token, {
httpOnly: true,
overwrite: true,
sameSite: 'lax',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const app = new Koa()
const router = new KoaRouter()
routes(router)
app.use(bodyParser())
app.use(koaJwt({ secret: config.auth.secret, cookie: 'yggdrasil' }))
app.use(koaJwt({ secret: config.auth.secret, cookie: 'onecore' }))
app.use(router.routes())

describe('lease-service index', () => {
Expand Down
7 changes: 5 additions & 2 deletions packages/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAACBklEQVR4Ae2av0tCURTHv0YGpoTa4KKgDlFEKdiQWwTSqktr9RdUf4H6F/gn5NDUFk1NVkuLhFSTQwk11FBK9AMyqHcfFGnP98N8PK7nfEDQqxc8H849957Lc2H34BOEGQFxWACIwwJAHBYA4rAAEIcFgDgsAMRhASAOCwBxLAvwu93Iz02hubqC6+wy1uNhyIzL7JWYCHxzOoatmZj6/jeNl1cUz+soX91CNgwF6AXejYwiDAWINI96x2GF/Zs7ZE+qkAHDGmA1eEEiOAFZ4F0ANtBP1jiFbRngHxuFDNgnwD0GGbBNQNTngQwY5mlg71BJZzesIs4EMmAooNVuq69hxdZKtRSaxE468We89f6BjdMaas0n9bPYNUR/YcT22aU6VyBOpdlISPf3R/ePhploq4Co16O9JXrxs6zE95XMoqmts3hRVwWI4CuZNJIB/QOXOJYXlDl6OHoQshL8N2aDN4tjm/VaPKIskaCl4MXOUkotDCx4gWMCsuGQWgMaz28d4+qy8WlLKaVmlSXQVtb2Q8e4qDX94piAnNItdgciKCjFMD+vXRBzx1XNolZOJ5WM6u9ihpshEIcFgDgsAMRhASDOUAswczvtsvth6V5nfb021eoc0SD1urRxtB028wcGMec/lzZcA0AcFgDisAAQhwWAOCwAxGEBIA4LAHFYAIhDXsAXbmaKq1WkhIEAAAAASUVORK5CYII=" />
<link
rel="apple-touch-icon"
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAACBklEQVR4Ae2av0tCURTHv0YGpoTa4KKgDlFEKdiQWwTSqktr9RdUf4H6F/gn5NDUFk1NVkuLhFSTQwk11FBK9AMyqHcfFGnP98N8PK7nfEDQqxc8H849957Lc2H34BOEGQFxWACIwwJAHBYA4rAAEIcFgDgsAMRhASAOCwBxLAvwu93Iz02hubqC6+wy1uNhyIzL7JWYCHxzOoatmZj6/jeNl1cUz+soX91CNgwF6AXejYwiDAWINI96x2GF/Zs7ZE+qkAHDGmA1eEEiOAFZ4F0ANtBP1jiFbRngHxuFDNgnwD0GGbBNQNTngQwY5mlg71BJZzesIs4EMmAooNVuq69hxdZKtRSaxE468We89f6BjdMaas0n9bPYNUR/YcT22aU6VyBOpdlISPf3R/ePhploq4Co16O9JXrxs6zE95XMoqmts3hRVwWI4CuZNJIB/QOXOJYXlDl6OHoQshL8N2aDN4tjm/VaPKIskaCl4MXOUkotDCx4gWMCsuGQWgMaz28d4+qy8WlLKaVmlSXQVtb2Q8e4qDX94piAnNItdgciKCjFMD+vXRBzx1XNolZOJ5WM6u9ihpshEIcFgDgsAMRhASDOUAswczvtsvth6V5nfb021eoc0SD1urRxtB028wcGMec/lzZcA0AcFgDisAAQhwWAOCwAxGEBIA4LAHFYAIhDXsAXbmaKq1WkhIEAAAAASUVORK5CYII="
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Yggdrasil hyresgästportal</title>
<title>ONECore hyresgästportal</title>
</head>
<body>
<div id="root"></div>
Expand Down

0 comments on commit 0d2b1fe

Please sign in to comment.