Skip to content

Commit

Permalink
fix(docker-compose): push ot
Browse files Browse the repository at this point in the history
  • Loading branch information
bas-kirill committed Aug 26, 2024
1 parent 8617b11 commit aec5419
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ jobs:
- name: Deploy at home lab
run: ./tools/scripts/deploy/deployDev.sh myshx dev
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
SSH_HOST: ${{ secrets.DEV_SSH_HOST }}
SSH_PORT: ${{ secrets.DEV_SSH_PORT }}
SSH_USER: ${{ secrets.DEV_SSH_USER }}
Expand Down
2 changes: 1 addition & 1 deletion tools/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
- muse

muse-client-dev:
image: muse-client-dev:${MUST_CLIENT_DEV_TAG-latest}
image: muse-client-dev:${MUSE_CLIENT_DEV_TAG-latest}
container_name: muse-client-dev
ports:
- ${CLIENT_DEV_PORT}:3000
Expand Down
2 changes: 1 addition & 1 deletion tools/docker/env/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ POSTGRES_PORT=5555
POSTGRES_USER=muse
POSTGRES_PASSWORD=muse
POSTGRES_DB=muse
POSTGRES_DSN=jdbc:postgresql://muse-postgres:5432/muse
POSTGRES_DSN=jdbc:postgresql://muse-postgres:5555/muse
17 changes: 12 additions & 5 deletions tools/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
rootDir="$currentDir/../../"
gitCommitSha="$(git rev-parse --short HEAD)"

if [ -z "$DOCKER_HUB_TOKEN" ]; then
echo "Error: The required environment variable 'DOCKER_HUB_TOKEN' is not set."
exit 1
fi

if [ -z "$SSH_HOST" ]; then
echo "Error: The required environment variable 'SSH_HOST' is not set."
exit 1
Expand Down Expand Up @@ -60,10 +65,16 @@ dockerTag="$stage-$gitCommitSha"
(cd "$rootDir" && exec ./tools/scripts/pushImage.sh "$dockerRepository" "muse-client" "$dockerTag")

sshpass -p "$SSH_PASS" ssh -p "$SSH_PORT" "$SSH_USER@$SSH_HOST" << EOF
export dockerRepository=$dockerRepository
echo \$dockerRepository
export stage=$stage
echo \$stage
export dockerTag=$dockerTag
echo \$dockerTag
export DOCKER_HUB_TOKEN=$DOCKER_HUB_TOKEN
echo \$DOCKER_HUB_TOKEN
docker login -u $dockerRepository -p $DOCKER_HUB_TOKEN
cd /tmp
sudo rm -rf ./muse-project
Expand All @@ -72,11 +83,7 @@ cd ./muse-project
./tools/scripts/clean.sh $stage
MUSE_SERVER_TAG="$dockerTag"
MUSE_CLIENT_TAG="$dockerTag"
MUST_CLIENT_DEV_TAG="$dockerTag"
docker compose \
MUSE_SERVER_TAG="$dockerTag" MUSE_CLIENT_TAG="$dockerTag" MUSE_CLIENT_DEV_TAG="$dockerTag" docker compose \
-f ./tools/docker/docker-compose.yml \
--env-file ./tools/docker/env/$stage.env \
--project-name=muse-$stage \
Expand Down

0 comments on commit aec5419

Please sign in to comment.