Skip to content

Commit

Permalink
Update deps image version in ppserver and ppfull
Browse files Browse the repository at this point in the history
  • Loading branch information
aacic committed Oct 3, 2024
1 parent 09a26c9 commit c9349be
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/CD-publish-deps-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,27 @@ jobs:
cd ..
HASH=$(git rev-parse --short HEAD 2>/dev/null)
docker push ghcr.io/stjude/ppbase:latest
docker push ghcr.io/stjude/ppserver:$TAG
docker push ghcr.io/stjude/ppfull:$TAG
docker push ghcr.io/stjude/ppserver:latest
docker push ghcr.io/stjude/ppfull:latest
./update_deps_version.sh $TAG ./full/Dockerfile
./update_deps_version.sh $TAG ./server/Dockerfile
# docker push ghcr.io/stjude/ppbase:latest
# docker push ghcr.io/stjude/ppserver:$TAG
# docker push ghcr.io/stjude/ppfull:$TAG
# docker push ghcr.io/stjude/ppserver:latest
# docker push ghcr.io/stjude/ppfull:latest

if [[ "$BRANCH" != "master" ]]; then
echo "merging to master"
git fetch --depth=10 origin master:master
git switch master
git merge $BRANCH
fi
# if [[ "$BRANCH" != "master" ]]; then
# echo "merging to master"
# git fetch --depth=10 origin master:master
# git switch master
# git merge $BRANCH
# fi

git config --global user.email "PPTeam@STJUDE.ORG"
git config --global user.name "PPTeam CI"
git add deps/package.json
git commit -m "Update deps version to $TAG"
git stash -a
git pull --rebase
git push origin master
# git config --global user.email "PPTeam@STJUDE.ORG"
# git config --global user.name "PPTeam CI"
# git add deps/package.json
# git commit -m "Update deps version to $TAG"
# git stash -a
# git pull --rebase
# git push origin master

fi
30 changes: 30 additions & 0 deletions container/update_deps_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# call from the container dir
# ./update_deps_version.sh <new_version> <Dockerfile>
# - new_version: the new deps image version to set in the Dockerfile

# Check if both the version and path are passed as arguments
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <new_version> <path_to_dockerfile>"
exit 1
fi

NEW_VERSION=$1
DOCKERFILE=$2

# Check if the Dockerfile exists
if [ ! -f "$DOCKERFILE" ]; then
echo "Dockerfile not found at $DOCKERFILE"
exit 1
fi

# Use sed to find and replace the VERSION in the Dockerfile
sed -i.bak "s/^ARG VERSION=.*/ARG VERSION=$NEW_VERSION/" "$DOCKERFILE"

# Provide feedback to the user
if [ $? -eq 0 ]; then
echo "Dockerfile updated successfully. VERSION is now set to $NEW_VERSION."
else
echo "Failed to update Dockerfile."
fi

0 comments on commit c9349be

Please sign in to comment.