Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenTofu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
components
OpenTofu
Commits
dd6defda
Commit
dd6defda
authored
1 week ago
by
Alex Maras
Browse files
Options
Downloads
Patches
Plain Diff
test: ensure artifacts are uploaded by plan
parent
d57617ac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/integration-tests/ExtraArtifactsAreIncluded.gitlab-ci.yml
+42
-0
42 additions, 0 deletions
...integration-tests/ExtraArtifactsAreIncluded.gitlab-ci.yml
tests/integration.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
tests/integration.gitlab-ci.yml
with
43 additions
and
0 deletions
tests/integration-tests/ExtraArtifactsAreIncluded.gitlab-ci.yml
0 → 100644
+
42
−
0
View file @
dd6defda
variables
:
ARTIFACT_FILE_NAME
:
integration_test_file_artifact
include
:
-
component
:
$CI_SERVER_FQDN/$CI_PROJECT_PATH/plan@$CI_COMMIT_SHA
inputs
:
image_registry_base
:
$GITLAB_OPENTOFU_IMAGE_BASE
version
:
$CI_COMMIT_SHA
base_os
:
$GITLAB_OPENTOFU_BASE_IMAGE_OS
opentofu_version
:
$OPENTOFU_VERSION
root_dir
:
$TEST_GITLAB_TOFU_ROOT_DIR
state_name
:
$TEST_GITLAB_TOFU_STATE_NAME
warning_on_non_empty_plan
:
true
plan_artifacts
:
-
$ARTIFACT_FILE_NAME
# For CI Terraform state cleanup
-
component
:
$CI_SERVER_FQDN/$CI_PROJECT_PATH/delete-state@$CI_COMMIT_SHA
inputs
:
state_name
:
$TEST_GITLAB_TOFU_STATE_NAME
rules
:
[{
when
:
always
}]
stages
:
[
build
,
cleanup
,
verify
]
plan
:
before_script
:
-
touch "$ARTIFACT_FILE_NAME"
verify:plan-job:uploaded-extra-artifact
:
stage
:
verify
needs
:
[
'
plan'
]
rules
:
[{
when
:
always
}]
image
:
alpine:latest
script
:
-
|
if [ -f "$ARTIFACT_FILE_NAME" ]; then
echo 'Success: the extra artifact was uploaded by the plan job.'
exit 0
else
echo 'Error: the extra artifact was not uploaded by the plan job.'
exit 0
fi
This diff is collapsed.
Click to expand it.
tests/integration.gitlab-ci.yml
+
1
−
0
View file @
dd6defda
...
...
@@ -136,6 +136,7 @@ plan-job-template:
matrix
:
-
PIPELINE_NAME
:
-
WarningOnNonEmptyPlan
-
ExtraArtifactsAreIncluded
GITLAB_OPENTOFU_BASE_IMAGE_OS
:
-
alpine
-
debian
...
...
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