Commit b3b4573d authored by test_user's avatar test_user

AAE-941 - add env_variable file

parent 0e63bfe7
Pipeline #25867 failed with stages
in 42 seconds
......@@ -9,9 +9,6 @@ before_script:
- chmod +x ./kubectl
- mv ./kubectl /usr/local/bin/kubectl
- apt install docker.io
- systemctl start docker
- systemctl enable docker
- docker --version
- rm -rf .terraform
- terraform --version
- mkdir -p ./creds
......@@ -27,9 +24,6 @@ before_script:
- source ./env_variable.sh
- echo "this is the value of tfvar for licences" $TF_VAR_aae_license
- cat ~/.aws/credentials
- chmod +x ./createEnv.sh
- terraform init
- kubectl version
- ls
- echo yes | terraform apply -target=rancher2_cluster.aae-cluster
......@@ -40,14 +34,18 @@ stages:
validate:
stage: validate
services:
- docker:stable-dind
image: docker:stable-dind
script:
- echo "text from outside" $rancher2_url
- terraform plan
- chmod +x ./createEnv.sh
- ./createEnv.sh
plan:
stage: plan
script:
- ls
- ls
- terraform plan -out "planfile"
dependencies:
- validate
......
export KUBECONFIG=$PWD/.terraform/kubeconfig
kubectl cluster-info
helm del --purge nginx-ingress
helm del --purge docker-registry
terraform destroy --force
......@@ -68,36 +68,15 @@ echo [default] >> ~/.aws/credentials
eval echo aws_access_key_id=${TF_AWS_ACCESS_KEY_ID} >> ~/.aws/credentials
eval echo aws_secret_access_key=${TF_AWS_SECRET_ACCESS_KEY} >> ~/.aws/credentials
terraform init
echo "before" ${TF_VAR_rancher2_url}
echo "before" ${TF_VAR_rancher2_access_key}
echo "before" ${TF_VAR_rancher2_secret_key}
echo yes | terraform apply -target=rancher2_cluster.aae-cluster
echo "after" ${TF_VAR_rancher2_url}
echo "after" ${TF_VAR_rancher2_access_key}
echo "after" ${TF_VAR_rancher2_secret_key}
export KUBECONFIG=$PWD/.terraform/kubeconfig
echo "$(terraform output kube_config)" > $KUBECONFIG
kubectl cluster-info
export NAMESPACE=kube-system
export SERVICEACCOUNT=alfresco-deployment-service
kubectl create serviceaccount -n kube-system ${SERVICEACCOUNT}
kubectl create clusterrolebinding ${SERVICEACCOUNT}-admin-binding --clusterrole cluster-admin --serviceaccount=${NAMESPACE}:${SERVICEACCOUNT}
echo "kubernetes_token = \"$(kubectl -n ${NAMESPACE} get secret $(kubectl -n ${NAMESPACE} get serviceaccount ${SERVICEACCOUNT} -o jsonpath='{.secrets[0].name}') -o jsonpath='{.data.token}' | base64 --decode)\"" >> terraform.tfvars
echo "my_ip_address = \"$(curl https://ipecho.net/plain)/32\"" >> terraform.tfvars
echo yes | terraform apply
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment