Skip to content

Commit

Permalink
Fix upload install scripts and crd files workflows (chaos-mesh#806)
Browse files Browse the repository at this point in the history
* remove_paths

Signed-off-by: cwen0 <[email protected]>

* upload more files

Signed-off-by: cwen0 <[email protected]>

* use awscli instead of cloud-assets-utils

Signed-off-by: cwen0 <[email protected]>
  • Loading branch information
cwen0 authored Aug 12, 2020
1 parent a23d44f commit d5b2fd0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 45 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Upload chaos mesh crd
on:
push:
tags:
- v*
jobs:
run:
name: Upload crd file
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
# Must use at least depth 2!
fetch-depth: 2
- name: Configure awscli
run: |
pip3 install --upgrade setuptools
pip3 install awscli
printf "%s\n" ${{ secrets.AWS_ACCESS_KEY }} ${{ secrets.AWS_SECRET_KEY }} ${{ secrets.AWS_REGION }} "json" | aws configure
- name: Upload crd file
run: |
GIT_TAG=${GITHUB_REF##*/}
if [[ "$GIT_TAG" == "master" ]]; then
GIT_TAG="latest"
fi
aws s3 cp install.sh ${{ secrets.AWS_BUCKET_NAME }}/${GIT_TAG}/install.sh
aws s3 cp manifests/crd.yaml ${{ secrets.AWS_BUCKET_NAME }}/${GIT_TAG}/crd.yaml
aws s3 cp examples/web-show/deploy.sh ${{ secrets.AWS_BUCKET_NAME }}/${GIT_TAG}/web-show/deploy.sh
# TODO: delete it
aws s3 cp manifests/chaosfs-sidecar.yaml ${{ secrets.AWS_BUCKET_NAME }}/${GIT_TAG}/chaosfs-sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ on:
push:
branches:
- master
tags:
- v*
paths:
- install.sh
- manifests/crd.yaml
- manifests/chaosfs-sidecar.yaml
- examples/web-show/deploy.sh
jobs:
run:
name: Upload crd file
Expand All @@ -17,11 +17,6 @@ jobs:
with:
# Must use at least depth 2!
fetch-depth: 2
- name: Download cloud_assets_utils
run: |
curl -L https://github.com/pingcap/cloud-assets-utils/releases/download/v0.2.0/cloud_assets_utils-ubuntu-latest -o cloud_assets_utils
chmod +x cloud_assets_utils
sudo mv cloud_assets_utils /usr/local/bin/cloud-assets-utils
- name: Configure awscli
run: |
pip3 install --upgrade setuptools
Expand All @@ -33,6 +28,8 @@ jobs:
if [[ "$GIT_TAG" == "master" ]]; then
GIT_TAG="latest"
fi
cloud-assets-utils verify-and-sync manifests/crd.yaml -aws true -aws-bucket ${{ secrets.AWS_BUCKET_NAME }} -replace-first-path-to ${GIT_TAG}
aws s3 cp install.sh ${{ secrets.AWS_BUCKET_NAME }}/${GIT_TAG}/install.sh
aws s3 cp manifests/crd.yaml ${{ secrets.AWS_BUCKET_NAME }}/${GIT_TAG}/crd.yaml
aws s3 cp examples/web-show/deploy.sh ${{ secrets.AWS_BUCKET_NAME }}/${GIT_TAG}/web-show/deploy.sh
# TODO: delete it
cloud-assets-utils verify-and-sync manifests/chaosfs-sidecar.yaml -aws true -aws-bucket ${{ secrets.AWS_BUCKET_NAME }} -replace-first-path-to ${GIT_TAG}
aws s3 cp manifests/chaosfs-sidecar.yaml ${{ secrets.AWS_BUCKET_NAME }}/${GIT_TAG}/chaosfs-sidecar.yaml
36 changes: 0 additions & 36 deletions .github/workflows/upload_install_script.yml

This file was deleted.

0 comments on commit d5b2fd0

Please sign in to comment.