Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Story#12585: delete ui components and update packaging #1874

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
48 changes: 28 additions & 20 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,7 @@ pipeline {
steps {
sh '''
$MVN_COMMAND clean verify -U -Pvitam \
--projects '!cots/vitamui-mongo-express' \
--projects '!ui/ui-archive-search' \
--projects '!ui/ui-collect' \
--projects '!ui/ui-commons' \
--projects '!ui/ui-frontend' \
--projects '!ui/ui-frontend-common' \
--projects '!ui/ui-identity' \
--projects '!ui/ui-ingest' \
--projects '!ui/ui-pastis' \
--projects '!ui/ui-portal' \
--projects '!ui/ui-referential'
--projects '!cots/vitamui-mongo-express'
'''
}
}
Expand All @@ -126,6 +116,32 @@ pipeline {
}
}

stage('Package and push to repository') {
when {
environment(name: 'DO_DEPLOY', value: 'true')
}
parallel {
stage('Package back packages') {
steps {
sh '''
$MVN_COMMAND deploy -Pvitam,deb,rpm -DskipTests -DskipAllFrontend=true -DskipAllFrontendTests=true -Dlicense.skip=true --projects '!cots/vitamui-mongo-express'
'''
}
}
stage('Package Frontend') {
steps {
script {
sh '''
POM_VERSION=$(xpath -e '/project/version/text()' pom.xml 2>/dev/null)
./tools/packaging/package-fronts.sh ui-identity,ui-archive-search,ui-portal,ui-pastis,ui-collect,ui-referential,ui-ingest,ui-starter-kit ${POM_VERSION}
'''
}
}
}
}
}


stage('Deploy to Nexus') {
when {
environment(name: 'DO_DEPLOY', value: 'true')
Expand All @@ -145,15 +161,7 @@ pipeline {
sh '''
$MVN_COMMAND install \
-D skipTests \
-P vitam \
--projects '!ui/ui-archive-search' \
--projects '!ui/ui-collect' \
--projects '!ui/ui-commons' \
--projects '!ui/ui-identity' \
--projects '!ui/ui-ingest' \
--projects '!ui/ui-pastis' \
--projects '!ui/ui-portal' \
--projects '!ui/ui-referential'
-P vitam
'''
sh '''
$MVN_COMMAND deploy \
Expand Down
40 changes: 1 addition & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@
<rpm.jar-file>${project.build.finalName}.jar</rpm.jar-file>
<!-- Put this properties to false sub-module when you want to use profile -->
<rpm.skip>true</rpm.skip>
<rpm_rsc.skip>true</rpm_rsc.skip>
<rpm.publication.env>dev</rpm.publication.env>
<!-- Swagger doc generation -->
<swagger.dir>.</swagger.dir>
Expand Down Expand Up @@ -2108,27 +2107,9 @@
</arguments>
</configuration>
</execution>
<execution>
<id>rpm-package-front</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>make</executable>
<workingDirectory>target</workingDirectory>
<skip>${rpm_rsc.skip}</skip>
<arguments>
<argument>-f</argument>
<argument>${main.basedir}/tools/packaging/Makefile-fronts</argument>
<argument>rpm</argument>
<argument>NAME=${project.artifactId}</argument>
<argument>VERSION=${project.version}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</profile>
Expand Down Expand Up @@ -2166,25 +2147,6 @@
</arguments>
</configuration>
</execution>
<execution>
<id>deb-package-front</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>make</executable>
<workingDirectory>target</workingDirectory>
<skip>${rpm_rsc.skip}</skip>
<arguments>
<argument>-f</argument>
<argument>${main.basedir}/tools/packaging/Makefile-fronts</argument>
<argument>deb</argument>
<argument>NAME=${project.artifactId}</argument>
<argument>VERSION=${project.version}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
8 changes: 4 additions & 4 deletions tools/packaging/Makefile-fronts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Staging root configuration
DESTDIR := $(abspath ./package-stage/)
STAGING_ROOT = $(abspath $(DESTDIR)/)
Expand Down Expand Up @@ -28,7 +27,7 @@ FPM_PACK_REMOVE_SCRIPTS = --after-remove "$(TEMPLATE_TMP_DIR)/after-remove-r

# variable used to copy
NAME_WITHOUT_SUFFIX := $(subst ui-,,$(NAME))
RESSOURCE_DIR_ORIGIN := $(abspath ../../ui-frontend/dist/$(NAME_WITHOUT_SUFFIX)/)
RESSOURCE_DIR_ORIGIN := $(abspath $(STAGING_ROOT)/../../../ui/ui-frontend/dist/$(NAME_WITHOUT_SUFFIX)/)
RESSOURCE_DIR_DEST := $(abspath $(STAGING_ROOT)/vitamui/data/)

clean:
Expand Down Expand Up @@ -57,8 +56,9 @@ template-files:

install: clean stage vitamui-dirs template-files
@echo "Ressources origin: $(RESSOURCE_DIR_ORIGIN)"
@echo "Ressources dest: $(RESSOURCE_DIR_DEST))"
sudo mkdir -p -m 750 $(RESSOURCE_DIR_DEST)
@echo "Ressources dest: $(RESSOURCE_DIR_DEST)"

sudo mkdir -p -m 750 $(RESSOURCE_DIR_DEST)
cp -r $(RESSOURCE_DIR_ORIGIN) $(abspath $(RESSOURCE_DIR_DEST))

rpm: install
Expand Down
35 changes: 35 additions & 0 deletions tools/packaging/package-fronts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

MODULES="$1"
VERSION="$2"

echo "$MODULES"
echo "$VERSION"


# Check if VERSION and MODULES environment variables are set
if [ -z "$VERSION" ] || [ -z "$MODULES" ]; then
echo "ERROR: VERSION or MODULES environment variables are not set."
exit 1
fi

# Split the modules list by comma into an array
IFS=',' read -r -a modules_array <<< "$MODULES"

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cd "$DIR"
#Rpm packaging
for MODULE in "${modules_array[@]}"; do
echo "Packaging module: $MODULE"
# Call make passing module and version as parameters
make -f "Makefile-fronts" rpm NAME="$MODULE" VERSION="$VERSION"
done


#Deb Packaging
for MODULE in "${modules_array[@]}"; do
echo "Packaging module: $MODULE"
# Call make passing module and version as parameters
make -f "Makefile-fronts" deb NAME="$MODULE" VERSION="$VERSION"
done
8 changes: 0 additions & 8 deletions ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
<modules>
<module>ui-frontend-common</module>
<module>ui-frontend</module>
<module>ui-commons</module>
<module>ui-portal</module>
<module>ui-identity</module>
<module>ui-referential</module>
<module>ui-ingest</module>
<module>ui-archive-search</module>
<module>ui-pastis</module>
<module>ui-collect</module>
</modules>

</project>
6 changes: 0 additions & 6 deletions ui/ui-archive-search/package-lock.json

This file was deleted.

Loading