Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpc-factory
Manage
Activity
Members
Labels
Plan
Issues
76
Issue boards
Milestones
Wiki
Code
Merge requests
13
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
rc
hpc-factory
Commits
81b69515
Commit
81b69515
authored
2 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Add test stage to test the newly built image
parent
1abcc2b7
No related branches found
No related tags found
1 merge request
!10
Add gitlab ci into project
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+23
-5
23 additions, 5 deletions
.gitlab-ci.yml
with
23 additions
and
5 deletions
.gitlab-ci.yml
+
23
−
5
View file @
81b69515
...
...
@@ -15,6 +15,7 @@ variables:
stages
:
-
build
-
test
-
deploy
build_image
:
...
...
@@ -61,16 +62,16 @@ build_image:
reports
:
dotenv
:
image.env
deploy_knightly
:
test
:
image
:
$CI_REGISTRY_IMAGE:latest
stage
:
deploy
stage
:
test
environment
:
name
:
knightly
tags
:
-
build
script
:
-
OLD_INSTANCE_ID=$(openstack server list --name ood-knightly -c ID -f value)
-
if [ ! -z $
OLD_INSTANCE_ID
]; then openstack server delete $OLD_INSTANCE_ID; fi
-
export
OLD_INSTANCE_ID=$(openstack server list --name ood-knightly -c ID -f value)
-
echo
OLD_INSTANCE_ID
=$OLD_INSTANCE_ID | tee -a instance.env
-
|
cat > user_data.txt << OEOF
#!/bin/bash
...
...
@@ -82,7 +83,7 @@ deploy_knightly:
ip route add 172.20.0.0/16 via 10.250.0.1 dev eth0
OEOF
-
>
NEW_INSTANCE_ID=$(openstack server create
export
NEW_INSTANCE_ID=$(openstack server create
-c id -f value --image $BUILT_OOD_IMAGE_ID
--network openstack-cheaha-internal
--security-group ood-https-ports
...
...
@@ -90,6 +91,23 @@ deploy_knightly:
--user-data user_data.txt
--flavor m1.medium
ood-knightly)
-
echo NEW_INSTANCE_ID=$NEW_INSTANCE_ID | tee -a instance.env
-
openstack server add floating ip $NEW_INSTANCE_ID $TEST_IP
-
ssh $TEST_IP systemctl is-active shibd.service
-
openstack server remove floating ip $NEW_INSTANCE_ID $TEST_IP
artifacts
:
reports
:
dotenv
:
instance.env
deploy_knightly
:
image
:
$CI_REGISTRY_IMAGE:latest
stage
:
deploy
environment
:
name
:
knightly
tags
:
-
build
script
:
-
if [ ! -z $OLD_INSTANCE_ID ]; then openstack server delete $OLD_INSTANCE_ID; fi
-
|
if [ ! -z $NEW_INSTANCE_ID ]; then
openstack server add floating ip $NEW_INSTANCE_ID $CAMPUS_IP
...
...
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