mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-28 17:51:06 -06:00
update docker actions and add sanity check
This commit is contained in:
parent
d740078c08
commit
3fa958c933
150
.github/workflows/release.yml
vendored
150
.github/workflows/release.yml
vendored
@ -144,34 +144,58 @@ jobs:
|
||||
mkdir staging
|
||||
cp nb/target/nb.jar nb/target/nb staging
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: binaries
|
||||
path: staging
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: binaries
|
||||
path: staging
|
||||
|
||||
- name: select release type from branch name
|
||||
run: |
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [[ ${current_branch} == *"-rc"* ]]
|
||||
then
|
||||
echo "PRERELEASE=true" >> $GITHUB_ENV
|
||||
echo "DOCKER_TAGS='"${{ env.RELEASE_VERSION }}"'" >> $GITHUB_ENV
|
||||
else
|
||||
echo "PRERELEASE=false" >> $GITHUB_ENV
|
||||
echo "DOCKER_TAGS='latest,"${{ env.RELEASE_VERSION }}"'" >> $GITHUB_ENV
|
||||
fi
|
||||
- name: select release type from branch name
|
||||
run: |
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [[ ${current_branch} == *"-rc"* ]]
|
||||
then
|
||||
echo "PRERELEASE=true" >> $GITHUB_ENV
|
||||
echo "DOCKER_TAGS='nosqlbench/nosqlbench:"${{ env.RELEASE_VERSION }}"'" >> $GITHUB_ENV
|
||||
else
|
||||
echo "PRERELEASE=false" >> $GITHUB_ENV
|
||||
echo "DOCKER_TAGS='nosqlbench/nosqlbench:latest,nosqlbench/nosqlbench:"${{ env
|
||||
.RELEASE_VERSION }}"'" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: docker push
|
||||
uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
repository: nosqlbench/nosqlbench
|
||||
tags: ${{ env.DOCKER_TAGS }}
|
||||
tag_with_ref: false
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: bundle guidebook
|
||||
- name: docker hub login
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: docker build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
pull: true
|
||||
push: false
|
||||
load: true
|
||||
tags: ${{ env.DOCKER_TAGS }}
|
||||
|
||||
- name: sanity check docker image
|
||||
run: |
|
||||
docker run --rm -i -t nosqlbench/nosqlbench:${{ env.RELEASE_VERSION }} --version
|
||||
|
||||
- name: docker push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
pull: true
|
||||
push: true
|
||||
tags: ${{ env.DOCKER_TAGS }}
|
||||
|
||||
- name: bundle guidebook
|
||||
run: mkdir guidebook && cp -R nb/target/guidebook guidebook
|
||||
|
||||
- name: upload guidebook
|
||||
@ -219,49 +243,49 @@ jobs:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
|
||||
- name: set git username
|
||||
run: git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
|
||||
- name: set git username
|
||||
run: git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
|
||||
|
||||
- name: set git email
|
||||
run: git config --global user.name "${{ secrets.NBDROID_NAME }}"
|
||||
- name: set git email
|
||||
run: git config --global user.name "${{ secrets.NBDROID_NAME }}"
|
||||
|
||||
- name: download guidebook
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: guidebook
|
||||
path: guidebook
|
||||
- name: download guidebook
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: guidebook
|
||||
path: guidebook
|
||||
|
||||
- run: ls -la
|
||||
- run: ls -la
|
||||
|
||||
- name: clone nosqlbench-docs
|
||||
env:
|
||||
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
|
||||
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
|
||||
run: |
|
||||
git clone https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-docs.git nosqlbench-docs
|
||||
cd nosqlbench-docs
|
||||
echo "files listing"
|
||||
find .
|
||||
git remote set-url origin https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-docs.git
|
||||
git remote -v
|
||||
- name: clone nosqlbench-docs
|
||||
env:
|
||||
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
|
||||
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
|
||||
run: |
|
||||
git clone https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-docs.git nosqlbench-docs
|
||||
cd nosqlbench-docs
|
||||
echo "files listing"
|
||||
find .
|
||||
git remote set-url origin https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-docs.git
|
||||
git remote -v
|
||||
|
||||
- name: push changes
|
||||
env:
|
||||
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
|
||||
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
|
||||
run: |
|
||||
rsync -av --delete guidebook/guidebook/ nosqlbench-docs/docs/
|
||||
echo "docs.nosqlbench.io" > nosqlbench-docs/docs/CNAME
|
||||
cd nosqlbench-docs
|
||||
git add docs
|
||||
git add -u
|
||||
CHANGES=$(git status --porcelain 2>/dev/null| wc -l)
|
||||
echo "found $CHANGES to push for doc updates"
|
||||
if (( $CHANGES > 0 ))
|
||||
then
|
||||
git commit -m"docs update for $GITHUB_REF"
|
||||
git push
|
||||
fi
|
||||
- name: push changes
|
||||
env:
|
||||
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
|
||||
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
|
||||
run: |
|
||||
rsync -av --delete guidebook/guidebook/ nosqlbench-docs/docs/
|
||||
echo "docs.nosqlbench.io" > nosqlbench-docs/docs/CNAME
|
||||
cd nosqlbench-docs
|
||||
git add docs
|
||||
git add -u
|
||||
CHANGES=$(git status --porcelain 2>/dev/null| wc -l)
|
||||
echo "found $CHANGES to push for doc updates"
|
||||
if (( $CHANGES > 0 ))
|
||||
then
|
||||
git commit -m"docs update for $GITHUB_REF"
|
||||
git push
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user