-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I was trying to write a command to pull docker image onto a single instance and run the container, but it would always failed. I tried both | and < for starting the multi-line and also both with and without \ at the end of the line as well. None of it works.
- name: Deploy to sandbox
uses: oracle-actions/[email protected]
if: ${{ vars.SANDBOX_IN_USE == 'false' }}
env:
OCI_CLI_USER: ${{ secrets.OCI_USER_OCID }}
OCI_CLI_TENANCY: ${{ secrets.OCI_TENANCY_OCID }}
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_FINGERPRINT }}
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_KEY_CONTENT }}
OCI_CLI_REGION: ${{ secrets.OCI_REGION }}
REPO_IMAGE_NAME: ${{ env.REPO_IMAGE_NAME }}:sandbox
with:
command: |
instance-agent command create
--compartment-id ${{ secrets.OCI_COMPARTMENT_OCID }}
--target "{
\"instanceId\":\"${{ secrets.OCI_SANDBOX_INSTANCE_OCID }}\"
}"
--content "{
\"source\":{
\"sourceType\":\"TEXT\",
\"text\":\"
echo '${{ secrets.OCI_TOKEN }}' | docker login ${{ env.OCI_CONTAINER_REGISTRY }} -u ${{ secrets.OCI_REGISTRY_USERNAME }} --password-stdin &&
docker pull ${{ env.REPO_IMAGE_NAME }} &&
docker stop ${{ vars.CONTAINER_NAME }} || true &&
docker rm ${{ vars.CONTAINER_NAME }} || true &&
docker run -d -p 80:80 --name ${{ vars.CONTAINER_NAME }} ${{ env.REPO_IMAGE_NAME }}\"
},
\"output\":{
\"outputType\":\"TEXT\"
}
}"
--timeout-in-seconds 3600
--display-name ${{ github.sha }}-deployment
silent: false
Metadata
Metadata
Assignees
Labels
No labels