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
e404aa69
Commit
e404aa69
authored
1 year ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
chore: Add opts to mvn deploy, remove verbose ssh
parent
5b0b94c2
No related branches found
No related tags found
1 merge request
!35
build: New dummy version for testing the pipeline
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+3
-9
3 additions, 9 deletions
.gitlab-ci.yml
with
3 additions
and
9 deletions
.gitlab-ci.yml
+
3
−
9
View file @
e404aa69
...
...
@@ -180,7 +180,7 @@ deploy-to-production:
-
echo "deploy $TMP_PATH/$WAR_FILE --force" > deploy.cli
-
scp deploy.cli $SERVER_USER@$SERVER_IP:$TMP_PATH
# Find name of currently deployed application. Undeploy.
-
CURRENTLY_DEPLOYED=$(ssh
-vvv
$SERVER_USER@$SERVER_IP "$CLI_PATH/jboss-cli.sh --user=$WILDFLY_ADMIN_USERNAME --password=$WILDFLY_ADMIN_PASSWORD --connect --commands=ls\ deployment | tr ' ' '\n' | grep VIPSCore-.*war")
-
CURRENTLY_DEPLOYED=$(ssh $SERVER_USER@$SERVER_IP "$CLI_PATH/jboss-cli.sh --user=$WILDFLY_ADMIN_USERNAME --password=$WILDFLY_ADMIN_PASSWORD --connect --commands=ls\ deployment | tr ' ' '\n' | grep VIPSCore-.*war")
-
echo $CURRENTLY_DEPLOYED
-
if [ -n "$CURRENTLY_DEPLOYED" ]; then ssh $SERVER_USER@$SERVER_IP "$CLI_PATH/jboss-cli.sh --user=$WILDFLY_ADMIN_USERNAME --password=$WILDFLY_ADMIN_PASSWORD --connect --command='undeploy $CURRENTLY_DEPLOYED'"; fi
# Deploy war file using JBoss CLI and credentials given in CI/CD variables
...
...
@@ -225,14 +225,8 @@ upload-and-tag-release:
# Find name of war file in target folder (built previously in build stage), exit if none exists
-
WAR_FILE=$(find target -maxdepth 1 -type f -name "*.war" | sort -n | tail -1 | xargs basename)
-
if [ -z "$WAR_FILE" ]; then echo "No war file found in target directory"; exit 1; fi
-
echo "War file built in build job '$WAR_FILE'"
# Old way of deploying newly built war:
# - "./mvnw $MAVEN_POM_WITH_MODELS $MAVEN_CLI_OPTS $MAVEN_OPTS deploy -DskipTests"
# TRY THIS - MIGHT NOT WORK DUE TO MISSING repositoryId and url - https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html
-
"
./mvnw
deploy:deploy-file
-DpomFile=pom.xml
-Dfile=target/$WAR_FILE
-Durl=$MAVEN_PACKAGE_REGISTRY"
-
echo "Deploy war file built in build job '$WAR_FILE'"
-
"
./mvnw
$MAVEN_CLI_OPTS
$MAVEN_OPTS
deploy:deploy-file
-DpomFile=pom.xml
-Dfile=target/$WAR_FILE"
-
git tag -a $RELEASE_TAG -m "Tag release ${RELEASE_TAG}"
-
git push origin $RELEASE_TAG
...
...
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