https://github.com/aswinbennyofficial/circleci-playground
Repository for hands-on exploration and experimentation with CircleCI. Learn Continuous Integration (CI) workflows, test automation, and deployment strategies in a sandbox environment
https://github.com/aswinbennyofficial/circleci-playground
Last synced: 2 months ago
JSON representation
Repository for hands-on exploration and experimentation with CircleCI. Learn Continuous Integration (CI) workflows, test automation, and deployment strategies in a sandbox environment
- Host: GitHub
- URL: https://github.com/aswinbennyofficial/circleci-playground
- Owner: aswinbennyofficial
- License: mit
- Created: 2024-03-18T11:41:06.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-24T17:55:41.000Z (about 1 year ago)
- Last Synced: 2025-01-19T09:43:25.710Z (4 months ago)
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# circleci-playground
Repository for hands-on exploration and experimentation with CircleCI. Learn Continuous Integration (CI) workflows, test automation, and deployment strategies in a sandbox environmentThe project is a simple application That responds `Hello World, The secret env is $SECRET_KEY` on hitting / endpoint on 8080. Where `SECRET_KEY` is an environment variable.
The circleci config will:
- Run tests
- Build the image
- Push to dockerHub## CircleCi config
```yaml
version: 2.1jobs:
build:
docker:
- image: cimg/go:1.21.8 # Using a CircleCI maintained Go imageworking_directory: ~/circleci-playground # Set the working directory
steps:
- checkout # checks out the source code of the project into the working directory# Run Go tests
- run:
name: Run Go tests
command: go test -cover ./...# Use setup_remote_docker to set up a remote Docker environment
- setup_remote_docker# Build Docker image (Make sure Dockerfile is in the root folder of the project)
- run:
name: Build Docker image
command: docker build -t breeze5690/hello-world:latest .# Login to Docker Hub using environment variables
- run:
name: Login to Docker Hub
command: docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD# Push Docker image to Docker Hub
- run:
name: Push Docker image to Docker Hub
command: docker push breeze5690/hello-world:latestworkflows:
version: 2
build:
jobs:
- build```