Skip to content

Commit

Permalink
correct generate deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
heinpa committed Jun 28, 2024
1 parent 2b8a4b1 commit 5d3ed9b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/deploy-component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ jobs:
- name: Prepare deployment
run: bash -c ./service_config/prepare_deployment.sh ./service_config/service_config.json
- name: "Deploy on DINO"
id: generate
if: ${{ env.TARGET == 'DINO' }}
# ssh into server
run: bash -c ./service_config/generate_deployment_script.sh
uses: appleboy/scp-action@master
- uses: appleboy/scp-action@master
id: copy
if: steps.generate.outcome == 'success'
with:
host: ${{ secrets. SERVER_HOST }}
port : ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
source: "./service_config/deploy_components.sh"
target: "/"
uses: appleboy/ssh-action@master
- uses: appleboy/ssh-action@master
if: steps.generate.outcome == 'success'
with:
host: ${{ secrets. SERVER_HOST }}
port : ${{ secrets.SERVER_PORT }}
Expand All @@ -37,10 +40,9 @@ jobs:
script: |
pwd
ls
chmod +x deploy_components.sh &&
./deploy_components.sh || true &&
rm deploy_component.sh
# use MSU to update on SWE
# chmod +x deploy_components.sh &&
# ./deploy_components.sh || true &&
# rm deploy_component.sh
- name: "Deploy on SWE"
if: ${{ env.TARGET == 'SWE' }}
uses: WSE-research/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions service_config/generate_deployment_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
env_files=$ENV_FILES

outfile="service_config/deploy_components.sh"
echo "" > $outfile
echo "#!/bin/bash" > $outfile

file=$1
if [ -z $file ]; then
Expand Down Expand Up @@ -39,7 +39,7 @@ do

echo 'echo "Stopping and removing old container"' >> $outfile
echo 'docker stop $container_name || true && docker rm $container_name || true' >> $outfile
echo 'echo "Pulling image: $DOCKER_IMAGE_NAME' >> $outfile
echo 'echo "Pulling image: $DOCKER_IMAGE_NAME"' >> $outfile
echo 'docker pull "$image:$tag"' >> $outfile
echo 'echo "Starting container: $DOCKER_CONTAINER_NAME"' >> $outfile

Expand Down

0 comments on commit 5d3ed9b

Please sign in to comment.