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
e29d1555
Commit
e29d1555
authored
1 year ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
chore: Archive existing deployment, start Wildfly
parent
b95be038
No related branches found
No related tags found
1 merge request
!7
Gnuaffero
Pipeline
#2459
passed
1 year ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+11
-5
11 additions, 5 deletions
.gitlab-ci.yml
with
11 additions
and
5 deletions
.gitlab-ci.yml
+
11
−
5
View file @
e29d1555
...
@@ -12,6 +12,8 @@ variables:
...
@@ -12,6 +12,8 @@ variables:
MAVEN_OPTS
:
"
-Dmaven.repo.local=.m2/repository
-Dmaven.artifact.threads=10"
MAVEN_OPTS
:
"
-Dmaven.repo.local=.m2/repository
-Dmaven.artifact.threads=10"
MAIN_BRANCH
:
"
main"
MAIN_BRANCH
:
"
main"
RELEASE_BRANCH
:
"
release"
RELEASE_BRANCH
:
"
release"
DEPLOYMENT_PATH
:
"
/home/wildfly/deployments"
ARCHIVE_PATH
:
"
/home/wildfly/archive"
cache
:
cache
:
paths
:
paths
:
...
@@ -35,16 +37,20 @@ deploy-to-staging:
...
@@ -35,16 +37,20 @@ deploy-to-staging:
-
mkdir -p ~/.ssh
-
mkdir -p ~/.ssh
-
echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
-
echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
-
chmod 600 ~/.ssh/id_dsa
-
chmod 600 ~/.ssh/id_dsa
#- cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
#- chmod 644 ~/.ssh/known_hosts
-
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
-
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
-
"
./mvnw
$MAVEN_POM_WITH_MODELS
$MAVEN_CLI_OPTS
$MAVEN_OPTS
package
-DskipTests"
-
"
./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)
-
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
-
if [ -z "$WAR_FILE" ]; then echo "No WAR files found in target directory"; exit 1; fi
-
echo "Stop
server
"
-
echo "Stop
Wildfly
"
-
ssh $SERVER_USER@$SERVER_IP "sudo systemctl stop wildfly"
-
ssh $SERVER_USER@$SERVER_IP "sudo systemctl stop wildfly"
-
echo "Deploying $WAR_FILE to server"
-
echo "Backup existing application"
-
scp "$WAR_FILE" $SERVER_USER@$SERVER_IP:/home/deployer/
-
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"
tags
:
tags
:
-
vips-java
-
vips-java
rules
:
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