This project has the intention to demonstrate the basics of a CI/CD pipeline by provisioning a compute instance with Git server (Gitea) and Jenkins in Akamai Connected Cloud with pre-installed tools:
Terraform 1.5.7
Akamai CLI 1.5.5
Akamai Poweshell 7.3.8
Docker 24.x
NodeJS 20.x
NPM 10.x
Python 3.x
Gitea 1.9
JQ 1.7
Jenkins LTS
It also provisions the StackScript that contains the recipe to set up everything using the Akamai Connected Cloud UI.
Terraform 1.5.7
Docker 24.x
NodeJS 20.x
NPM 10.x
Any Linux Distribution
orWindows 10 or later
orMacOS Catalina or later
Define the environment variables below in your local machine:
EDGEGRID_ACCOUNT_KEY
: Akamai Account Key to be used in APIs/CLI or Terraform calls.EDGEGRID_HOST
: Hostname used to authenticate the APIs/CLI/Terraform calls, using the Akamai EdgeGrid.EDGEGRID_ACCESS_TOKEN
: Access Token used to authenticate the APIs/CLI/Terraform calls, using the Akamai EdgeGrid.EDGEGRID_CLIENT_TOKEN
: Client Token used to authenticate the APIs/CLI/Terraform calls, using the Akamai EdgeGrid.EDGEGRID_CLIENT_SECRET
: Client Secret used to authenticate the APIs/CLI/Terraform calls, using the Akamai EdgeGrid.ACC_TOKEN
: Token used to authenticate the APIs/CLI/Terraform calls in the Akamai Connected Cloud.
or define the credentials in the iac/.credentials
filename. Please follow the template iac/.credentials.template
.
Just execute the commands below:
start.sh
: Starts the stack.stop.sh
: Stops the stack.reload.sh
: Reloads the stack.
You'll need to create an API Token in Akamai Connected Cloud. Please follow this path: Click in your
Profile Icon -> API Tokens -> Create a Personal Access Token
. You need to select Read-Write
permission for the
following:
- Linodes (Compute instances)
- StackScripts (Recipes to automate provisioning/install/setup)
- Object Storage (Used to store static files and the provisioning states).
Then click in the Create Token
button. A dialog with the token will popup. Please note the token value before you
close the popup. You won't be able to get the token after.
After that, just execute the command deploy.sh
in your project directory. Follow the instructions in the console of
your instance. If you want to customize the specifications of your provisioning/setup, please edit
iac/modules/provisioning
and/oriac/modules/setup
.
To undeploy, just execute the command undeploy.sh
in your project directory.
To customize the container images, just edit the following files:
iac/.env
: It contains the container registry information and the build version.iac/docker-compose.yml
: It contains the definition of the container images (platform, ports, volumes, environments, etc.).iac/gitea.dockerfile
: It contains the definition to build Gitea.iac/jenkins.dockerfile
: It contains the definition to build Jenkins.
After that, execute the following commands:
build.sh
: To build the container images.publish.sh
: To publish the container images in the container registry.
Follow the documentation below to know more about Akamai:
- How to create Akamai EdgeGrid credentials
- How to create Akamai Connected Cloud credentials
- Akamai Techdocs
- Akamai Connected Cloud Documentation
- DON'T EXPOSE OR COMMIT ANY SENSITIVE DATA, SUCH AS CREDENTIALS, IN THE PROJECT.
LinkedIn:
e-Mail:
and that's all! Have fun!