Skip to content

Commit

Permalink
Deploying litmusctl bins to s3 bucket (litmuschaos#8)
Browse files Browse the repository at this point in the history
Signed-off-by: Raj Das <[email protected]>
  • Loading branch information
imrajdas authored Mar 28, 2021
1 parent 0ee4b99 commit 46c8e00
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 43 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Build
name: build-pipeline
on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
build:
Expand Down
41 changes: 20 additions & 21 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Push-or-Release
name: push-release-pipeline
on:
push:
branches:
- master
tags-ignore:
- '**'
- s3-bucket
create:
tags:
- '**'
Expand All @@ -27,9 +26,9 @@ jobs:
run: |
if [ "$(gofmt -s -l . | wc -l)" -ne 0 ]
then
echo "The following files were found to be not go formatted:"
gofmt -s -l .
exit 1
echo "The following files were found to be not go formatted:"
gofmt -s -l .
exit 1
fi
- name: golangci-lint
Expand All @@ -39,23 +38,23 @@ jobs:
run: |
make unused-package-check
- name: Get tag
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
id: tag

- name: Building litmusctl
run: |
git checkout ${GITHUB_REF##*/}
make build
make TAG=${{ steps.tag.outputs.branch }} build
- name: Push litmusctl to repo
- name: Configure AWS credentials from Test account
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Copy files to the test website with the AWS CLI
run: |
git config --global user.name 'litmuschaos-bot'
git config --global user.email '[email protected]'
git remote -v
if [[ `git status --porcelain` ]]; then
echo "changes"
git add .
git commit -s -m "Updating litmusctl"
git push
exit 0;
else
echo "no changes"
exit 0;
fi
aws s3 sync platforms-${{ steps.tag.outputs.branch }} s3://${{ secrets.AWS_S3_BUCKET }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
/httpRequests/

.idea
main
main
platforms*
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
PROJECT_NAME := "litmusctl"
PKG := "github.com/litmuschaos/$(PROJECT_NAME)"

all: build

build: ## Build the binary file
@bash scripts/build.sh main.go

@bash scripts/build.sh main.go $(TAG)

.PHONY: unused-package-check
unused-package-check:
Expand Down
Loading

0 comments on commit 46c8e00

Please sign in to comment.