From bce60c2b597e7890731de4f5ab1e6e5c5f07bd2b Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Thu, 5 Mar 2020 02:08:57 +0900 Subject: [PATCH 01/23] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=86=E3=83=8A?= =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E7=94=A8=E3=81=A8=E3=83=AA=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E7=94=A8=E3=81=AE=20GitHub=20action=20?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 2 +- .github/workflows/build_and_push.yml | 52 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 48 +++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_and_push.yml create mode 100644 .github/workflows/release.yml diff --git a/.editorconfig b/.editorconfig index 48201ec..47bab20 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,7 @@ root = true [*] end_of_line = lf -[*.sh] +[*.{sh,yml,yaml}] charset = utf-8 indent_style = space indent_size = 2 diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml new file mode 100644 index 0000000..76c5e68 --- /dev/null +++ b/.github/workflows/build_and_push.yml @@ -0,0 +1,52 @@ +name: Build and push Docker Image + +# on: +# push: +# branches: +# - master +on: [push] + +env: + DOCKERHUB_REPOSITORY: ryu310/mongodb-awesome-backup + +jobs: + build_and_push: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: crazy-max/ghaction-docker-buildx@v1.0.4 + with: + version: v0.3.1 + + - name: Login to Docker Hub + run: > + echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | + docker login --username ${{ secrets.DOCKER_REGISTRY_USERNAME }} --password-stdin + + - name: Build and push latest Docker Image + run: > + docker buildx build + --tag ${DOCKERHUB_REPOSITORY} + --platform linux/amd64 + --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} + --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY},mode=max + --push + ./.docker + + publish_description: + runs-on: ubuntu-latest + needs: build_and_push + + steps: + - uses: actions/checkout@v2 + + - name: Update Docker Hub Description + uses: peter-evans/dockerhub-description@v2.1.0 + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + DOCKERHUB_REPOSITORY: ${{ env.DOCKERHUB_REPOSITORY }} + README_FILEPATH: ./README.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0df16b8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + release: + types: [published] + +env: + DOCKERHUB_REPOSITORY: ryu310/mongodb-awesome-backup + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Get SemVer + run: | + SEMVER=`git tag | sed -E 's/^v//'` + echo ::set-env name=SEMVER::$SEMVER + + - name: Set up Docker Buildx + uses: crazy-max/ghaction-docker-buildx@v1.0.4 + with: + version: v0.3.1 + + - name: Login to docker.io registry + run: > + echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | + docker login --username ${{ secrets.DOCKER_REGISTRY_USERNAME }} --password-stdin + + - name: Build and push latest Docker Image + run: > + docker buildx build + --tag ${DOCKERHUB_REPOSITORY} + --platform linux/amd64 + --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} + --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY},mode=max + --push + ./.docker + + - name: Tagging Docker Image by SemVer and publish + uses: weseek/ghaction-docker-tags-by-semver@v1.0.5 + with: + source: ${{ env.DOCKERHUB_REPOSITORY }} + target: ${{ env.DOCKERHUB_REPOSITORY }} + semver: ${{ env.SEMVER }} + publish: true From 1124c24c24b8a324e7b4d6345be8b5332c638a90 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Thu, 5 Mar 2020 02:13:54 +0900 Subject: [PATCH 02/23] =?UTF-8?q?docker-compose=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E7=9F=A5=E3=82=8B=E3=81=9F=E3=82=81?= =?UTF-8?q?=E3=81=AE=E3=83=87=E3=83=90=E3=83=83=E3=82=B0=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4232c9e..f8abaea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,8 @@ jobs: BUCKET_NAME_PREFIX=`echo $GITHUB_REPOSITORY | tr '/' '_'` export TARGET_BUCKET_URL="${TARGET_BUCKET_URL_PREFIX}/${BUCKET_NAME_PREFIX}_${GITHUB_RUN_ID}/" + docker-compose -v + test/all.sh - name: Remove the temporary service account key file From 1bbc391726b958de09c477bcf72321047c07137e Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Thu, 5 Mar 2020 02:15:54 +0900 Subject: [PATCH 03/23] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_push.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index 76c5e68..9f7663c 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -34,7 +34,7 @@ jobs: --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY},mode=max --push - ./.docker + . publish_description: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0df16b8..a106d6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY},mode=max --push - ./.docker + . - name: Tagging Docker Image by SemVer and publish uses: weseek/ghaction-docker-tags-by-semver@v1.0.5 From 1fed5d0eca903fdc77c41b363ac7d3544d0082c5 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Fri, 6 Mar 2020 02:04:15 +0900 Subject: [PATCH 04/23] =?UTF-8?q?debug=20=E3=83=A1=E3=83=83=E3=82=BB?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8abaea..f37ba4d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} NOTIFY_MESSAGE: '${{ github.repository }} (${{ github.workflow }}): `${{ github.ref }}`@${{ github.actor }}' + # docker-compose version (it need over version 1.25.0 to using BuildKit. see: https://github.com/docker/compose/releases/tag/1.25.0) + DOCKER_COMPOSE_VERSION: 1.25.3 steps: - uses: actions/checkout@v2 @@ -27,6 +29,15 @@ jobs: run: | echo ::set-env name=GCP_SERVICE_ACCOUNT_KEY_JSON_PATH::"$(pwd)/tmp/key.json" + - run: + name: Install Docker Compose + command: | + # ref: https://github.com/docker/compose/releases + curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose + chmod +x /usr/local/bin/docker-compose + echo PATH ${PATH} + echo "::add-path::/usr/local/bin/docker-compose" + - name: Run integration tests run: | # Create a temporary service account key file @@ -36,9 +47,12 @@ jobs: # Set environment for integration tests BUCKET_NAME_PREFIX=`echo $GITHUB_REPOSITORY | tr '/' '_'` export TARGET_BUCKET_URL="${TARGET_BUCKET_URL_PREFIX}/${BUCKET_NAME_PREFIX}_${GITHUB_RUN_ID}/" - + + export DOCKER_BUILDKIT=1 + export COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -v - + which docker-compose + echo PATH ${PATH} test/all.sh - name: Remove the temporary service account key file From fc3ee2f99736760533eb33fd2846274110468bdf Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Fri, 6 Mar 2020 03:20:43 +0900 Subject: [PATCH 05/23] =?UTF-8?q?docker=20=E3=82=B3=E3=83=B3=E3=83=86?= =?UTF-8?q?=E3=83=8A=E3=81=AE=20push=20=E6=96=B9=E6=B3=95=E3=82=92=20inlin?= =?UTF-8?q?e=20=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_push.yml | 7 ++++--- .github/workflows/release.yml | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index 9f7663c..e533958 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -25,15 +25,16 @@ jobs: run: > echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | docker login --username ${{ secrets.DOCKER_REGISTRY_USERNAME }} --password-stdin - + - name: Build and push latest Docker Image run: > docker buildx build --tag ${DOCKERHUB_REPOSITORY} --platform linux/amd64 --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} - --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY},mode=max - --push + --cache-to type=inline + --output type=image,name=${DOCKERHUB_REPOSITORY},push=true + --opt build-arg:BUILDKIT_INLINE_CACHE=1 . publish_description: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a106d6a..7b35283 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,8 +35,9 @@ jobs: --tag ${DOCKERHUB_REPOSITORY} --platform linux/amd64 --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} - --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY},mode=max - --push + --cache-to type=inline + --output type=image,name=${DOCKERHUB_REPOSITORY},push=true + --opt build-arg:BUILDKIT_INLINE_CACHE=1 . - name: Tagging Docker Image by SemVer and publish From 5264fec3762833b7353e5a77c9c26c4ce14e2bbf Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Fri, 6 Mar 2020 03:23:01 +0900 Subject: [PATCH 06/23] =?UTF-8?q?buildx=20=E3=81=AE=E3=82=AA=E3=83=97?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_push.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index e533958..f54269b 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -34,7 +34,7 @@ jobs: --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} --cache-to type=inline --output type=image,name=${DOCKERHUB_REPOSITORY},push=true - --opt build-arg:BUILDKIT_INLINE_CACHE=1 + --build-arg BUILDKIT_INLINE_CACHE=1 . publish_description: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b35283..bf915e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} --cache-to type=inline --output type=image,name=${DOCKERHUB_REPOSITORY},push=true - --opt build-arg:BUILDKIT_INLINE_CACHE=1 + --build-arg BUILDKIT_INLINE_CACHE=1 . - name: Tagging Docker Image by SemVer and publish From 4fbc995f4f87fd02ae7d6582d5fb15f9950c4045 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Fri, 6 Mar 2020 03:26:09 +0900 Subject: [PATCH 07/23] =?UTF-8?q?test.yml=20=E3=81=AE=20syntax=20error=20?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f37ba4d..77900f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,9 +29,8 @@ jobs: run: | echo ::set-env name=GCP_SERVICE_ACCOUNT_KEY_JSON_PATH::"$(pwd)/tmp/key.json" - - run: - name: Install Docker Compose - command: | + - name: Install Docker Compose + run: | # ref: https://github.com/docker/compose/releases curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose From dec74fa7011affe697d9145522c833a598ef9861 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Fri, 6 Mar 2020 03:57:12 +0900 Subject: [PATCH 08/23] =?UTF-8?q?=E3=82=A4=E3=83=A1=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AB=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=82=92?= =?UTF-8?q?=20inline=20=E3=81=95=E3=81=9B=E3=82=8B=E3=83=93=E3=83=AB?= =?UTF-8?q?=E3=83=89=E3=81=AF=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=9F=E3=82=81=E3=83=93?= =?UTF-8?q?=E3=83=AB=E3=83=89=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92=E5=85=83=E6=88=BB=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_push.yml | 3 +-- .github/workflows/release.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index f54269b..010e9ec 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -32,9 +32,8 @@ jobs: --tag ${DOCKERHUB_REPOSITORY} --platform linux/amd64 --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} - --cache-to type=inline + --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY} --output type=image,name=${DOCKERHUB_REPOSITORY},push=true - --build-arg BUILDKIT_INLINE_CACHE=1 . publish_description: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf915e0..9f0aab6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,9 +35,8 @@ jobs: --tag ${DOCKERHUB_REPOSITORY} --platform linux/amd64 --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} - --cache-to type=inline + --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY} --output type=image,name=${DOCKERHUB_REPOSITORY},push=true - --build-arg BUILDKIT_INLINE_CACHE=1 . - name: Tagging Docker Image by SemVer and publish From 7d607ebe16fd818199b7c84b77011787d8fd07bc Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Fri, 6 Mar 2020 03:59:59 +0900 Subject: [PATCH 09/23] =?UTF-8?q?docker-compose=20=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E6=99=82=E3=81=AB=20sudo?= =?UTF-8?q?=20=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6=E6=A8=A9=E9=99=90?= =?UTF-8?q?=E6=98=87=E6=A0=BC=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77900f4..a218093 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Install Docker Compose run: | # ref: https://github.com/docker/compose/releases - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose + sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose echo PATH ${PATH} echo "::add-path::/usr/local/bin/docker-compose" From b8faa7e844f33a70e5b47490aae8cf9b992768a1 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Fri, 6 Mar 2020 04:05:25 +0900 Subject: [PATCH 10/23] =?UTF-8?q?=E6=A8=A9=E9=99=90=E4=B8=8D=E8=B6=B3?= =?UTF-8?q?=E3=81=AE=E3=81=9F=E3=82=81docker-compose=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=83=91=E3=82=B9=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a218093..7281508 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,11 +31,14 @@ jobs: - name: Install Docker Compose run: | + DOCKER_COMPOSE_PATH="~/bin/docker-compose" + mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) + # ref: https://github.com/docker/compose/releases - sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose - chmod +x /usr/local/bin/docker-compose + curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > ${DOCKER_COMPOSE_PATH} + chmod +x ${DOCKER_COMPOSE_PATH} echo PATH ${PATH} - echo "::add-path::/usr/local/bin/docker-compose" + echo "::add-path::${DOCKER_COMPOSE_PATH}" - name: Run integration tests run: | From 97d2c1250576b82ae5a28068e70fa02cdee62966 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sat, 7 Mar 2020 19:04:15 +0900 Subject: [PATCH 11/23] =?UTF-8?q?test=20action=20=E3=82=92=E3=83=AA?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=AF=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7281508..3653ccf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,32 +24,33 @@ jobs: steps: - uses: actions/checkout@v2 - - - name: Set service account key path - run: | - echo ::set-env name=GCP_SERVICE_ACCOUNT_KEY_JSON_PATH::"$(pwd)/tmp/key.json" - name: Install Docker Compose run: | DOCKER_COMPOSE_PATH="~/bin/docker-compose" mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) - # ref: https://github.com/docker/compose/releases + # Download docker-compose (ref: https://github.com/docker/compose/releases) curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > ${DOCKER_COMPOSE_PATH} chmod +x ${DOCKER_COMPOSE_PATH} echo PATH ${PATH} echo "::add-path::${DOCKER_COMPOSE_PATH}" - - name: Run integration tests + - name: Set service account key path and create a temporary service account key file run: | - # Create a temporary service account key file + GCP_SERVICE_ACCOUNT_KEY_JSON_PATH="$(pwd)/tmp/key.json" + echo ::set-env name=GCP_SERVICE_ACCOUNT_KEY_JSON_PATH::$GCP_SERVICE_ACCOUNT_KEY_JSON_PATH + mkdir -p $(dirname ${GCP_SERVICE_ACCOUNT_KEY_JSON_PATH}) echo '${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}' > ${GCP_SERVICE_ACCOUNT_KEY_JSON_PATH} - # Set environment for integration tests + - name: Set environment for integration tests + run: | BUCKET_NAME_PREFIX=`echo $GITHUB_REPOSITORY | tr '/' '_'` - export TARGET_BUCKET_URL="${TARGET_BUCKET_URL_PREFIX}/${BUCKET_NAME_PREFIX}_${GITHUB_RUN_ID}/" + echo ::set-env name=TARGET_BUCKET_URL::"${TARGET_BUCKET_URL_PREFIX}/${BUCKET_NAME_PREFIX}_${GITHUB_RUN_ID}/" + - name: Run integration tests + run: | export DOCKER_BUILDKIT=1 export COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -v From 55967fc46b8a6ff0f8343f75f5852be1fbc43a03 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 15:05:50 +0900 Subject: [PATCH 12/23] =?UTF-8?q?build=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5=E3=81=A8=E3=82=A4=E3=83=A1=E3=83=BC=E3=82=B8=E3=82=92?= =?UTF-8?q?=E5=90=8C=E6=99=82=E3=83=97=E3=83=83=E3=82=B7=E3=83=A5=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_push.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index 010e9ec..0872260 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -32,8 +32,8 @@ jobs: --tag ${DOCKERHUB_REPOSITORY} --platform linux/amd64 --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} - --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY} - --output type=image,name=${DOCKERHUB_REPOSITORY},push=true + --cache-to type=inine + --push . publish_description: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f0aab6..433441d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,8 +35,8 @@ jobs: --tag ${DOCKERHUB_REPOSITORY} --platform linux/amd64 --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} - --cache-to type=registry,ref=${DOCKERHUB_REPOSITORY} - --output type=image,name=${DOCKERHUB_REPOSITORY},push=true + --cache-to type=inine + --push . - name: Tagging Docker Image by SemVer and publish From 302077f77070156b08926b52508bc3a23dafdefe Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 15:08:05 +0900 Subject: [PATCH 13/23] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=82=AA?= =?UTF-8?q?=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=AEtypo=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_push.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index 0872260..006b93e 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -32,7 +32,7 @@ jobs: --tag ${DOCKERHUB_REPOSITORY} --platform linux/amd64 --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} - --cache-to type=inine + --cache-to type=inline --push . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 433441d..055d38a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: --tag ${DOCKERHUB_REPOSITORY} --platform linux/amd64 --cache-from type=registry,ref=${DOCKERHUB_REPOSITORY} - --cache-to type=inine + --cache-to type=inline --push . From b15b387e19db92a2770e26db350535032b35f8b8 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 17:17:18 +0900 Subject: [PATCH 14/23] =?UTF-8?q?test=20action=20=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E6=99=82=E3=81=AB=E3=83=93=E3=83=AB=E3=83=89=E3=82=AD=E3=83=A3?= =?UTF-8?q?=E3=83=83=E3=82=B7=E3=83=A5=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 3 +++ test/gcs/docker-compose.yml | 5 ++++- test/s3/docker-compose.yml | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3653ccf..babf797 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,8 @@ jobs: NOTIFY_MESSAGE: '${{ github.repository }} (${{ github.workflow }}): `${{ github.ref }}`@${{ github.actor }}' # docker-compose version (it need over version 1.25.0 to using BuildKit. see: https://github.com/docker/compose/releases/tag/1.25.0) DOCKER_COMPOSE_VERSION: 1.25.3 + # Use cache on docker-compose building + DOCKER_COMPOSE_CACHE_FROM: ryu310/mongodb-awesome-backup steps: - uses: actions/checkout@v2 @@ -53,6 +55,7 @@ jobs: run: | export DOCKER_BUILDKIT=1 export COMPOSE_DOCKER_CLI_BUILD=1 + export DOCKER_COMPOSE_CACHE_FROM=${} docker-compose -v which docker-compose echo PATH ${PATH} diff --git a/test/gcs/docker-compose.yml b/test/gcs/docker-compose.yml index 4728b5d..dd1da91 100644 --- a/test/gcs/docker-compose.yml +++ b/test/gcs/docker-compose.yml @@ -1,5 +1,5 @@ # This file would be executed from e2e.sh -version: '3' +version: '3.2' services: # Service account authorization @@ -8,6 +8,9 @@ services: build: context: ../../ dockerfile: Dockerfile + cache_from: + - $DOCKER_COMPOSE_CACHE_FROM + environment: &base_env GCP_SERVICE_ACCOUNT_KEY_JSON_PATH: $GCP_SERVICE_ACCOUNT_KEY_JSON_PATH GCP_PROJECT_ID: $GCP_PROJECT_ID diff --git a/test/s3/docker-compose.yml b/test/s3/docker-compose.yml index e712cc8..72a7b18 100644 --- a/test/s3/docker-compose.yml +++ b/test/s3/docker-compose.yml @@ -1,5 +1,5 @@ # This file would be executed from e2e.sh -version: '3' +version: '3.2' services: # test for backup in command mode @@ -7,6 +7,9 @@ services: build: context: ../../ dockerfile: Dockerfile + cache_from: + - $DOCKER_COMPOSE_CACHE_FROM + environment: &base_env AWS_ACCESS_KEY_ID: testid AWS_SECRET_ACCESS_KEY: testkey From 9d6adb30f9bf9219dc9377db063a2eb526c4a89a Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 17:19:13 +0900 Subject: [PATCH 15/23] =?UTF-8?q?test=20action=20=E3=81=AE=20syntax=20?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E8=A7=A3=E6=B6=88=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index babf797..b544ba8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,8 @@ jobs: # docker-compose version (it need over version 1.25.0 to using BuildKit. see: https://github.com/docker/compose/releases/tag/1.25.0) DOCKER_COMPOSE_VERSION: 1.25.3 # Use cache on docker-compose building + DOCKER_BUILDKIT: 1 + COMPOSE_DOCKER_CLI_BUILD: 1 DOCKER_COMPOSE_CACHE_FROM: ryu310/mongodb-awesome-backup steps: @@ -53,9 +55,6 @@ jobs: - name: Run integration tests run: | - export DOCKER_BUILDKIT=1 - export COMPOSE_DOCKER_CLI_BUILD=1 - export DOCKER_COMPOSE_CACHE_FROM=${} docker-compose -v which docker-compose echo PATH ${PATH} From 49dab5f8bdca1331c6fbae40c8734606faa0ca15 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 17:29:20 +0900 Subject: [PATCH 16/23] =?UTF-8?q?test=20action=20=E3=81=AE=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b544ba8..971e75f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > ${DOCKER_COMPOSE_PATH} chmod +x ${DOCKER_COMPOSE_PATH} echo PATH ${PATH} - echo "::add-path::${DOCKER_COMPOSE_PATH}" + echo "::add-path::$(dirname ${DOCKER_COMPOSE_PATH})" - name: Set service account key path and create a temporary service account key file run: | From 85f4b551d06d2cde2ec90dd6b5f4b74e0e2718fa Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 17:40:43 +0900 Subject: [PATCH 17/23] =?UTF-8?q?test=20action=20=E5=86=85=E3=81=AE=20dock?= =?UTF-8?q?er-compose=20=E3=83=80=E3=82=A6=E3=83=B3=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AE=E8=AA=A4?= =?UTF-8?q?=E3=82=8A=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 971e75f..6f62440 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) # Download docker-compose (ref: https://github.com/docker/compose/releases) - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > ${DOCKER_COMPOSE_PATH} + curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o ${DOCKER_COMPOSE_PATH} chmod +x ${DOCKER_COMPOSE_PATH} echo PATH ${PATH} echo "::add-path::$(dirname ${DOCKER_COMPOSE_PATH})" From 90a14ab72b9f99a6b94f84dd7288c25001777314 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 17:44:24 +0900 Subject: [PATCH 18/23] debug --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f62440..a9ffc94 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,6 +55,7 @@ jobs: - name: Run integration tests run: | + ls -al ~/bin docker-compose -v which docker-compose echo PATH ${PATH} From 32c867225c03f1eb1d31258d3774409f26dc47cb Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 17:48:28 +0900 Subject: [PATCH 19/23] =?UTF-8?q?test=20action=20=E3=81=AE=20docker-compos?= =?UTF-8?q?e=20=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=20st?= =?UTF-8?q?ep=20=E3=81=A8=E3=83=86=E3=82=B9=E3=83=88=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E3=82=92=E4=B8=80=E7=B7=92=E3=81=AE=20step=20=E3=81=AB?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9ffc94..ca57561 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,17 +29,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Docker Compose - run: | - DOCKER_COMPOSE_PATH="~/bin/docker-compose" - mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) - - # Download docker-compose (ref: https://github.com/docker/compose/releases) - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o ${DOCKER_COMPOSE_PATH} - chmod +x ${DOCKER_COMPOSE_PATH} - echo PATH ${PATH} - echo "::add-path::$(dirname ${DOCKER_COMPOSE_PATH})" - - name: Set service account key path and create a temporary service account key file run: | GCP_SERVICE_ACCOUNT_KEY_JSON_PATH="$(pwd)/tmp/key.json" @@ -55,6 +44,17 @@ jobs: - name: Run integration tests run: | + # Install Docker Compose + DOCKER_COMPOSE_PATH="~/bin/docker-compose" + mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) + + # Download docker-compose (ref: https://github.com/docker/compose/releases) + curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o ${DOCKER_COMPOSE_PATH} + chmod +x ${DOCKER_COMPOSE_PATH} + echo PATH ${PATH} + # Add path temporaly + export PATH="$(dirname ${DOCKER_COMPOSE_PATH}):${PATH}" + ls -al ~/bin docker-compose -v which docker-compose From dec086e2e6b02d3356b365317c6dea17faad1618 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 17:55:00 +0900 Subject: [PATCH 20/23] =?UTF-8?q?test=20action=20=E3=81=AE=20docker-compos?= =?UTF-8?q?e=20=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E5=85=88=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ca57561..070c659 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,17 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Install Docker Compose + run: | + DOCKER_COMPOSE_PATH="$(pwd)/bin/docker-compose" + mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) + + # Download docker-compose (ref: https://github.com/docker/compose/releases) + curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o ${DOCKER_COMPOSE_PATH} + chmod +x ${DOCKER_COMPOSE_PATH} + echo PATH ${PATH} + echo "::add-path::$(dirname ${DOCKER_COMPOSE_PATH})" + - name: Set service account key path and create a temporary service account key file run: | GCP_SERVICE_ACCOUNT_KEY_JSON_PATH="$(pwd)/tmp/key.json" @@ -44,18 +55,7 @@ jobs: - name: Run integration tests run: | - # Install Docker Compose - DOCKER_COMPOSE_PATH="~/bin/docker-compose" - mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) - - # Download docker-compose (ref: https://github.com/docker/compose/releases) - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o ${DOCKER_COMPOSE_PATH} - chmod +x ${DOCKER_COMPOSE_PATH} - echo PATH ${PATH} - # Add path temporaly - export PATH="$(dirname ${DOCKER_COMPOSE_PATH}):${PATH}" - - ls -al ~/bin + ls -al ./bin docker-compose -v which docker-compose echo PATH ${PATH} From 658f963171d02bfb5fd6f2d39cab2fb10cf952cc Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 21:20:04 +0900 Subject: [PATCH 21/23] =?UTF-8?q?=E3=83=87=E3=83=90=E3=83=83=E3=82=B0?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E8=A1=A8=E7=A4=BA=E3=83=BB=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=82=92=E5=8F=96=E3=82=8A=E9=99=A4=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_push.yml | 11 +++++------ .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 10 +++------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index 006b93e..39e2d95 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -1,13 +1,12 @@ name: Build and push Docker Image -# on: -# push: -# branches: -# - master -on: [push] +on: + push: + branches: + - master env: - DOCKERHUB_REPOSITORY: ryu310/mongodb-awesome-backup + DOCKERHUB_REPOSITORY: weseek/mongodb-awesome-backup jobs: build_and_push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 055d38a..3bbcca6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: types: [published] env: - DOCKERHUB_REPOSITORY: ryu310/mongodb-awesome-backup + DOCKERHUB_REPOSITORY: weseek/mongodb-awesome-backup jobs: release: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 070c659..1e18198 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: # Use cache on docker-compose building DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 - DOCKER_COMPOSE_CACHE_FROM: ryu310/mongodb-awesome-backup + DOCKER_COMPOSE_CACHE_FROM: weseek/mongodb-awesome-backup steps: - uses: actions/checkout@v2 @@ -34,10 +34,10 @@ jobs: DOCKER_COMPOSE_PATH="$(pwd)/bin/docker-compose" mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) - # Download docker-compose (ref: https://github.com/docker/compose/releases) + # Download docker-compose and add path(ref: https://github.com/docker/compose/releases) curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o ${DOCKER_COMPOSE_PATH} chmod +x ${DOCKER_COMPOSE_PATH} - echo PATH ${PATH} + ${DOCKER_COMPOSE_PATH} -v echo "::add-path::$(dirname ${DOCKER_COMPOSE_PATH})" - name: Set service account key path and create a temporary service account key file @@ -55,10 +55,6 @@ jobs: - name: Run integration tests run: | - ls -al ./bin - docker-compose -v - which docker-compose - echo PATH ${PATH} test/all.sh - name: Remove the temporary service account key file From 7fae4a3b89d256b6f7f73a6c6596726548165399 Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 23:45:56 +0900 Subject: [PATCH 22/23] =?UTF-8?q?docker=20compose=20=E3=81=A7=20buildkit?= =?UTF-8?q?=20=E3=82=92=E4=BD=BF=E3=81=86=E5=8A=B9=E6=9E=9C=E3=81=8C?= =?UTF-8?q?=E8=A6=8B=E3=82=89=E3=82=8C=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=9F=E3=82=81=E5=85=83=E6=88=BB=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 34 ++++++++-------------------------- test/gcs/docker-compose.yml | 4 +--- test/s3/docker-compose.yml | 4 +--- 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e18198..4232c9e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,42 +19,24 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} NOTIFY_MESSAGE: '${{ github.repository }} (${{ github.workflow }}): `${{ github.ref }}`@${{ github.actor }}' - # docker-compose version (it need over version 1.25.0 to using BuildKit. see: https://github.com/docker/compose/releases/tag/1.25.0) - DOCKER_COMPOSE_VERSION: 1.25.3 - # Use cache on docker-compose building - DOCKER_BUILDKIT: 1 - COMPOSE_DOCKER_CLI_BUILD: 1 - DOCKER_COMPOSE_CACHE_FROM: weseek/mongodb-awesome-backup steps: - uses: actions/checkout@v2 - - - name: Install Docker Compose + + - name: Set service account key path run: | - DOCKER_COMPOSE_PATH="$(pwd)/bin/docker-compose" - mkdir -p $(dirname ${DOCKER_COMPOSE_PATH}) - - # Download docker-compose and add path(ref: https://github.com/docker/compose/releases) - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o ${DOCKER_COMPOSE_PATH} - chmod +x ${DOCKER_COMPOSE_PATH} - ${DOCKER_COMPOSE_PATH} -v - echo "::add-path::$(dirname ${DOCKER_COMPOSE_PATH})" + echo ::set-env name=GCP_SERVICE_ACCOUNT_KEY_JSON_PATH::"$(pwd)/tmp/key.json" - - name: Set service account key path and create a temporary service account key file + - name: Run integration tests run: | - GCP_SERVICE_ACCOUNT_KEY_JSON_PATH="$(pwd)/tmp/key.json" - echo ::set-env name=GCP_SERVICE_ACCOUNT_KEY_JSON_PATH::$GCP_SERVICE_ACCOUNT_KEY_JSON_PATH - + # Create a temporary service account key file mkdir -p $(dirname ${GCP_SERVICE_ACCOUNT_KEY_JSON_PATH}) echo '${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}' > ${GCP_SERVICE_ACCOUNT_KEY_JSON_PATH} - - name: Set environment for integration tests - run: | + # Set environment for integration tests BUCKET_NAME_PREFIX=`echo $GITHUB_REPOSITORY | tr '/' '_'` - echo ::set-env name=TARGET_BUCKET_URL::"${TARGET_BUCKET_URL_PREFIX}/${BUCKET_NAME_PREFIX}_${GITHUB_RUN_ID}/" - - - name: Run integration tests - run: | + export TARGET_BUCKET_URL="${TARGET_BUCKET_URL_PREFIX}/${BUCKET_NAME_PREFIX}_${GITHUB_RUN_ID}/" + test/all.sh - name: Remove the temporary service account key file diff --git a/test/gcs/docker-compose.yml b/test/gcs/docker-compose.yml index dd1da91..3d5c597 100644 --- a/test/gcs/docker-compose.yml +++ b/test/gcs/docker-compose.yml @@ -1,5 +1,5 @@ # This file would be executed from e2e.sh -version: '3.2' +version: '3' services: # Service account authorization @@ -8,8 +8,6 @@ services: build: context: ../../ dockerfile: Dockerfile - cache_from: - - $DOCKER_COMPOSE_CACHE_FROM environment: &base_env GCP_SERVICE_ACCOUNT_KEY_JSON_PATH: $GCP_SERVICE_ACCOUNT_KEY_JSON_PATH diff --git a/test/s3/docker-compose.yml b/test/s3/docker-compose.yml index 72a7b18..ddd464d 100644 --- a/test/s3/docker-compose.yml +++ b/test/s3/docker-compose.yml @@ -1,5 +1,5 @@ # This file would be executed from e2e.sh -version: '3.2' +version: '3' services: # test for backup in command mode @@ -7,8 +7,6 @@ services: build: context: ../../ dockerfile: Dockerfile - cache_from: - - $DOCKER_COMPOSE_CACHE_FROM environment: &base_env AWS_ACCESS_KEY_ID: testid From e6855a7b9ad2ae38075a14375aecd85408b4e27c Mon Sep 17 00:00:00 2001 From: Ryu Sato Date: Sun, 8 Mar 2020 23:49:11 +0900 Subject: [PATCH 23/23] =?UTF-8?q?docker-compose=20=E3=81=AB=E5=8A=A0?= =?UTF-8?q?=E3=81=88=E3=81=9F=20buildkit=20=E3=82=92=E4=BD=BF=E3=81=86?= =?UTF-8?q?=E6=99=82=E7=94=A8=E3=81=AE=E5=A4=89=E6=9B=B4=E3=82=92=E5=85=83?= =?UTF-8?q?=E6=88=BB=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/gcs/docker-compose.yml | 1 - test/s3/docker-compose.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/test/gcs/docker-compose.yml b/test/gcs/docker-compose.yml index 3d5c597..4728b5d 100644 --- a/test/gcs/docker-compose.yml +++ b/test/gcs/docker-compose.yml @@ -8,7 +8,6 @@ services: build: context: ../../ dockerfile: Dockerfile - environment: &base_env GCP_SERVICE_ACCOUNT_KEY_JSON_PATH: $GCP_SERVICE_ACCOUNT_KEY_JSON_PATH GCP_PROJECT_ID: $GCP_PROJECT_ID diff --git a/test/s3/docker-compose.yml b/test/s3/docker-compose.yml index ddd464d..e712cc8 100644 --- a/test/s3/docker-compose.yml +++ b/test/s3/docker-compose.yml @@ -7,7 +7,6 @@ services: build: context: ../../ dockerfile: Dockerfile - environment: &base_env AWS_ACCESS_KEY_ID: testid AWS_SECRET_ACCESS_KEY: testkey