Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Packer Openstack Hpc Image
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Bo-Chun Chen
Packer Openstack Hpc Image
Commits
447af5f4
Commit
447af5f4
authored
2 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Add gitlab ci
parent
dbfc0d2a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+77
-0
77 additions, 0 deletions
.gitlab-ci.yml
with
77 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
77
−
0
View file @
447af5f4
image
:
name
:
python:3.6
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"
PKR_VAR_floating_ip_network
:
"
uab-campus"
PKR_VAR_security_groups
:
'
["ssh-secgrp"]'
PKR_VAR_skip_create_image
:
"
false"
PKR_VAR_ssh_username
:
"
centos"
PKR_VAR_networks
:
'
["7ac7d980-20bc-4e53-8528-6809e139fdcc"]'
PKR_VAR_build_instance_name
:
"
ood-${CI_COMMIT_SHORT_SHA}"
cache
:
paths
:
-
bin/
-
.cache/pip
-
venv/
-
CRI_XCBC/
stages
:
-
build
setup_environment
:
stage
:
build
tags
:
-
build
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
-
$CI_PROJECT_DIR/bin/packer --version
-
python --version
-
python3 -m venv venv
-
source venv/bin/activate
-
pip install --upgrade pip
-
pip install s3cmd ansible
-
>
if cd CRI_XCBC; then
git checkout uab-prod; git pull;
git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*';
cd ..;
else
git clone https://github.com/uabrc/CRI_XCBC.git;
fi
-
s3cmd get --force --host=$AWS_HOST --host-bucket=$AWS_HOST s3://ood-config/group_vars/all CRI_XCBC/group_vars/all
-
s3cmd get --force -r --host=$AWS_HOST --host-bucket=$AWS_HOST s3://cheaha-cloud-ansible-files/ ansible/files/
validate
:
stage
:
build
needs
:
-
setup_environment
tags
:
-
build
script
:
-
source venv/bin/activate
-
$CI_PROJECT_DIR/bin/packer validate openstack
build_image
:
stage
:
build
needs
:
-
validate
tags
:
-
build
script
:
-
"
sed
-i
's/hosts:.*$/hosts:
default/'
CRI_XCBC/ood-packer.yaml"
-
cat CRI_XCBC/ood-packer.yaml
-
source venv/bin/activate
-
sed -i 's/\(\"--extra-vars\)/\"-vvv\", \1/' openstack/nodeimage.pkr.hcl
-
sed -i 's/inventory_file.*/extra_arguments=[\"-vvv\"]/' openstack/nodeimage.pkr.hcl
-
cat openstack/nodeimage.pkr.hcl
-
$CI_PROJECT_DIR/bin/packer build openstack
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