Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSCore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSCore
Commits
6cc5a3be
Commit
6cc5a3be
authored
1 year ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
chore: First attempt of using JBoss CLI for deployment
parent
a9b4cc02
No related branches found
No related tags found
1 merge request
!7
Gnuaffero
Pipeline
#2461
failed
1 year ago
Stage: build
Stage: test
Stage: deploy
Stage: upload
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+14
-8
14 additions, 8 deletions
.gitlab-ci.yml
with
14 additions
and
8 deletions
.gitlab-ci.yml
+
14
−
8
View file @
6cc5a3be
...
...
@@ -15,7 +15,8 @@ variables:
MAVEN_OPTS
:
"
-Dmaven.repo.local=.m2/repository
-Dmaven.artifact.threads=10"
MAIN_BRANCH
:
"
main"
RELEASE_BRANCH
:
"
release"
DEPLOYMENT_PATH
:
"
/home/wildfly/deployments"
WILDFLY_PATH
:
"
/home/wildfly"
TMP_PATH
:
"
/home/wildfly/gitlab_tmp"
ARCHIVE_PATH
:
"
/home/wildfly/archive"
cache
:
...
...
@@ -58,16 +59,21 @@ deploy-to-staging:
-
"
./mvnw
$MAVEN_POM_WITH_MODELS
$MAVEN_CLI_OPTS
$MAVEN_OPTS
package
-DskipTests"
-
WAR_FILE=$(find target -maxdepth 1 -type f -name "*.war" | sort -n | tail -1)
-
if [ -z "$WAR_FILE" ]; then echo "No WAR files found in target directory"; exit 1; fi
-
echo "
Stop Wildfly
"
-
ssh $SERVER_USER@$SERVER_IP "
sudo systemctl stop wildfly
"
-
echo "
Backup existing
application"
-
echo "
Create temporary directory on the server
"
-
ssh $SERVER_USER@$SERVER_IP "
mkdir -p $TMP_PATH
"
-
echo "
Archive currently deployed
application"
-
CURRENT_VERSION=$(ssh $SERVER_USER@$SERVER_IP "ls $DEPLOYMENT_PATH/VIPSCore-*.war | head -n 1 | sed -n 's/.*VIPSCore-\(.*\)\.war/\1/p'")
-
TIMESTAMP=$(date +'%Y%m%d%H%M%S')
-
ssh $SERVER_USER@$SERVER_IP "mv $DEPLOYMENT_PATH/VIPSCore-${CURRENT_VERSION}.war $ARCHIVE_PATH/VIPSCore-${CURRENT_VERSION}-${TIMESTAMP}.war"
-
echo "Deploy $WAR_FILE"
-
scp "$WAR_FILE" $SERVER_USER@$SERVER_IP:$DEPLOYMENT_PATH
-
echo "Start Wildfly"
-
ssh $SERVER_USER@$SERVER_IP "sudo systemctl start wildfly"
-
echo "Deploy $WAR_FILE using JBoss CLI"
-
scp $WAR_FILE $SERVER_USER@$SERVER_IP:$TMP_PATH
-
echo "deploy $TMP_PATH/$WAR_FILE" > deploy.cli
-
scp deploy.cli $SERVER_USER@$SERVER_IP:$TMP_PATH
-
ssh $SERVER_USER@$SERVER_IP "/disks/data01/wildfly/wildfly-25.0.1.Final/bin/jboss-cli.sh --connect --file=$TMP_PATH/deploy.cli"
-
echo "Restart WildFly"
-
ssh $SERVER_USER@$SERVER_IP "sudo systemctl restart wildfly"
-
echo "Delete temporary directory"
-
ssh $SERVER_USER@$SERVER_IP "rm -rf $TMP_PATH"
tags
:
-
vips-java
rules
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment