Praqma / staci

Containerizing the Atlassian tools stack. Jira, Confluence, Bamboo and a MySQL database.
MIT License
12 stars 5 forks source link

Injecting Jira software and service desk license to backup file #64

Open hoeghh opened 7 years ago

hoeghh commented 7 years ago

Right now we can only import one license. If you have both Jira software and service desk installed, you need two.

When we use STACI to spin up a test system, based on a backup we can only update one of them with a developer licens.

We need to fix this.

I've attached the zip file, containing the XML file entities.xml. This has the old values for both Jira software and Jira Service desk licenses. We need to be able to change then both, if applicable. So a function that takes the path to the zip file, and then fetches the licenses from the staci.properties, and replaces them in the file. It should then zip it again so that its ready for an import.

Sample XML file output (1001 is Jira Software):

    <ProductLicense id="10001" license="AAABbg0ODAoPeNp9UUtPwkAQvu+vaOJFD9ssBQ2SbCK2q9bwbNF48LKWAVZhW2e3KP/eQmsEeSR7mdmZ7zVnoxycdj51mOeweqt4jYbjByPHY7UrMkUAPUuzDNDtqAS0ATFWVqWai95IRIMojAXp5Ys3wP7kyQAaTmvkXaF097qDHJOZNBBIC3wNT1mTMo9UwKNVBj25AO73u10R+WG78/slvjOFq629a8pqxE+1lYkVXanmfAazmwzl50K6GiyJAZeAYcBvo+EL7Q7ZPfWemE/rd8Iv5WWYjvPEuuuCmnRivySCW+CpJXCLOZRjx10fyOaQhUKdtqClTo7YOKFmL8KKp/DVCYNY9GinWWcNr35JioLvNE7AxlaiBeQTOTdA+jiVWhm58fcAGtUH8RE29f9TzUv+50LOetrbCQEKn5ihMlV+AZgEVbbBfQyjthNXApzz8jwXry1HLOU833CVio8d4FC02+Tbe3+YZf0DXx373jAsAhRPcpgH7xykrq6WaohjwRAYClcJDAIUFuuNl9YRVac52Ngoin3thukWwGQ=X02ht"/>
    <ProductLicense id="10002" license="AAABTQ0ODAoPeNp1UcFOg0AUvO9XkHjRw5KFqtEmm1hhVQylLVDjwctKX9tVuuBjaezfS8HGqu3xvZ2ZNzN7ktZgDeqFxVyL9fqM9Z0Ly/NTy2XOJYnq1SvgaD6tACtOHfKmUNolFrM6M/Z2oFmBYB/G/duOa8yWsgJfGuDbA5RdUeaSUGWgK0g3JURyBdwbDYci9oJBuHsSn6XCzR7vmjKHeIU2MjNiKFXOl7C8KVF+rKStwZAEcA0Y+Pw2njzT4YTdU3fKPNq7E96xGImRaAD5XOYVdKDd/ZkyqtBcRKmIx3GQiGMajR+1Bm6wBtL40ga01NmRAN/qjcsw8BMR0fCqx85dxyXNwH8tRriQWlWytfEAGtU78RDa+W+feSf71NS+RbvEhypDVbbcxyAeWF5j1TrtOjp76VtiLfO61epy7afY7+HQF/1wO/wX6QbE6DAsAhQ/fkuE/jKXluZto3dg2ZoP6H6aVQIUMONDLRwBV8cchLx0KYnKl4I7ASU=X02gg"/>

Then we dont need the license when calling the importer in $STACI_HOME/functions/autoconfig.f function setupJira line 84.

       curl -F filename="jirabackup.zip" -F license="$importJiraLicens" -F outgoingEmail="false" -F downgradeAnyway="False" "http://localhost:8080/jira/secure/SetupImport.jspa"

The function should be called in file $STACI_HOME/functions/autoconfig.f line 80. Before we copy the zipfile to the container.

The backup file : jirabackup.zip