Skip to content

Commit

Permalink
Merge pull request #490 from SquirrelCorporation/master-to-release
Browse files Browse the repository at this point in the history
[CHORE] Create PR from master to release
  • Loading branch information
SquirrelDeveloper authored Nov 17, 2024
2 parents 4e372bf + 840c5cb commit 33a85a5
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 60 deletions.
87 changes: 43 additions & 44 deletions .github/workflows/create-release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,46 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install tar
run: sudo apt-get install tar

- name: Determine version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "version=$VERSION" >> $GITHUB_ENV
- name: Print version
run: |
echo "Version to be used: ${{ env.version }}"
- name: Clean up and create package
run: |
mkdir -p release_package
cp -r client release_package/
cp -r server release_package/
cp -r shared-lib release_package/
tar -czf SquirrelServersManager_${{ env.version }}.tar.gz -C release_package .
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: SquirrelServersManager_${{ env.version }}
path: SquirrelServersManager_${{ env.version }}.tar.gz

- name: Overwrite latest version
run: |
cp SquirrelServersManager_${{ env.version }}.tar.gz SquirrelServersManager_latest.tar.gz
- name: Upload latest artifact
uses: actions/upload-artifact@v3
with:
name: SquirrelServersManager_latest
path: SquirrelServersManager_latest.tar.gz
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install tar
run: sudo apt-get install tar

- name: Determine version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "version=$VERSION" >> $GITHUB_ENV
- name: Print version
run: |
echo "Version to be used: ${{ env.version }}"
- name: Clean up and create package
run: |
mkdir -p release_package
cp -r client release_package/
cp -r server release_package/
cp -r shared-lib release_package/
tar -czf SquirrelServersManager_${{ env.version }}.tar.gz -C release_package .
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: SquirrelServersManager_${{ env.version }}
path: SquirrelServersManager_${{ env.version }}.tar.gz

- name: Overwrite latest version
run: |
cp SquirrelServersManager_${{ env.version }}.tar.gz SquirrelServersManager_latest.tar.gz
- name: Release
uses: softprops/action-gh-release@v2
with:
files: SquirrelServersManager_latest.tar.gz
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.data.dev/
.idea/
.idea/
/.idea/
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

## [Unreleased](https://github.com/SquirrelCorporation/SquirrelServersManager/tree/HEAD)

[Full Changelog](https://github.com/SquirrelCorporation/SquirrelServersManager/compare/v0.1.22...HEAD)
[Full Changelog](https://github.com/SquirrelCorporation/SquirrelServersManager/compare/v0.1.23...HEAD)

**Fixed bugs:**

- \[BUG\] Update versions and improve error handling [\#489](https://github.com/SquirrelCorporation/SquirrelServersManager/pull/489) ([SquirrelDeveloper](https://github.com/SquirrelDeveloper))

## [v0.1.23](https://github.com/SquirrelCorporation/SquirrelServersManager/tree/v0.1.23) (2024-11-15)

[Full Changelog](https://github.com/SquirrelCorporation/SquirrelServersManager/compare/v0.1.22...v0.1.23)

**Implemented enhancements:**

Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ssm-client",
"version": "0.1.23",
"version": "0.1.24",
"private": true,
"description": "SSM Client - A simple way to manage all your servers",
"author": "Squirrel Team",
Expand Down
2 changes: 1 addition & 1 deletion release.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.1.22"
"version": "0.1.23"
}
2 changes: 1 addition & 1 deletion server-demo/src/data/current-user.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"considerOffLineAfter": 3
},
"server": {
"version": "0.1.22",
"version": "0.1.23",
"deps": {
"@aws-sdk/client-ecr": "^3.632.0",
"axios": "^1.7.4",
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test:python:run": "cd ./src/ansible && python3 -m unittest discover -s . -p \"*.py\"",
"coverage": "vitest run --coverage"
},
"version": "0.1.23",
"version": "0.1.24",
"author": "Squirrel Team",
"dependencies": {
"@aws-sdk/client-ecr": "^3.687.0",
Expand Down
7 changes: 6 additions & 1 deletion server/src/controllers/rest/user/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { getAnsibleRunnerVersion, getAnsibleVersion } from '../../../core/system
import { getFromCache, getIntConfFromCache } from '../../../data/cache';
import { Role } from '../../../data/database/model/User';
import UserRepo from '../../../data/database/repository/UserRepo';
import logger from '../../../logger';
import { AuthFailureError } from '../../../middlewares/api/ApiError';
import { SuccessResponse } from '../../../middlewares/api/ApiResponse';
import { createADefaultLocalUserRepository } from '../../../modules/repository/default-playbooks-repositories';
Expand Down Expand Up @@ -110,7 +111,11 @@ export const createFirstUser = async (req, res) => {
role: Role.ADMIN,
avatar: avatar || '/avatars/squirrel.svg',
});
await createADefaultLocalUserRepository();
try {
await createADefaultLocalUserRepository();
} catch (error: any) {
logger.error(error);
}
new SuccessResponse('Create first user').send(res);
};

Expand Down
8 changes: 1 addition & 7 deletions server/src/core/startup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Startup {

private async initializeModules() {
await PlaybooksRepositoryEngine.init();
void PlaybooksRepositoryEngine.syncAllRegistered();
void sshPrivateKeyFileManager.removeAllAnsibleTemporaryPrivateKeys();
void NotificationComponent.init();
void Crons.initScheduledJobs();
Expand Down Expand Up @@ -89,13 +90,6 @@ class Startup {
this.logger.error(`Error setting Ansible versions: ${error.message}`);
}

try {
await PlaybooksRepositoryEngine.syncAllRegistered();
this.logger.info('All registered playbooks synced successfully.');
} catch (error: any) {
this.logger.error(`Error syncing all registered playbooks: ${error.message}`);
}

try {
this.registerPersistedProviders();
this.logger.info('Persisted providers registered successfully.');
Expand Down
2 changes: 1 addition & 1 deletion shared-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ssm-shared-lib",
"version": "0.1.23",
"version": "0.1.24",
"description": "",
"main": "./distribution/index.js",
"author": "Squirrel Team",
Expand Down
2 changes: 1 addition & 1 deletion shared-lib/src/enums/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export enum GeneralSettingsKeys {
}

export enum DefaultValue {
SCHEME_VERSION = '16',
SCHEME_VERSION = '17',
SERVER_LOG_RETENTION_IN_DAYS = '30',
CONSIDER_DEVICE_OFFLINE_AFTER_IN_MINUTES = '3',
CONSIDER_PERFORMANCE_GOOD_MEM_IF_GREATER = '10',
Expand Down

0 comments on commit 33a85a5

Please sign in to comment.