Skip to content

Working with GitFlic CLI


Overview

Starting from version 3.0.0, GitFlic has changed its approach to handling LFS and release files.
Starting from version 3.3.0, GitFlic has modified its Docker registry operations.
Starting from version 4.3.0, GitFlic has updated its image handling mechanism.

* cli.jar requires Java Virtual Machine version 11 or higher.
* Since version 3.0.0, the distribution includes both cli.jar and the gitflic-cli.sh launcher.
* The cli.jar application requires access to Postgresql and Redis/KeyDB databases used by GitFlic.
* The cli.jar application needs access to static files used by GitFlic.
* You must use the gitflic-cli.sh script to launch cli.jar.
* You must use the same application.properties file as your GitFlic installation.
* You must use the cli.jar from your specific GitFlic version package.

For migration to version 3.x.x, see this page For troubleshooting, see troubleshooting guide

Available Commands

* Without additional arguments, commands apply to the entire GitFlic installation.

Command Arguments Description
fix lfs None Fixes LFS files
fix releases None Fixes release files
fix docker manifest --package-container-uuid <package_uuid> Fixes docker manifest files. When –package-container-uuid <package_uuid> is specified, only fixes the specified package.
fix images None Fixes image storage logic

Usage Instructions

1. Extract the GitFlic archive:

unzip gitflic_3.0.0_free.zip

2. Navigate to the cli directory:

cd /path/to/archive/cli

3. Make the script executable:

chmod +x ./gitflic-cli.sh

4. Run the script:

./gitflic-cli.sh /path/to/gitflic/properties/application.properties
# Example: ./gitflic-cli.sh /user/admin/gitflic/default-config/application.properties

5. Wait for the script to launch:

2024-02-22 14:36:32.630  INFO 7 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'application.errorChannel' has 1 subscriber(s).
2024-02-22 14:36:32.631  INFO 7 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started bean '_org.springframework.integration.errorLogger'
shell:>

6. Enter the required command (e.g., fix releases) and wait for completion. Sample output for fix releases:

Initial log:

2024-02-14 14:37:50.291  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : --- Counting releases --- 
2024-02-14 14:37:50.457  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : Total releases: 24
2024-02-14 14:37:50.458  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : ----------------------------------------- 

Completion log:

2024-02-14 14:37:51.004  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : Migrated: 24/24 (100.00%) releases
2024-02-14 14:37:51.004  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : Task completed

7. After successful execution, exit the application with ctrl+c

Usage for Docker-based GitFlic Installations

1. Stop the GitFlic container.
2. If databases were created in containers, ensure Postgres and Redis containers are running and accessible.
3. Extract the GitFlic archive and navigate to the root directory
4. In docker/.env, uncomment DATA_VOLUME and ETC_VOLUME variables, specifying the corresponding GitFlic volume names. For custom .env files, add DATA_VOLUME, ETC_VOLUME, and CERT_VOLUME variables with appropriate volume names. 5. Create the container:

docker compose --env-file docker/.env --file cli/docker/docker-compose.yaml create

--env-file - Path to GitFlic environment variables file
--file - Path to CLI docker-compose yaml file

6. Access the created container (ensure correct docker network and database access):

docker run -ti --env-file docker/.env --network git_net --entrypoint=bash docker-fixcli

--env-file - Same as in step 5
--network - Docker network containing Postgres and Redis containers
--entrypoint=bash - Container entry point (leave unchanged)
docker-fixcli - Container name from step 5

7. After container access, launch the application:

./gitflic-cli.sh ./application.properties

8. Wait for script launch:

2024-02-22 14:36:32.630  INFO 7 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'application.errorChannel' has 1 subscriber(s).
2024-02-22 14:36:32.631  INFO 7 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started bean '_org.springframework.integration.errorLogger'
shell:>

9. Enter the required command (e.g., fix releases) and wait for completion. Sample output:

Initial log:

2024-02-14 14:37:50.291  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : --- Counting releases --- 
2024-02-14 14:37:50.457  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : Total releases: 24
2024-02-14 14:37:50.458  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : ----------------------------------------- 

Completion log:

2024-02-14 14:37:51.004  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : Migrated: 24/24 (100.00%) releases
2024-02-14 14:37:51.004  INFO 70237 --- [           main] c.gitflic.cli.service.ReleaseFixService  : Task completed

10. After successful execution, exit with ctrl+c and remove containers/images created in steps 5-6.

Automatic translation!

This page has been automatically translated. The text may contain inaccuracies.