-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip ci] initial push of new python provision
script
- Loading branch information
Showing
6 changed files
with
141 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM cimg/python:3.10.0 | ||
|
||
# Create app directory | ||
WORKDIR /home/circleci/project | ||
|
||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY requirements.txt provision_workshop.py /home/circleci/project/ | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
CMD [ "python", "scripts/util/provisioning/provision_workshop.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
terraform -chdir=terraform/digital_ocean/tfcloud/ apply --auto-approve -var org_name=test_tf_provision -var [email protected] -var execution_mode=local | ||
|
||
# Detroy TF_Cloud_Org and Workspaces | ||
terraform -chdir=terraform/digital_ocean/tfcloud/ destroy --auto-approve -var org_name=test_tf_provision -var [email protected] -var execution_mode=local | ||
|
||
|
||
# Terraform Backend Config for do_create_k8s | ||
echo -en "organization = \"${TF_CLOUD_ORGANIZATION}\"\nworkspaces{name =\"${TF_CLOUD_WORKSPACE}\"}" > ./terraform/digital_ocean/do_create_k8s/remote_backend_config | ||
|
||
# Initialize terraform with unique org name | ||
terraform -chdir=terraform/digital_ocean/do_create_k8s init \ | ||
-backend-config=remote_backend_config | ||
# Execute apply comand | ||
terraform -chdir=terraform/digital_ocean/do_create_k8s apply -auto-approve \ | ||
-var do_token=$DIGITAL_OCEAN_TOKEN \ | ||
-var cluster_name=$CLUSTER_NAME \ | ||
-var do_k8s_slug_ver=$DO_K8S_SLUG_VER | ||
|
||
|
||
# Terraform Backend Config for do_k8s_deploy_app | ||
echo -en "organization = \"${TF_CLOUD_ORGANIZATION}\"\nworkspaces{name =\"${TF_CLOUD_WORKSPACE}-deploy\"}" > ./terraform/digital_ocean/do_k8s_deploy_app/remote_backend_config | ||
# Initialize terraform with unique org name | ||
terraform -chdir=terraform/digital_ocean/do_k8s_deploy_app init \ | ||
-backend-config=remote_backend_config | ||
# Execute apply comand | ||
terraform -chdir=./terraform/digital_ocean/do_k8s_deploy_app apply -auto-approve \ | ||
-var do_token=$DIGITAL_OCEAN_TOKEN \ | ||
-var cluster_name=$CLUSTER_NAME \ | ||
-var docker_image=$DOCKER_IMAGE | ||
|
||
|
||
# Destroy prov | ||
|
||
terraform -chdir=./terraform/digital_ocean/tfcloud destroy -auto-approve \ | ||
-var org_name=$TF_CLOUD_ORGANIZATION \ | ||
-var org_email=$TF_CLOUD_ORG_EMAIL \ | ||
-var workspace_name=$TF_CLOUD_WORKSPACE | ||
|
||
# Provision container image | ||
cp ../../../requirements.txt . && docker build -t ariv3ra/cicd-ws-provision:latest -t ariv3ra/cicd-ws-provision:v0.0.1 . | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.