1- image : ubuntu:latest
1+ image : <your-image>
22
33# Define global variables
44variables :
5- ENVIRONMENT : " staging"
6- WORKFLOW_REPO_URL :
" https://[email protected] /stack-spot/workflow-stackspot-actions-runtime-selfhosted.git" 5+ WORKFLOW_REPO_URL : " https://@github.com/stack-spot/workflow-stackspot-actions-runtime-selfhosted.git"
76
87stages :
98 - run_stackspot
@@ -27,6 +26,15 @@ before_script:
2726stk :
2827 stage : run_stackspot
2928 script :
29+ # You can use this clone directly on the workflow as implemented here, or,
30+ # you checkout this repository locally and publish in your stackspot studio and share it to your app workspace
31+ # in this way you will need to use the action qualifier name (<studio>/<stack>@<version>/<action>) when running the action in the end of this script
32+ # Clone the workflow repository
33+ - git clone $WORKFLOW_REPO_URL
34+ - cd workflow-stackspot-actions-runtime-selfhosted
35+ - run_action_path=$(pwd)
36+ - cd ..
37+
3038 # Export environment variables for StackSpot
3139 - export INPUTS_CLIENT_ID=$STK_CLIENT_ID
3240 - export INPUTS_CLIENT_KEY=$STK_CLIENT_SECRET
4048 - export INPUTS_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
4149 - export INPUTS_AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN
4250 - export INPUTS_ENVIRONMENT=$ENVIRONMENT
51+ - export INPUTS_REPOSITORY_NAME=$CI_PROJECT_NAME
52+ - export INPUTS_VERSION_TAG=$CI_JOB_ID # Change this logic as you wish
4353
4454 # Authenticate with StackSpot
4555 - $STK login --client-id $INPUTS_CLIENT_ID --client-key $INPUTS_CLIENT_KEY --realm $INPUTS_CLIENT_REALM
4656
4757 # Use the specified workspace
4858 - $STK use workspace $STK_WORKSPACE
4959
50- # Clone the workflow repository
51- - git clone $WORKFLOW_REPO_URL
52- - cd workflow-stackspot-actions-runtime-selfhosted
53- - run_action_path=$(pwd)
54- - cd ..
55-
5660 # Run the StackSpot action
57- - $STK run action $run_action_path --workflow_type deploy --version_tag $CI_JOB_ID --repository_name $CI_PROJECT_NAME -- non-interactive
61+ - $STK run action $run_action_path --workflow_type deploy --non-interactive
0 commit comments