Skip to content

Commit

Permalink
Update version to 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroc0d3 committed Aug 24, 2022
1 parent 3c483ce commit 8e918bd
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 31 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
## Changelog GO App

### version 2.2

- Add multiple container registry (DockerHub & ECR) deployment
- Update Golang version 1.18 for Alpine 3.15 & Alpine 3.16 container
- Refactoring makefile for added multiple container registry
- Add documentation for build, tag & push container image to **DockerHub**, go to [this](docs/Container-Image-DockerHub.md) link
- Add documentation for build, tag & push container to **Amazon ECR (Elastic Container Registry)**, go to [this](docs/Container-Image-ECR.md) link

### version 2.1

- Add Configuration Pipeline Synchronize for Mirroring Repository into AWS CodeCommit
- [GitHub Repository](.github/workflows/synchronize.yml)
- [GitLab Repository](.gitlab-ci.yml)
Expand All @@ -14,6 +23,7 @@
![Azure DevSecOps Pipeline](docs/assets/gitops-devsecops-azure.png)

### version 2.0

- IAM Role sample for CodeBuild & CodePipeline
- Buildspec CodePipeline for Build Container Image inside CodeBuild using Spesific CodeCommit
- Buildspec CodePipeline for Deploy EKS Cluster inside CodeBuild using Spesific CodeCommit
Expand All @@ -24,6 +34,7 @@
- Dynamic Tags with COMMIT_HASH

### version 1.0

- Golang API Rest (bookstore)
- Postman Collection
- Container Builder GO
Expand All @@ -32,6 +43,7 @@
- Buildspec for AWS CodeBuild & AWS CodePipeline

### version 0.1

- First deployment GO Apps
- Script build image
- Script ecr-tag & ecr-push
Expand Down
73 changes: 46 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ IMAGE = $(CI_REGISTRY)/${CI_PROJECT_PATH}/${CI_PROJECT_NAME}
DIR = $(shell pwd)
VERSION ?= 1.5.0

BASE_IMAGE = alpine
BASE_VERSION = 3.16
export BASE_IMAGE=alpine
export BASE_VERSION=3.16
export ALPINE_VERSION=3.16

GO_APP ?= bookstore
SOURCES = $(shell find . -name '*.go' | grep -v /vendor/)
Expand Down Expand Up @@ -79,41 +80,59 @@ git-clone:
@echo " Task : Clone Repository Sources "
@echo " Date/Time : `date`"
@echo "================================================="
@./git-clone.sh $(SOURCE) $(TARGET)
@sh ./git-clone.sh $(SOURCE) $(TARGET)
@echo '- DONE -'

# ========================== #
# BUILD CONTAINER GO-APP #
# ========================== #
.PHONY: dockerhub-build-alpine ecr-build-alpine
dockerhub-build-alpine:
@echo "========================================================"
@echo " Task : Create Container GO-APP Alpine Image "
@echo " Date/Time : `date`"
@echo "========================================================"
@sh ./dockerhub-build.sh alpine Dockerfile ${ALPINE_VERSION}

ecr-build-alpine:
@echo "========================================================"
@echo " Task : Create Container GO-APP Alpine Image "
@echo " Date/Time : `date`"
@echo "========================================================"
@sh ./ecr-build.sh $(ARGS) alpine Dockerfile ${ALPINE_VERSION}

# ========================= #
# BUILD CONTAINER CI/CD #
# TAGS CONTAINER GO-APP #
# ========================= #
.PHONY: ecr-build-alpine
ecr-build-alpine:
@echo "================================================="
@echo " Task : Create Container CI/CD Alpine Image "
.PHONY: tag-dockerhub-alpine tag-ecr-alpine
dockerhub-tag-alpine:
@echo "========================================================"
@echo " Task : Set Tags Image Alpine to DockerHub"
@echo " Date/Time : `date`"
@echo "================================================="
@cd ${PATH_DOCKER} && ./ecr-build-alpine.sh $(ARGS) $(CI_PATH)
@echo '- DONE -'
@echo "========================================================"
@sh ./dockerhub-tag.sh alpine ${ALPINE_VERSION}

# ======================== #
# TAGS CONTAINER CI/CD #
# ======================== #
.PHONY: ecr-tag-alpine
ecr-tag-alpine:
@echo "================================================="
@echo "========================================================"
@echo " Task : Set Tags Image Alpine to ECR"
@echo " Date/Time : `date`"
@echo "================================================="
@cd ${PATH_DOCKER} && ./ecr-tag-alpine.sh $(ARGS) $(CI_PATH)
@echo '- DONE -'
@echo "========================================================"
@sh ./ecr-tag.sh $(ARGS) alpine ${ALPINE_VERSION} $(CI_PATH)

