This project will show how to setup a Gitlab CICD pipeline, which will build the source code to a docker image and push it to the container registory in Gitlab and then re-deploy the docker container with the latest image in your local host.
Understand how to setup/configure Gitlab as CICD pipeline. Familarize with gitlab pipeline.
- Ubuntu 20.04 OS (Minimum 2 core CPU/8GB RAM/30GB Disk)
- Docker
- Docker Compose
You can refer to here for the detail steps to setup your bastion VM in your Oracle Cloud account.
SSH to the bastion VM and run below commands:
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform
# Once it is done, you should be able to see the terraform version installed in your bastion host
terraform -v
Refer to https://www.terraform.io/downloads
mkdir $HOME/.oci
openssl genrsa -out $HOME/.oci/terraform_private.pem 2048
chmod 600 $HOME/.oci/terraform_private.pem
openssl rsa -pubout -in $HOME/.oci/terraform_private.pem -out $HOME/.oci/terraform_public.pem
$HOME/.oci/terraform_public.pem
- From your user avatar, go to User Settings (My Profile).
- Click API Keys.
- Click Add API Key.
- Select Paste Public Keys.
- Paste value from previous step, including the lines with BEGIN PUBLIC KEY and END PUBLIC KEY
- Click Add and you will get a configuration setting
- Paste the contents of the text box into your ~/.oci/config file and make sure to replace with actual path to your private keyfile generated in previous step. You have now set up the RSA keys to connect to your Oracle Cloud Infrastructure account.