Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple lines in devcontainer action #4192

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/actions/devcontainer_run_command/action.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guybartal , @tamirkamara has said he will review this prior to being merged. Please await his review! Thanks.

Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ runs:
- name: Run command in DevContainer
shell: bash
run: |
# Write command to a temporary script file with lowercase name
guybartal marked this conversation as resolved.
Show resolved Hide resolved
SCRIPT_FILE=$(mktemp)
mv "${SCRIPT_FILE}" "${SCRIPT_FILE,,}"
SCRIPT_FILE="${SCRIPT_FILE,,}"
cat << 'EOF' > "${SCRIPT_FILE}"
${{ inputs.COMMAND }}
EOF
chmod +x "${SCRIPT_FILE}"

docker run --rm --mount \
"type=bind,src=${{ github.workspace }},dst=/workspaces/tre" \
-v /var/run/docker.sock:/var/run/docker.sock \
Expand Down Expand Up @@ -246,4 +255,5 @@ runs:
-e TF_VAR_app_gateway_sku=${{ inputs.APP_GATEWAY_SKU }} \
-e E2E_TESTS_NUMBER_PROCESSES="${{ inputs.E2E_TESTS_NUMBER_PROCESSES }}" \
'${{ inputs.CI_CACHE_ACR_NAME }}${{ env.ACR_DOMAIN_SUFFIX }}/tredev:${{ inputs.DEVCONTAINER_TAG }}' \
bash -c "${{ inputs.COMMAND }}"
bash -c "./command.sh"
rm "${SCRIPT_FILE}"
10 changes: 5 additions & 5 deletions .github/workflows/deploy_tre_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ jobs:
uses: ./.github/actions/devcontainer_run_command
with:
# Although porter publish will build automatically, our makefile build target includes logic that should run
COMMAND: >-
COMMAND: |
for i in {1..3}; do make bundle-build bundle-publish DIR=${{ matrix.BUNDLE_DIR }}
&& ec=0 && break || ec=\$? && sleep 30; done; (exit \$ec)
DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }}
Expand Down Expand Up @@ -470,7 +470,7 @@ jobs:
uses: ./.github/actions/devcontainer_run_command
with:
# Although porter publish will build automatically, our makefile build target includes logic that should run
COMMAND: >-
COMMAND: |
for i in {1..3}; do make bundle-build bundle-publish DIR=${{ matrix.BUNDLE_DIR }}
&& ec=0 && break || ec=\$? && sleep 30; done; (exit \$ec)
DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }}
Expand Down Expand Up @@ -514,7 +514,7 @@ jobs:
- name: Register bundle
uses: ./.github/actions/devcontainer_run_command
with:
COMMAND: >-
COMMAND: |
for i in {1..3}; do make bundle-register DIR=${{ matrix.BUNDLE_DIR }}
&& ec=0 && break || ec=\$? && sleep 10; done; (exit \$ec)
DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }}
Expand Down Expand Up @@ -574,7 +574,7 @@ jobs:
- name: Register bundle
uses: ./.github/actions/devcontainer_run_command
with:
COMMAND: >-
COMMAND: |
for i in {1..3}; do make bundle-register DIR=${{ matrix.BUNDLE_DIR }}
&& ec=0 && break || ec=\$? && sleep 10; done; (exit \$ec)
DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }}
Expand Down Expand Up @@ -623,7 +623,7 @@ jobs:
- name: Register bundle
uses: ./.github/actions/devcontainer_run_command
with:
COMMAND: >-
COMMAND: |
for i in {1..3}; do make bundle-register DIR=${{ matrix.BUNDLE_DIR }}
&& ec=0 && break || ec=\$? && sleep 10; done; (exit \$ec)
DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }}
Expand Down
Loading