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
82be80d6
Commit
82be80d6
authored
2 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Use our own docker image from gitlab registry
parent
63c88f9d
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
+5
-24
5 additions, 24 deletions
.gitlab-ci.yml
with
5 additions
and
24 deletions
.gitlab-ci.yml
+
5
−
24
View file @
82be80d6
image
:
name
:
python:3.6
name
:
docker:20.10.17
variables
:
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
ANSIBLE_REMOTE_TMP
:
"
/tmp"
PKR_VAR_flavor
:
"
m1.small"
PKR_VAR_source_image
:
"
CentOS-7-x86_64-GenericCloud-2009"
...
...
@@ -14,29 +13,12 @@ variables:
GIT_AUTHOR_NAME
:
"
Gitlab
runner"
GIT_AUTHOR_EMAIL
:
"
gitlab@runner"
cache
:
paths
:
-
bin/
-
.cache/pip
-
venv/
before_script
:
-
|
if [ ! -f $CI_PROJECT_DIR/bin/packer ]; then
wget https://releases.hashicorp.com/packer/1.8.3/packer_1.8.3_linux_amd64.zip
unzip packer_1.8.3_linux_amd64.zip -d bin
rm -vf *.zip
fi
-
python3 -m venv venv
-
source venv/bin/activate
-
pip install --upgrade pip
-
pip install s3cmd ansible python-openstackclient
stages
:
-
build
-
deploy
build_image
:
image
:
$CI_REGISTRY_IMAGE:latest
stage
:
build
environment
:
name
:
knightly
...
...
@@ -66,26 +48,25 @@ build_image:
-
s3cmd get --force --host=$AWS_HOST --host-bucket=$AWS_HOST s3://ood-config/group_vars/all CRI_XCBC/group_vars/prod
-
s3cmd get --force -r --host=$AWS_HOST --host-bucket=$AWS_HOST s3://cheaha-cloud-ansible-files/ ansible/files/
-
tail -n 10 CRI_XCBC/group_vars/prod
-
source venv/bin/activate
-
$CI_PROJECT_DIR/bin/packer validate openstack-ood
-
packer validate openstack-ood
-
>
PKR_VAR_build_instance_name="ood-${CRI_XCBC_HEAD}"
PKR_VAR_image_date_suffix=false
PKR_VAR_image_name="ood-${BUILD_DATE}"
$CI_PROJECT_DIR/bin/
packer build -machine-readable openstack-ood | tee ood_build.log
packer build -machine-readable openstack-ood | tee ood_build.log
-
echo BUILT_OOD_IMAGE_ID=$(grep 'Image:' ood_build.log | awk '{print $4}') | tee image.env
artifacts
:
reports
:
dotenv
:
image.env
deploy_knightly
:
image
:
$CI_REGISTRY_IMAGE:latest
stage
:
deploy
environment
:
name
:
knightly
tags
:
-
build
script
:
-
source venv/bin/activate
-
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
-
|
...
...
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