Compare commits

..
Author SHA1 Message Date
Michel 2f5c30a000 v2.2.0-rc.1 2023-11-20 19:13:40 +01:00
Michel 146dae5d12 v2.2.0-beta.9 2023-11-06 23:24:22 +01:00
Michel 0133c453d2 v2.2.0-beta.8-rebuild 2023-11-06 23:24:15 +01:00
Michel f667e4abdf v2.2.0-beta.8 2023-11-06 23:23:23 +01:00
Michel 8d21e941b2 v2.2.0-beta.7 2023-11-06 23:22:26 +01:00
Michel f167b102d2 v2.2.0-beta.6 2023-11-06 23:21:36 +01:00
Michel 96c7efca99 v2.2.0-beta.5 2023-11-06 23:20:39 +01:00
Michel ce84d2f999 v2.2.0-beta.4 2023-11-06 23:19:48 +01:00
Michel 5be6a1559c v2.2.0-beta.3 2023-11-06 23:18:56 +01:00
Michel f0502ce017 v2.2.0-beta.2 2023-11-06 23:18:05 +01:00
Michel 29aa3417aa v2.2.0-beta.1 2023-11-06 23:17:13 +01:00
Michel d907c21f91 v2.1.1 2023-11-06 23:16:15 +01:00
Michel 62186ceeda v2.1.0 2023-11-06 23:15:17 +01:00
Michel 9cc5f8d447 v2.1.0-beta.4 2023-11-06 23:14:25 +01:00
Michel 7a5eec0701 v2.1.0-beta.3 2023-11-06 23:13:33 +01:00
Michel afe73ec179 v2.1.0-beta.2 2023-11-06 23:12:40 +01:00
Michel df9744c199 v2.1.0-beta.1 2023-11-06 23:11:48 +01:00
Michel c101479a7b v2.0.1 2023-11-06 23:10:51 +01:00
Michel 2bb4de67f4 v2.0.0 2023-11-06 23:09:53 +01:00
Michel d8ac4f5c4b v2.0.0-rc.1 2023-11-06 23:08:59 +01:00
Michel 5f009bec97 v2.0.0-beta.12 2023-11-06 23:08:22 +01:00
Michel 321811e74b v2.0.0-beta.11 2023-11-06 23:07:42 +01:00
Michel c6f9bbd721 v2.0.0-beta.10 2023-11-06 23:07:04 +01:00
Michel 0f17b95fec v2.0.0-beta.9 2023-11-06 23:06:26 +01:00
Michel d47f512872 v2.0.0-beta.8 2023-11-06 23:05:53 +01:00
Michel ce1a6c87d3 v2.0.0-beta.7 2023-11-06 23:05:17 +01:00
Michel c4cd92651a v2.0.0-beta.6 2023-11-06 23:04:34 +01:00
Michel b910c7e2c5 v2.0.0-beta.5 2023-11-06 23:04:04 +01:00
Michel 259f9a7e37 v2.0.0-beta.4 2023-11-06 23:03:38 +01:00
Michel bfcd2821d3 v2.0.0-beta.3 2023-11-06 23:03:11 +01:00
Michel 9fef71a218 v2.0.0-beta.2 2023-11-06 23:02:46 +01:00
Michel 61456d7e2c v2.0.0-beta.1 2023-11-06 23:02:16 +01:00
Michel e28bd5978c v1.2.0-beta.1 2023-11-06 23:01:50 +01:00
Michel dafc289498 v1.1.0 2023-11-06 23:01:19 +01:00
Michel 7a0f605d70 v1.1.0-rc.1 2023-11-06 23:00:48 +01:00
Michel c7bbe71c0e v1.1.0-beta.6 2023-11-06 23:00:20 +01:00
Michel 9d4e04ec4a v1.1.0-beta.5 2023-11-06 22:59:55 +01:00
Michel 37ba6485f8 v1.1.0-beta.4 2023-11-06 22:59:19 +01:00
Michel 18938b242b v1.1.0-beta.3 2023-11-06 22:58:47 +01:00
4 changed files with 133 additions and 6 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
# Arguments
ARG NODE_TAG=12.18.3
ARG PYBRICKSCODE_TAG=v1.1.0-beta.2
ARG NODE_TAG=18.15.0
ARG PYBRICKSCODE_TAG=v2.2.0-rc.1
# Build stage
FROM node:${NODE_TAG} AS build-stage
ARG PYBRICKSCODE_TAG
WORKDIR /app
RUN git clone https://github.com/pybricks/pybricks-code -b "${PYBRICKSCODE_TAG}" /app
RUN git clone https://github.com/pybricks/pybricks-code.git -b "${PYBRICKSCODE_TAG}" /app
RUN cd /app
RUN yarn install
RUN yarn build
+2 -2
View File
@@ -6,8 +6,8 @@ services:
context: .
dockerfile: Dockerfile
args:
NODE_TAG: ${NODE_TAG:-12.18.3}
PYBRICKSCODE_TAG: ${PYBRICKSCODE_TAG:-v1.1.0-beta.2}
NODE_TAG: ${NODE_TAG:-18.15.0}
PYBRICKSCODE_TAG: ${PYBRICKSCODE_TAG:-v2.2.0-rc.1}
restart: ${RESTART:-unless-stopped}
healthcheck:
test: curl -f http://localhost:80/ || exit 1
+1 -1
View File
@@ -2,7 +2,7 @@ services:
# Pybricks Code
pybrickscode:
container_name: ${PYBRICKSCODE_CONTAINER_NAME:-PybricksCode}
image: axchrono/pybrickscode:${PYBRICKSCODE_TAG:-v1.1.0-beta.2}
image: axchrono/pybrickscode:${PYBRICKSCODE_TAG:-v2.2.0-rc.1}
restart: ${RESTART:-unless-stopped}
healthcheck:
test: curl -f http://localhost:80/ || exit 1
Executable
+127
View File
@@ -0,0 +1,127 @@
#!/bin/bash
# Run this script to update this repository and get in sync with the latest Pybricks Code tag.
# Files to update automatically with the new tags.
FILES_TO_UPDATE=(
"Dockerfile"
"docker-compose.yml"
"docker-compose.build.yml"
)
# Save the current tags of the docker repository in a variable.
PYBRICKSCODE_TAG_OLD=$(cat Dockerfile | grep -o 'ARG PYBRICKSCODE_TAG=[^ ,]\+' | sed s/"ARG PYBRICKSCODE_TAG="//)
NODEJS_TAG_OLD=$(cat Dockerfile | grep -o 'ARG NODE_TAG=[^ ,]\+' | sed s/"ARG NODE_TAG="//)
# Download the latest version of Pybricks Code in a temporary folder.
git clone https://github.com/pybricks/pybricks-code.git ./.temp/pybricks-code
# Save the current tags of the program repository in a variable.
cd ./.temp/pybricks-code
PYBRICKSCODE_TAG_NEW=$(git tag --sort=creatordate | grep -C1 -Fx $PYBRICKSCODE_TAG_OLD | tail -1)
PYBRICKSCODE_TAG_NEWER=$(git tag --sort=creatordate | grep -A2 -Fx $PYBRICKSCODE_TAG_OLD | tail -1)
PYBRICKSCODE_TAG_LATEST=$(git tag --sort=creatordate | tail -1)
# Only reason the new tag will be empty is when the old tag is not in the git tag list.
# This can also be exploited to start fresh and create every a container for every tag.
if [[ $PYBRICKSCODE_TAG_NEW == '' ]]; then
PYBRICKSCODE_TAG_NEW=$(git tag --sort=creatordate | head -1)
PYBRICKSCODE_TAG_NEWER=$(git tag --sort=creatordate | head -2)
fi
git checkout $PYBRICKSCODE_TAG_NEW
NODEJS_TAG_NEW=$(cat .tool-versions | grep -o 'nodejs [^ ,]\+' | sed s/"nodejs "//)
cd ..
cd ..
echo ""
# Remove the temporary files.
rm -rf ./.temp
# Echo the old and new tags to the cosole.
echo "Old Pybricks Code tag: $PYBRICKSCODE_TAG_OLD"
echo "New Pybricks Code tag: $PYBRICKSCODE_TAG_NEW"
echo "Old NodeJS tag: $NODEJS_TAG_OLD"
echo "New NodeJS tag: $NODEJS_TAG_NEW"
echo ""
# Check if there is a newer tag that the tag we current update to.
EXTRA_UPDATE_RUN=false
if [[ "$PYBRICKSCODE_TAG_NEW" != "$PYBRICKSCODE_TAG_LATEST" ]]; then
EXTRA_UPDATE_RUN=true
echo "$PYBRICKSCODE_TAG_LATEST is the latest version but in this run the repository will be updated to $PYBRICKSCODE_TAG_NEW."
echo "After this update run the update again to update to $PYBRICKSCODE_TAG_NEWER"
echo ""
fi
# If no update is needed, exit the script.
if [[ "$PYBRICKSCODE_TAG_OLD" == "$PYBRICKSCODE_TAG_NEW" ]]; then
echo "Docker tag and program tag are the same. No update needed"
# Wait for the user to exit the script.
read -p "Press the [Enter] key to exit..."
exit 0
fi
# If an update is possible wait for the user to continue.
if [[ $1 != auto_update ]]; then
echo "Does the above look OK?"
read -p "Press the [Enter] key to continue..."
fi
# Update the tags in the different files.
for i in "${!FILES_TO_UPDATE[@]}"; do
sed -i "s/$PYBRICKSCODE_TAG_OLD/$PYBRICKSCODE_TAG_NEW/g" ${FILES_TO_UPDATE[i]}
sed -i "s/$NODEJS_TAG_OLD/$NODEJS_TAG_NEW/g" ${FILES_TO_UPDATE[i]}
done
# Commit the new update to the git repository and set the new tag.
git add .
git commit -m $PYBRICKSCODE_TAG_NEW
git tag $PYBRICKSCODE_TAG_NEW
# Build the Dockerfile and push to DokcerHub.
# Check if the new tag is a beta tag and set the docker tags acordingly.
if [[ "$PYBRICKSCODE_TAG_NEW" == *"beta"* ]]; then
docker build --rm -f "Dockerfile" \
-t axchrono/pybrickscode:$PYBRICKSCODE_TAG_NEW \
-t axchrono/pybrickscode:latest-beta \
"."
docker image push axchrono/pybrickscode:$PYBRICKSCODE_TAG_NEW
docker image push axchrono/pybrickscode:latest-beta
# Check if the new tag is a release candidate tag and set the docker tags acordingly.
elif [[ "$PYBRICKSCODE_TAG_NEW" == *"rc"* ]]; then
docker build --rm -f "Dockerfile" \
-t axchrono/pybrickscode:$PYBRICKSCODE_TAG_NEW \
-t axchrono/pybrickscode:latest-beta \
-t axchrono/pybrickscode:latest-rc \
"."
docker image push axchrono/pybrickscode:$PYBRICKSCODE_TAG_NEW
docker image push axchrono/pybrickscode:latest-beta
docker image push axchrono/pybrickscode:latest-rc
# If the new tag is not a beta or release candidate asume that it is a stable release.
else
docker build --rm -f "Dockerfile" \
-t axchrono/pybrickscode:$PYBRICKSCODE_TAG_NEW \
-t axchrono/pybrickscode:latest-beta \
-t axchrono/pybrickscode:latest-rc \
-t axchrono/pybrickscode:latest \
"."
docker image push axchrono/pybrickscode:$PYBRICKSCODE_TAG_NEW
docker image push axchrono/pybrickscode:latest-beta
docker image push axchrono/pybrickscode:latest-rc
docker image push axchrono/pybrickscode:latest
fi
# Run if there is still an update left to do.
if [[ "$EXTRA_UPDATE_RUN" == true ]]; then
echo ""
if [[ $1 != auto_update ]]; then
read -p "Press the [Enter] key to do a run for $PYBRICKSCODE_TAG_NEWER..."
fi
clear
./update.sh $1
exit 0
fi
# Wait for the user to exit the script.
read -p "Press the [Enter] key to exit..."
exit 0