Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
terraform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
702
HADOOP
terraform
Compare revisions
b22e7745f64fe69e010f0e002e39e4c05891c308 to af25fa72e4874e3a4ae46d3955cd05e28c93018a
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
702/HADOOP/terraform
Select target project
No results found
af25fa72e4874e3a4ae46d3955cd05e28c93018a
Select Git revision
Branches
bio3
ci-bullseye
feature/certificates2
master
wip/bigtop-3.0.0
5 results
Swap
Target
702/HADOOP/terraform
Select target project
702/HADOOP/terraform
1 result
b22e7745f64fe69e010f0e002e39e4c05891c308
Select Git revision
Branches
bio3
ci-bullseye
feature/certificates2
master
wip/bigtop-3.0.0
5 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
gitLab CI: cache the latest floating IP to improve robustness
· e75d86ff
František Dvořák
authored
2 years ago
e75d86ff
gitLab CI: shell check
· af25fa72
František Dvořák
authored
2 years ago
af25fa72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+18
-13
18 additions, 13 deletions
.gitlab-ci.yml
with
18 additions
and
13 deletions
.gitlab-ci.yml
View file @
af25fa72
...
...
@@ -36,28 +36,31 @@ test-single:
-
sudo apt-get update
-
sudo apt-get install -y --no-install-recommends git
-
rm -fv clouds.yaml testsuite.auto.tfvars gitlab.tf
-
ln -sfv $CLOUDS_YAML clouds.yaml
-
ln -sfv $TERRAFORM_CONFIG testsuite.auto.tfvars
-
ln -sfv
"
$CLOUDS_YAML
"
clouds.yaml
-
ln -sfv
"
$TERRAFORM_CONFIG
"
testsuite.auto.tfvars
# GitLab remote terraform state
-
printf 'terraform {\n backend "http" {\n }\n}\n' > gitlab.tf
# https://github.com/terraform-provider-openstack/terraform-provider-openstack/issues/1160
-
touch ./secure.yml
# better to init terraform before allocating public floating IP address (the state could be locked)
-
terraform init -input=false
-
ip=`openstack floating ip create -c floating_ip_address -f value public-muni-147-251-21-GROUP`
-
if test -f ip.txt; then ip=$(cat ip.txt); openstack floating ip show "$ip" >/dev/null || ip=''; fi
-
if test -z "$ip"; then ip=$(openstack floating ip create -c floating_ip_address -f value public-muni-147-251-21-GROUP); echo "$ip" > ip.txt; fi
cache
:
when
:
always
key
:
single
paths
:
-
"
.terraform/"
-
"
ip.txt"
script
:
-
args=
"
-auto-approve -var type=hadoop-single -var flavor=standard.large -var n=0 -var domain=terra1 -var image_name=$IMAGE_NAME -var image_visibility=$IMAGE_VISIBILITY -var floating_ip=$ip"
-
terraform apply
$
args
-
args=
(
-auto-approve -var type=hadoop-single -var flavor=standard.large -var n=0 -var domain=terra1 -var
"
image_name=$IMAGE_NAME
"
-var
"
image_visibility=$IMAGE_VISIBILITY
"
-var
"
floating_ip=$ip"
)
-
terraform apply
"${
args
[@]}"
-
eval $(ssh-agent -s)
-
ssh-add ./ssh-key.terra1.txt
-
ssh -o PreferredAuthentications=publickey deployadm@$ip "sudo -u debian sh -c 'cd; ~deployadm/terraform/image/tests/run-tests.sh'"
-
terraform destroy $args
-
openstack floating ip delete $ip
-
ssh -o PreferredAuthentications=publickey "deployadm@$ip" "sudo -u debian sh -c 'cd; ~deployadm/terraform/image/tests/run-tests.sh'"
-
terraform destroy "${args[@]}"
-
openstack floating ip delete "$ip"
-
rm -fv ip.txt
rules
:
-
if
:
'
$JOB
=~
/all|test-single/'
artifacts
:
&artifacts
...
...
@@ -73,14 +76,16 @@ test-cluster:
key
:
cluster
paths
:
-
"
.terraform/"
-
"
ip.txt"
script
:
-
args=
"
-auto-approve -var type=hadoop -var domain=terra2 -var image_name=$IMAGE_NAME -var image_visibility=$IMAGE_VISIBILITY -var floating_ip=$ip"
-
terraform apply
$
args
-
args=
(
-auto-approve -var type=hadoop -var domain=terra2 -var
"
image_name=$IMAGE_NAME
"
-var
"
image_visibility=$IMAGE_VISIBILITY
"
-var
"
floating_ip=$ip"
)
-
terraform apply
"${
args
[@]}"
-
eval $(ssh-agent -s)
-
ssh-add ./ssh-key.terra2.txt
-
ssh -o PreferredAuthentications=publickey deployadm@$ip "sudo -u debian sh -c 'cd; ~deployadm/terraform/image/tests/run-tests.sh'"
-
terraform destroy $args
-
openstack floating ip delete $ip
-
ssh -o PreferredAuthentications=publickey "deployadm@$ip" "sudo -u debian sh -c 'cd; ~deployadm/terraform/image/tests/run-tests.sh'"
-
terraform destroy "${args[@]}"
-
openstack floating ip delete "$ip"
-
rm -fv ip.txt
rules
:
-
if
:
'
$JOB
=~
/all|test-cluster/'
artifacts
:
*artifacts
...
...
This diff is collapsed.
Click to expand it.