Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions .github/workflows/manual.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/pytest.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/python-version.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/techtrends-dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: TechTrends - Package with Docker

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: techtrends:latest
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use a Python base image in version 3.8
FROM python:3.8-alpine

# Set the working directory to /app
WORKDIR /app

# Copy the TechTrends application files to the container
COPY ./techtrends /app

# Expose the application port 3111
EXPOSE 3111

# Install packages defined in the requirements.txt file
RUN pip install --no-cache-dir -r requirements.txt

# Ensure that the database is initialized with the pre-defined posts
RUN python init_db.py

# Set the command to execute the application at container start
CMD ["python", "app.py"]
File renamed without changes.
9 changes: 9 additions & 0 deletions argocd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## ArgoCD Manifests

Place the ArgoCD manifests in this directory.


```
# To retrieve the initial password for ArgoCD, you can use the following command:
sudo k3s kubectl --namespace argocd get secret argocd-initial-admin-secret -o json | jq -r '.data.password' | base64 -d
```
22 changes: 22 additions & 0 deletions argocd/helm-techtrends-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: techtrends-prod
spec:
project: default
source:
repoURL: https://github.com/kydq2022/cloud-native-application-architecture-p1.git
targetRevision: HEAD
path: helm
helm:
valueFiles:
- values-prod.yaml
releaseName: techtrends-prod
chart: techtrends
destination:
server: https://kubernetes.default.svc
namespace: prod
syncPolicy:
automated:
prune: true
selfHeal: true
22 changes: 22 additions & 0 deletions argocd/helm-techtrends-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: techtrends-staging
spec:
project: default
source:
repoURL: https://github.com/kydq2022/cloud-native-application-architecture-p1.git
targetRevision: HEAD
path: helm
helm:
valueFiles:
- values-staging.yaml
releaseName: techtrends-staging
chart: techtrends
destination:
server: https://kubernetes.default.svc
namespace: staging
syncPolicy:
automated:
prune: true
selfHeal: true
13 changes: 13 additions & 0 deletions docker_commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Docker commands used to build the application
sudo docker build -t techtrends .

## Docker commands used to run the application
docker run -p 7111:3111 --name techtrends techtrends

## Docker commands used to get the application logs
docker logs -f techtrends

## Logs from the container running the TechTrends application
023-08-21 04:51:59,887 - INFO - Article "2020 CNCF Annual Report" retrieved!
2023-08-21 04:51:59,888 - INFO - 172.17.0.1 - - [21/Aug/2023 04:51:59] "GET /1 HTTP/1.1" 200 -
2023-08-21 04:51:59,897 - INFO - 172.17.0.1 - - [21/Aug/2023 04:51:59] "GET /static/css/main.css HTTP/1.1" 304 -
23 changes: 0 additions & 23 deletions exercises/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions exercises/Vagrantfile

This file was deleted.

67 changes: 0 additions & 67 deletions exercises/go-helloworld/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions exercises/go-helloworld/main.go

This file was deleted.

7 changes: 0 additions & 7 deletions exercises/manifests/configmap.yaml

This file was deleted.

Loading