Skip to content

Commit

Permalink
Merge pull request #1 from jason-chong/init_v2
Browse files Browse the repository at this point in the history
Init v2
  • Loading branch information
jason-chong authored Mar 1, 2023
2 parents 3b42259 + 4a12b3f commit bb91c9d
Show file tree
Hide file tree
Showing 325 changed files with 18,362 additions and 1,582 deletions.
58 changes: 25 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*
*.zip*
*.tfvars

# Local .terraform lock files
*.lock.*

# General
*.exe
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon
*.log
*.bak
*.backup
*~
.*.swp

bin/
modules-dev/
pkg/
vendor/
__pycache__/

# Thumbnails
._*
.idea
.vscode

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.env
./*.tfstate
.terraform
terraform.tfplan
terraform.tfstate
terraform.tfvars
.terraform.tfstate.lock.info

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.tfcache
**/.terraform.lock.hcl
**/tf_resources.json
**/var.tfvars
86 changes: 86 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages

stages: # List of stages for jobs, and their order of execution
- test-unit
- TF-Plan-e2e
- TF-Apply-e2e
- TF-Destroy-e2e


.testing_pipeline:
before_script:
- export http_proxy=http://www-proxy-hqdc.us.oracle.com:80
- export https_proxy=$http_proxy
- curl https://releases.hashicorp.com/terraform/1.2.2/terraform_1.2.2_linux_amd64.zip > terraform.zip
- unzip terraform.zip -d /bin
- terraform --version
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-add -l
- pip install -r test/requirements.txt
image: lab-runner
tags: [LZ]

unit-test-job: # This job runs in the test stage.
extends: .testing_pipeline
stage: test-unit
script:
- pytest -m unit --junit-xml=pytest.xml test
# # Orahub's artifact upload seems broken. Possibly a config issue...
# artifacts:
# when: always
# paths:
# - pytest.xml
# reports:
# junit: pytest.xml
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"

e2e-full-plan-job: # This job runs terraform plan.
extends: .testing_pipeline
stage: TF-Plan-e2e
when: on_success
script:
- cd templates/enterprise-landing-zone
- ./BackEnd.sh
- cat backend.tf
- terraform init -backend-config="address=$REMOTE_STATE_BACKEND" -backend-config="update_method=PUT"
- terraform validate
- terraform plan -var-file=$ENV_TFVARS_FILE_NAME
rules:
- if: ($CI_COMMIT_BRANCH == "LANZ-Integration")

e2e-full-deploy-job: # This job runs terraform apply.
extends: .testing_pipeline
stage: TF-Apply-e2e
when: on_success
script:
- cd templates/enterprise-landing-zone
- ./BackEnd.sh
- cat backend.tf
- terraform init -backend-config="address=$REMOTE_STATE_BACKEND" -backend-config="update_method=PUT"
- terraform validate
- terraform apply -var-file=$ENV_TFVARS_FILE_NAME -auto-approve #neeed to look at pasing a plan file but have to understan gitlab artifiacts issue
rules:
- if: ($CI_COMMIT_BRANCH == "LANZ-Integration")
retry: 1

e2e-full-destroy-job: # This job runs terraform destroy.
extends: .testing_pipeline
stage: TF-Destroy-e2e
when: manual
allow_failure: true
script:
- cd templates/enterprise-landing-zone
- ./BackEnd.sh
- cat backend.tf
- terraform init -backend-config="address=$REMOTE_STATE_BACKEND" -backend-config="update_method=PUT"
- terraform validate
- terraform destroy -var-file=$ENV_TFVARS_FILE_NAME -auto-approve #neeed to look at pasing a plan file but have to understand gitlab artifiacts issue
rules:
- if: ($CI_COMMIT_BRANCH == "LANZ-Integration")
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing to the project

Oracle welcomes contributions to this repository from anyone.

If you want to submit a pull request to fix a bug or enhance an existing
feature, please first open an issue and link to that issue when you
submit your pull request.

If you have any questions about a possible submission, feel free to open
an issue too.

## Pull request process

1. Fork this repository
1. Create a branch in your fork to implement the changes. We recommend using
the issue number as part of your branch name, e.g. `1234-fixes`
1. Ensure that there is at least one test that would fail without the fix and
passes post fix
1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
what your changes are meant to do and provide simple steps on how to validate
your changes, ideally referencing the test. Ensure that you reference the issue
you created as well. We will assign the pull request to 1-2 people for review
before it is submitted internally and the PR is closed.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018-2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2022 Oracle and/or its affiliates.

The Universal Permissive License (UPL), Version 1.0

Expand Down
Loading

0 comments on commit bb91c9d

Please sign in to comment.