# ========================= #
# PUSH CONTAINER GO-APP #
# ========================= #
.PHONY: dockerhub-push-alpine ecr-push-alpine
dockerhub-push-alpine:
@echo "========================================================"
@echo " Task : Push Image Alpine to DockerHub"
@echo " Date/Time : `date`"
@echo "========================================================"
@sh ./dockerhub-push.sh alpine $(CI_PATH)

# ======================== #
# PUSH CONTAINER CI/CD #
# ======================== #
.PHONY: ecr-push-alpine
ecr-push-alpine:
@echo "================================================="
@echo "========================================================"
@echo " Task : Push Image Alpine to ECR"
@echo " Date/Time : `date`"
@echo "================================================="
@cd ${PATH_DOCKER} && ./ecr-push-alpine.sh $(ARGS) $(TAGS)
@echo '- DONE -'
@echo "========================================================"
@sh ./ecr-push.sh $(ARGS) alpine $(CI_PATH)
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ Kubernetes Deployment for Simple Golang API
![all contributors](https://img.shields.io/github/contributors/devopscorner/golang-deployment)
![tags](https://img.shields.io/github/v/tag/devopscorner/golang-deployment?sort=semver)
[![docker pulls](https://img.shields.io/docker/pulls/devopscorner/bookstore.svg)](https://hub.docker.com/r/devopscorner/bookstore/)
[![docker image size](https://img.shields.io/docker/image-size/devopscorner/bookstore.svg?sort=date)](https://hub.docker.com/r/devopscorner/bookstore/)
![download all](https://img.shields.io/github/downloads/devopscorner/golang-deployment/total.svg)
![download latest](https://img.shields.io/github/downloads/devopscorner/golang-deployment/2.1/total)
![download latest](https://img.shields.io/github/downloads/devopscorner/golang-deployment/2.2/total)
![view](https://views.whatilearened.today/views/github/devopscorner/golang-deployment.svg)
![clone](https://img.shields.io/badge/dynamic/json?color=success&label=clone&query=count&url=https://github.com/devopscorner/golang-deployment/blob/master/clone.json?raw=True&logo=github)
![issues](https://img.shields.io/github/issues/devopscorner/golang-deployment)
Expand All @@ -17,9 +16,24 @@ Kubernetes Deployment for Simple Golang API
![stars](https://img.shields.io/github/stars/devopscorner/golang-deployment)
[![license](https://img.shields.io/github/license/devopscorner/golang-deployment)](https://img.shields.io/github/license/devopscorner/golang-deployment)

## Workflow
## Available Tags

- Documentation workflow (reproduce step) of this ci/cd pipeline, go to [this](WORKFLOW.md) link
### Alpine

| Image name | Size |
|------------|------|
| `devopscorner/bookstore:latest` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/bookstore/latest.svg?label=Image%20size&logo=docker)](https://hub.docker.com/repository/docker/devopscorner/bookstore/tags?page=1&ordering=last_updated&name=latest) |
| `devopscorner/bookstore:alpine` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/bookstore/alpine.svg?label=Image%20size&logo=docker)](https://hub.docker.com/repository/docker/devopscorner/bookstore/tags?page=1&ordering=last_updated&name=alpine) |
| `devopscorner/bookstore:alpine-latest` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/bookstore/alpine-latest.svg?label=Image%20size&logo=docker)](https://hub.docker.com/repository/docker/devopscorner/bookstore/tags?page=1&ordering=last_updated&name=alpine-latest) |
| `devopscorner/bookstore:alpine-3.15` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/bookstore/alpine-3.15.svg?label=Image%20size&logo=docker)](https://hub.docker.com/repository/docker/devopscorner/bookstore/tags?page=1&ordering=last_updated&name=alpine-3.15) |
| `devopscorner/bookstore:go1.18-alpine3.15` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/bookstore/go1.18-alpine3.15.svg?label=Image%20size&logo=docker)](https://hub.docker.com/repository/docker/devopscorner/bookstore/tags?page=1&ordering=last_updated&name=go1.18-alpine3.15) |
| `devopscorner/bookstore:alpine-3.16` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/bookstore/alpine-3.15.svg?label=Image%20size&logo=docker)](https://hub.docker.com/repository/docker/devopscorner/bookstore/tags?page=1&ordering=last_updated&name=alpine-3.16) |
| `devopscorner/bookstore:go1.18-alpine3.16` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/bookstore/go1.18-alpine3.16.svg?label=Image%20size&logo=docker)](https://hub.docker.com/repository/docker/devopscorner/bookstore/tags?page=1&ordering=last_updated&name=go1.18-alpine3.16) |

## Documentation

- Build, Tag & Push container image to **DockerHub**, go to [this](docs/Container-Image-DockerHub.md) link
- Build, Tag & Push container image to **Amazon ECR (Elastic Container Registry)**, go to [this](docs/Container-Image-ECR.md) link

## Development

Expand Down

0 comments on commit 8e918bd

Please sign in to comment.