Release/1.5.0 (#488)

This commit is contained in:
Nicolas Meienberger 2023-06-15 18:56:48 +02:00 committed by GitHub
parent f15cbf9ddc
commit b972f7b6e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 6 deletions

View file

@ -2,8 +2,7 @@ name: E2E Tests
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- release/*
@ -94,16 +93,22 @@ jobs:
- name: Wait 1 minute for Droplet to be ready
run: sleep 60
- name: Extract branch name from ref
id: extract-branch-name
run: |
branch_name=$(echo ${{ github.ref }} | sed 's/refs\/heads\///')
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
- name: Deploy app to Droplet
uses: fifsky/ssh-action@master
with:
command: |
echo 'Cloning repo on branch ${{ github.head_ref }}'
git clone --single-branch --branch ${{ github.head_ref }} https://github.com/${{ github.repository }}
git clone --single-branch --branch ${{ steps.extract-branch-name.outputs.branch_name }} https://github.com/${{ github.repository }}
echo 'Waiting for dpkg lock to be released'
cd runtipi
echo 'Checking out branch ${{ github.head_ref }}'
git checkout ${{ github.head_ref }}
echo 'Checking out branch ${{ steps.extract-branch-name.outputs.branch_name }}'
git checkout ${{ steps.extract-branch-name.outputs.branch_name }}
sudo ./scripts/start-e2e.sh e2e
echo 'App deployed'
host: ${{ steps.get-droplet-ip.outputs.droplet_ip }}

View file

@ -1,6 +1,6 @@
{
"name": "runtipi",
"version": "1.4.2",
"version": "1.5.0",
"description": "A homeserver for everyone",
"scripts": {
"copy:migrations": "mkdir -p dist/migrations && cp -r ./src/server/migrations dist",

View file

@ -255,6 +255,11 @@ const renderTemplate = (template: string, envMap: Map<string, string>) => {
export const copyDataDir = async (id: string) => {
const envMap = getEnvMap(id);
const appDataDirExists = (await fs.promises.lstat(`/runtipi/apps/${id}/data`).catch(() => false)) as fs.Stats;
if (!appDataDirExists || !appDataDirExists.isDirectory()) {
return;
}
const dataDir = await fs.promises.readdir(`/runtipi/apps/${id}/data`);
const processFile = async (file: string) => {

View file

@ -259,6 +259,7 @@ describe('Install app', () => {
it('should copy and replace env variables in deeply nested .templates files in data folder', async () => {
// arrange
const appConfig = createAppConfig({ form_fields: [{ env_variable: 'TEST', type: 'text', label: 'test', required: true }] });
await fs.promises.writeFile(`/runtipi/apps/${appConfig.id}/data/test.txt.template`, 'test {{TEST}}');
await fs.promises.mkdir(`/runtipi/apps/${appConfig.id}/data/test`);
await fs.promises.mkdir(`/runtipi/apps/${appConfig.id}/data/test/test`);
await fs.promises.writeFile(`/runtipi/apps/${appConfig.id}/data/test/test/test.txt.template`, 'test {{TEST}}');