diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 10a5fd2..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- master - -pool: - vmImage: ubuntu-latest - -steps: - -- script: | - sudo apt update - sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev - wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz - tar -xf Python-3.11.9.tgz - cd Python-3.11.9 - ./configure --enable-optimizations - sudo make altinstall - python3.11 -m venv oracle-cli - source oracle-cli/bin/activate - wget https://github.com/oracle/oci-cli/releases/download/v3.40.0/oci-cli-3.40.0.zip - unzip oci-cli-3.40.0.zip - cd oci-cli - pip install oci_cli-*-py2.py3-none-any.whl - - ##sudo bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" - - mkdir /home/vsts/.oci - echo '[DEFAULT]' >> /home/vsts/.oci/config - echo 'user=ocid1.user.oc1..aaaaaaaa5qt6x2bhe3pqawphnt75xtdpmntisfgxeizqsol4f3kxmlcmphda' >> /home/vsts/.oci/config - echo 'fingerprint=34:36:4e:62:0c:c3:1f:80:5b:b0:18:80:d5:e9:73:1c' >> /home/vsts/.oci/config - echo 'key_file=/home/vsts/.oci/oci_api_key.pem' >> /home/vsts/.oci/config - echo 'tenancy=ocid1.tenancy.oc1..aaaaaaaarmf64ufoolro2kzrupzyazqycjapqsyacn7rju64jyw4zbyb6j6q' >> /home/vsts/.oci/config - echo 'region=us-ashburn-1' >> /home/vsts/.oci/config - - cd /home/vsts/.oci/ - wget -O oci_api_key.pem https://www.dropbox.com/scl/fi/3yjruq1imww3nkzvgby4v/oci_api_key.pem - - sudo chmod 600 /home/vsts/.oci/oci_api_key.pem - oci resource-manager job create-destroy-job --execution-plan-strategy AUTO_APPROVED --stack-id ocid1.ormstack.oc1.iad.amaaaaaaihuwreyaoaanscej56cowg2smdsrt5esdpz4uq7otrbyenyrnz7a - - displayName: 'Destroying Terraform Resource Manager Stack' \ No newline at end of file diff --git a/files/azure-pipelines.yml b/files/azure-pipelines.yml new file mode 100644 index 0000000..0a79b73 --- /dev/null +++ b/files/azure-pipelines.yml @@ -0,0 +1,59 @@ +pool: + vmImage: 'ubuntu-latest' + +variables: + buildConfiguration: 'Release' + imageName: 'oraclequote_azure:latest' + +steps: + - script: | + pwd + docker build --no-cache -f Dockerfile -t $(ocir)/$(tenancy)/$(repo)/$(imageName) . + displayName: 'Building Docker Image' + + - script: | + docker login https://$(ocir) -u $(dockerUser) -p "$(dockerPassword)" + docker push $(ocir)/$(tenancy)/$(repo)/$(imageName) + displayName: 'Sending Image to OCIR' + + - script: | + pip install oci-cli + displayName: 'OCI CLI Installing' + + - script: | + mkdir /home/vsts/.kube + + mkdir /home/vsts/.oci + cd /home/vsts/.oci + # Obtain your OCI User Private Key + # wget -O oci_api_key.pem https://----your_bucket_url-----/oci_api_key.pem + wget -O oci_api_key.pem https://----your_bucket_url-----/oci_api_key.pem + sudo chmod 600 /home/vsts/.oci/oci_api_key.pem + + echo '[DEFAULT]' > /home/vsts/.oci/config + echo 'user=ocid1.user.oc1..aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' >> /home/vsts/.oci/config + echo 'fingerprint=a0:6c:fe:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx' >> /home/vsts/.oci/config + echo 'key_file=/home/vsts/.oci/oci_api_key.pem' >> /home/vsts/.oci/config + echo 'tenancy=ocid1.tenancy.oc1..aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' >> /home/vsts/.oci/config + echo 'region=us-ashburn-1' >> /home/vsts/.oci/config + chmod 600 /home/vsts/.oci/config + displayName: 'OCI CLI Configuration' + + - script: | + oci resource-manager job create-apply-job --execution-plan-strategy AUTO_APPROVED --stack-id ocid1.ormstack.oc1.iad.amaaaaaaamaaaaaaamaaaaaaamaaaaaaamaaaaaaamaaaaaaamaaaaaaamaaaaaa + displayName: 'Weblogic Terraform Resource Manager' + + - script: | + oci ce cluster create-kubeconfig --cluster-id ocid1.cluster.oc1.iad.aaaaaaaaamaaaaaaamaaaaaaamaaaaaaamaaaaaaamaaaaaaamaaaaaaamaaaaaa --file /home/vsts/.kube/config --region us-ashburn-1 --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT + + export KUBECONFIG=/home/vsts/.kube/config + + cd /home/vsts/work/1/s + kubectl config view + kubectl get nodes + kubectl replace -f kubernetes.yaml --force + sleep 120 + kubectl get services callpdfreport-service + kubectl get pods + kubectl describe pods + displayName: 'Deploying to OKE' \ No newline at end of file