Kaynağa Gözat

add workflow steps for e2e tests

Mohammed Nafees 4 yıl önce
ebeveyn
işleme
3e2dea7ade
1 değiştirilmiş dosya ile 85 ekleme ve 2 silme
  1. 85 2
      .github/workflows/prerelease.yaml

+ 85 - 2
.github/workflows/prerelease.yaml

@@ -250,7 +250,7 @@ jobs:
   release:
     name: Zip binaries, create release and upload assets
     runs-on: ubuntu-latest
-    needs: 
+    needs:
     - notarize
     - build-linux
     steps:
@@ -395,4 +395,87 @@ jobs:
             --build-arg VERSION=${{steps.tag_name.outputs.tag}}
       - name: Push
         run: |
-          docker push public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}}
+          docker push public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}}
+  update-porter-update-action:
+    name: Update porter-update-action
+    runs-on: ubuntu-latest
+    needs: build-push-docker-cli
+    steps:
+      - name: Get tag name
+        id: tag_name
+        run: |
+          tag=${GITHUB_TAG/refs\/tags\//}
+          echo ::set-output name=tag::$tag
+        env:
+          GITHUB_TAG: ${{ github.ref }}
+      - name: Checkout
+        uses: actions/checkout@v2.3.4
+        with:
+          repository: 'porter-dev/porter-update-action'
+          token: ${{ secrets.GITHUB_TOKEN }}
+      - name: Push new branch with updated CLI
+        run: |
+          git config user.name "Update Bot"
+          git config user.email "support@porter.run"
+
+          git checkout -b "${{steps.tag_name.outputs.tag}}"
+
+          cat >Dockerfile <<EOL
+          FROM public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}}
+
+          COPY entrypoint.sh /action/
+
+          ENTRYPOINT ["/action/entrypoint.sh"]
+          EOL
+
+          git push --set-upstream origin ${{steps.tag_name.outputs.tag}}
+  update-porter-cli-action:
+    name: Update porter-cli-action
+    runs-on: ubuntu-latest
+    needs: build-push-docker-cli
+    steps:
+      - name: Get tag name
+        id: tag_name
+        run: |
+          tag=${GITHUB_TAG/refs\/tags\//}
+          echo ::set-output name=tag::$tag
+        env:
+          GITHUB_TAG: ${{ github.ref }}
+      - name: Checkout
+        uses: actions/checkout@v2.3.4
+        with:
+          repository: 'porter-dev/porter-cli-action'
+          token: ${{ secrets.GITHUB_TOKEN }}
+      - name: Push new branch with updated CLI
+        run: |
+          git config user.name "Update Bot"
+          git config user.email "support@porter.run"
+
+          git checkout -b "${{steps.tag_name.outputs.tag}}"
+
+          cat >Dockerfile <<EOL
+          FROM public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}}
+
+          COPY entrypoint.sh /action/
+
+          ENTRYPOINT ["/action/entrypoint.sh"]
+          EOL
+
+          git push --set-upstream origin ${{steps.tag_name.outputs.tag}}
+  invoke-new-release-tests-workflows:
+    name: Invoke new-release-tests Github workflows
+    runs-on: ubuntu-latest
+    needs: [update-porter-update-action, update-porter-cli-action]
+    steps:
+      - name: Run new-release-tests/.github/workflows/porter_test_docker_production.yml
+        run: |
+          gh workflow run porter_test_docker_production.yml --repo porter-dev/new-release-tests
+        env:
+          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+          GH_ENV: $
+      - name: Run new-release-tests/.github/workflows/porter_test_pack_production.yml
+        run: |
+          gh workflow run porter_test_pack_production.yml --repo porter-dev/new-release-tests
+        env:
+          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+          GH_ENV: $