Merge branch 'plankanban:master' into master
commit
8a4bdbd1fe
@ -0,0 +1,34 @@
|
|||||||
|
name: Build and push Docker DEV image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-docker-image-dev:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ghcr.io/plankanban/planka:dev
|
||||||
@ -1,12 +1,42 @@
|
|||||||
const bcrypt = require('bcrypt');
|
const bcrypt = require('bcrypt');
|
||||||
|
|
||||||
exports.seed = (knex) =>
|
const buildData = () => {
|
||||||
knex('user_account').insert({
|
const data = {
|
||||||
email: 'demo@demo.demo',
|
|
||||||
password: bcrypt.hashSync('demo', 10),
|
|
||||||
isAdmin: true,
|
isAdmin: true,
|
||||||
name: 'Demo Demo',
|
};
|
||||||
username: 'demo',
|
|
||||||
|
if (process.env.DEFAULT_ADMIN_PASSWORD) {
|
||||||
|
data.password = bcrypt.hashSync(process.env.DEFAULT_ADMIN_PASSWORD, 10);
|
||||||
|
}
|
||||||
|
if (process.env.DEFAULT_ADMIN_NAME) {
|
||||||
|
data.name = process.env.DEFAULT_ADMIN_NAME;
|
||||||
|
}
|
||||||
|
if (process.env.DEFAULT_ADMIN_USERNAME) {
|
||||||
|
data.username = process.env.DEFAULT_ADMIN_USERNAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.seed = async (knex) => {
|
||||||
|
if (!process.env.DEFAULT_ADMIN_EMAIL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = buildData();
|
||||||
|
|
||||||
|
try {
|
||||||
|
await knex('user_account').insert({
|
||||||
|
...data,
|
||||||
|
email: process.env.DEFAULT_ADMIN_EMAIL,
|
||||||
subscribeToOwnCards: false,
|
subscribeToOwnCards: false,
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
if (Object.keys(data).length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await knex('user_account').update(data).where('email', process.env.DEFAULT_ADMIN_EMAIL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue