Skip to content

Commit b53041a

Browse files
authored
Merge pull request #58 from khanh-ph/release/3.0.0
Release version 3.0.0
2 parents 0902a89 + 4865659 commit b53041a

32 files changed

+916
-852
lines changed

.github/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ changelog:
1010
- breaking-change
1111
- title: New Features
1212
labels:
13-
- enhancement
1413
- feature
1514
- title: Bug Fixes
1615
labels:

.github/workflows/add-pr-label.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ jobs:
2727
if: ${{ startsWith(github.head_ref, 'bugfix/') }}
2828
with:
2929
labels: bugfix
30-
31-
- name: Add `breaking-change` label
32-
uses: actions-ecosystem/action-add-labels@v1
33-
if: ${{ startsWith(github.head_ref, 'breakingchange/') }}
34-
with:
35-
labels: breaking-change
3630

3731
- name: Add `documentation` label
3832
uses: actions-ecosystem/action-add-labels@v1

.github/workflows/draft-a-release.yml

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
name: Draft a release
2-
3-
on:
4-
workflow_dispatch:
5-
6-
jobs:
7-
draft-a-release:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v3
12-
with:
13-
fetch-depth: 0
14-
15-
- name: Generate the release tag
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
run: |
19-
VERSION=$(curl -s https://raw.githubusercontent.com/khanh-ph/github-actions-scripts/master/gen-next-semver/gen-next-semver.sh | bash)
20-
echo VERSION=$VERSION >> $GITHUB_ENV
21-
echo BRANCH=release/$VERSION >> $GITHUB_ENV
22-
23-
- name: Create the release branch
24-
run: |
25-
git checkout -b ${{ env.BRANCH }}
26-
27-
- name: Push release branch
28-
run: git push origin ${{ env.BRANCH }}
29-
30-
- name: Create a Pull Request
31-
uses: thomaseizinger/[email protected]
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
with:
35-
base: master
36-
head: ${{ env.BRANCH }}
37-
title: Release version ${{ env.VERSION }}
38-
1+
name: Draft a release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
draft-a-release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Generate the release tag
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
run: |
19+
VERSION=$(curl -s https://raw.githubusercontent.com/khanh-ph/github-actions-scripts/master/gen-next-semver/gen-next-semver.sh | bash)
20+
echo VERSION=$VERSION >> $GITHUB_ENV
21+
echo BRANCH=release/$VERSION >> $GITHUB_ENV
22+
23+
- name: Create the release branch
24+
run: |
25+
git checkout -b ${{ env.BRANCH }}
26+
27+
- name: Push release branch
28+
run: git push origin ${{ env.BRANCH }}
29+
30+
- name: Create a Pull Request
31+
uses: thomaseizinger/[email protected]
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
base: master
36+
head: ${{ env.BRANCH }}
37+
title: Release version ${{ env.VERSION }}
Lines changed: 40 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,40 @@
1-
name: Publish a release
2-
3-
on:
4-
pull_request:
5-
branches:
6-
- master
7-
types:
8-
- closed
9-
10-
jobs:
11-
publish-a-release:
12-
runs-on: ubuntu-latest
13-
if: github.event.pull_request.merged == true &&
14-
(startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix/'))
15-
16-
steps:
17-
- name: Extract version from branch name (for release branches)
18-
if: startsWith(github.event.pull_request.head.ref, 'release/')
19-
run: |
20-
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
21-
VERSION=${BRANCH_NAME#release/}
22-
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
23-
24-
- name: Extract version from branch name (for hotfix branches)
25-
if: startsWith(github.event.pull_request.head.ref, 'hotfix/')
26-
run: |
27-
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
28-
VERSION=${BRANCH_NAME#hotfix/}
29-
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
30-
31-
- name: Create Release
32-
uses: thomaseizinger/[email protected]
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
with:
36-
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
37-
tag_name: ${{ env.RELEASE_VERSION }}
38-
name: v${{ env.RELEASE_VERSION }}
39-
draft: false
40-
prerelease: false
41-
42-
- name: Merge master into develop branch (Gitflow)
43-
uses: thomaseizinger/[email protected]
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
with:
47-
head: master
48-
base: develop
49-
title: Merge master into develop branch (Gitflow)
1+
name: Publish Release to GitHub
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
types:
7+
- closed
8+
9+
jobs:
10+
publish-a-release:
11+
runs-on: ubuntu-latest
12+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
13+
14+
steps:
15+
- name: Extract version from branch name (for release branches)
16+
if: startsWith(github.event.pull_request.head.ref, 'release/')
17+
run: |
18+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
19+
VERSION=${BRANCH_NAME#release/}
20+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
21+
22+
- name: Create Release
23+
uses: thomaseizinger/[email protected]
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
28+
tag_name: ${{ env.RELEASE_VERSION }}
29+
name: v${{ env.RELEASE_VERSION }}
30+
draft: false
31+
prerelease: false
32+
33+
- name: Merge master into develop branch (Gitflow)
34+
uses: thomaseizinger/[email protected]
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
head: master
39+
base: develop
40+
title: Merge master into develop branch (Gitflow)

.github/workflows/push-to-octopus-deploy.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
.terraform
33
*.tfstate
44
*.tfstate.*
5-
*.tfvars
65
*.tfplan
76
cloud.tf
87
tmp
98

109
# OS files
1110
Icon*
1211
.DS_Store
13-
*.ini
12+
.env*

.terraform.lock.hcl

Lines changed: 31 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,22 @@
1-
ks_img ?= quay.io/ulagbulag-village/kubespray:latest
2-
ks_tmp = kubespray/tmp
3-
ks_tmp_abspath= $(abspath $(ks_tmp))
4-
modules := $(wildcard modules/*)
5-
needs_cleanup := $(ks_tmp)
1+
fmt:
2+
terraform fmt --recursive
63

7-
export TF_IN_AUTOMATION := true
8-
9-
fmt: $(modules:%=%/fmt)
10-
@terraform fmt
11-
12-
%/fmt:
13-
@cd $* && terraform fmt
4+
fmt-check:
5+
terraform fmt -check --recursive
146

157
init:
16-
@terraform init -input=false
8+
terraform init -backend=false -input=false
179

18-
test: init $(modules:%=%/fmt_check)
19-
@terraform fmt -check
20-
@terraform validate
10+
test: fmt-check init
11+
terraform validate
2112

22-
%/fmt_check:
23-
@cd $* && terraform fmt -check
24-
25-
plan: test
26-
@terraform plan -input=false
13+
deploy:
14+
source .env.$(env) && terraform init -upgrade && terraform apply
2715

2816
destroy:
29-
@terraform destroy
30-
31-
infra: test
32-
@terraform apply -input=false --auto-approve -var ks_tmp=$(ks_tmp)
33-
34-
k8s:
35-
@docker pull $(ks_img)
36-
@sudo chmod 600 $(ks_tmp)/id_rsa
37-
@docker run --rm \
38-
--mount type=bind,source="${ks_tmp_abspath}/inventory.ini",dst=/inventory/sample/inventory.ini \
39-
--mount type=bind,source="${ks_tmp_abspath}/addons.yml",dst=/inventory/sample/group_vars/k8s_cluster/k8s-cluster.yml \
40-
--mount type=bind,source="${ks_tmp_abspath}/k8s-cluster.yml",dst=/inventory/sample/group_vars/k8s_cluster/addons.yml \
41-
--mount type=bind,source="${ks_tmp_abspath}/id_rsa",dst=/root/.ssh/id_rsa \
42-
$(ks_img) bash -c \
43-
"ansible-playbook -i /inventory/sample/inventory.ini -u ubuntu -become cluster.yml"
44-
45-
cluster: infra k8s clean
46-
47-
clean: $(needs_cleanup:%=%/clean)
17+
source .env.$(env) && terraform init -upgrade && terraform destroy
4818

49-
%/clean:
50-
@sudo rm -rf $*
19+
cluster: test
20+
terraform apply -var-file="example.tfvars"
5121

52-
.PHONY: fmt init test plan destroy infra k8s cluster clean kubectl
53-
.PHONY: %/fmt %/fmt_check %/clean
22+
.PHONY: fmt fmt-check init test deploy destroy

0 commit comments

Comments
 (0)