e-Spirit / FSDevTools

Project to support developer experience (DX) with FirstSpirit template development by offering a connection between a VCS like Git and FirstSpirit.
Apache License 2.0
28 stars 20 forks source link

Clarify Import/Export #57

Closed ykorzikowski closed 9 months ago

ykorzikowski commented 10 months ago

Hi,

as I stated out in my other issue I am currently automating the provisioning of FirstSpirit.

It is a bit unclear to me, how the import/export on the gui and the fs-cli tool is working and if they are doing the same.

As far as I understand, there are two options of export: Full Project Export (fs-cli project export and only the First Spirit content fs-cli export).

The first one on the GUI gives me a big tar.gz, the second a slim zip file.

However, how can I import the tar.gz file with the fs-cli? This is my approach so far:

#!/bin/bash

# WARNING: This file is managed by Ansible.
# DO NOT EDIT THIS FILE MANUALLY.
# Any changes made directly to this file may be overwritten by Ansible.

set -eux

export JAVA_HOME="/usr/java/latest/"

sh {{ fs_cli_path }} \
-e \
-port "{{ fs_tomcat_port }}" \
-p "{{ fs_project_name }}" \
-h "{{ fs_host_name }}" \
-u admin \
-pwd "{{ fs_admin_password }}" \
-sd "{{ fs_content_dir }}" \
import

I choose the tar.gz for fs_content_dir , but it expects a unpacked directory. Do I need to unpack this tar.gz first or is there also a option to add the tar.gz as parameter?

Thanks in advance :)

kafmann-e-spirit commented 10 months ago

Hey @ykorzikowski,

I'm not quite sure if I understand you correctly but I will try to help :)

First of all, the CLI does have different commands for different export scenarios:

I hope this clarifies it a bit, but feel free to ask more :)

ykorzikowski commented 9 months ago

Hi @kafmann-e-spirit ,

yes this helped a lot. Checking the source for the correct cli parameters helped, too :) https://github.com/e-Spirit/FSDevTools/blob/82c7455e751c86dd95850a60ce8463aa80eac313/fsdevtools-commands/project/src/main/java/com/espirit/moddev/cli/commands/project/exportCommand/ExportProjectCommand.java#L51