Skip to content

Commit 46c8e00

Browse files
authored
Deploying litmusctl bins to s3 bucket (#8)
Signed-off-by: Raj Das <[email protected]>
1 parent 0ee4b99 commit 46c8e00

14 files changed

+46
-43
lines changed

.github/workflows/main.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: Build
1+
name: build-pipeline
22
on:
33
pull_request:
44
branches:
55
- master
6-
push:
7-
branches:
8-
- master
96

107
jobs:
118
build:

.github/workflows/push.yml

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
name: Push-or-Release
1+
name: push-release-pipeline
22
on:
33
push:
44
branches:
55
- master
6-
tags-ignore:
7-
- '**'
6+
- s3-bucket
87
create:
98
tags:
109
- '**'
@@ -27,9 +26,9 @@ jobs:
2726
run: |
2827
if [ "$(gofmt -s -l . | wc -l)" -ne 0 ]
2928
then
30-
echo "The following files were found to be not go formatted:"
31-
gofmt -s -l .
32-
exit 1
29+
echo "The following files were found to be not go formatted:"
30+
gofmt -s -l .
31+
exit 1
3332
fi
3433
3534
- name: golangci-lint
@@ -39,23 +38,23 @@ jobs:
3938
run: |
4039
make unused-package-check
4140
41+
- name: Get tag
42+
shell: bash
43+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
44+
id: tag
45+
4246
- name: Building litmusctl
4347
run: |
4448
git checkout ${GITHUB_REF##*/}
45-
make build
49+
make TAG=${{ steps.tag.outputs.branch }} build
4650
47-
- name: Push litmusctl to repo
51+
- name: Configure AWS credentials from Test account
52+
uses: aws-actions/configure-aws-credentials@v1
53+
with:
54+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
55+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
56+
aws-region: us-east-1
57+
58+
- name: Copy files to the test website with the AWS CLI
4859
run: |
49-
git config --global user.name 'litmuschaos-bot'
50-
git config --global user.email '[email protected]'
51-
git remote -v
52-
if [[ `git status --porcelain` ]]; then
53-
echo "changes"
54-
git add .
55-
git commit -s -m "Updating litmusctl"
56-
git push
57-
exit 0;
58-
else
59-
echo "no changes"
60-
exit 0;
61-
fi
60+
aws s3 sync platforms-${{ steps.tag.outputs.branch }} s3://${{ secrets.AWS_S3_BUCKET }}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
/httpRequests/
99

1010
.idea
11-
main
11+
main
12+
platforms*

Makefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
PROJECT_NAME := "litmusctl"
2-
PKG := "github.com/litmuschaos/$(PROJECT_NAME)"
3-
41
all: build
52

63
build: ## Build the binary file
7-
@bash scripts/build.sh main.go
8-
4+
@bash scripts/build.sh main.go $(TAG)
95

106
.PHONY: unused-package-check
117
unused-package-check:

0 commit comments

Comments
 (0)