Skip to content

Commit

Permalink
Merge pull request #135 from rtCamp/develop
Browse files Browse the repository at this point in the history
bump v0.12.0
  • Loading branch information
Xieyt authored Mar 22, 2024
2 parents df922c0 + ab23a78 commit eed1be5
Show file tree
Hide file tree
Showing 28 changed files with 758 additions and 657 deletions.
63 changes: 35 additions & 28 deletions Docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
#!/usr/bin/env bash
TAG='v0.10.0'
set -x
ARCH=$(uname -m)

# arm64
if [[ "${ARCH}" == 'arm64' ]]; then
echo "Building arm64 Images with tag arm64-${TAG}"
docker build --push --platform linux/arm64 -t ghcr.io/rtcamp/frappe-manager-nginx:arm64-"${TAG}" nginx/.
docker build --push --platform linux/arm64 -t ghcr.io/rtcamp/frappe-manager-mailhog:arm64-"${TAG}" mailhog/.
docker build --push --platform linux/arm64 -t ghcr.io/rtcamp/frappe-manager-frappe:arm64-"${TAG}" frappe/.
IMAGE_NAME_PREFIX="ghcr.io/rtcamp/frappe-manager"
COMMAND='docker build --push'

OTHER_ARCH="x86_64"
if [[ "${ARCH}" == "x86_64" ]]; then
ARCH="amd64"
OTHER_ARCH="arm64"
fi

#amd64
if [[ "${ARCH}" == 'x86_64' ]]; then
echo "Building amd64 Images with tag amd64-${TAG}"
docker build --push --platform linux/amd64 -t ghcr.io/rtcamp/frappe-manager-nginx:amd64-"${TAG}" nginx/.
docker build --push --platform linux/amd64 -t ghcr.io/rtcamp/frappe-manager-mailhog:amd64-"${TAG}" mailhog/.
docker build --push --platform linux/amd64 -t ghcr.io/rtcamp/frappe-manager-frappe:amd64-"${TAG}" frappe/.
# images=$(jq -rc '. | keys[] ' images-tag.json || exit 0)

echo "Combining arm64 and amd64 tags.."
rm -rf ~/.docker/manifests
images='frappe'

docker manifest create ghcr.io/rtcamp/frappe-manager-nginx:"$TAG" \
--amend ghcr.io/rtcamp/frappe-manager-nginx:amd64-"$TAG" \
--amend ghcr.io/rtcamp/frappe-manager-nginx:arm64-"$TAG"
for image in ${images}; do
IMAGE_TAG=$(jq -rc ".${image}" images-tag.json || exit 0)
if [[ "${IMAGE_TAG:-}" ]]; then

docker manifest push ghcr.io/rtcamp/frappe-manager-nginx:"$TAG"
if [[ "${ARCH}" == 'arm64' ]]; then
COMMAND+=" --provenance false"
fi

docker manifest create ghcr.io/rtcamp/frappe-manager-mailhog:"$TAG" \
--amend ghcr.io/rtcamp/frappe-manager-mailhog:amd64-"$TAG" \
--amend ghcr.io/rtcamp/frappe-manager-mailhog:arm64-"$TAG"
IMAGE_NAME="${IMAGE_NAME_PREFIX}-${image}"
IMAGE_NAME_WITH_TAG="${IMAGE_NAME}:${ARCH}-${IMAGE_TAG}"
CONTEXT_DIR="${image}/."

docker manifest push ghcr.io/rtcamp/frappe-manager-mailhog:"$TAG"
echo "Building ${IMAGE_NAME_WITH_TAG}"

docker manifest create ghcr.io/rtcamp/frappe-manager-frappe:"$TAG" \
--amend ghcr.io/rtcamp/frappe-manager-frappe:amd64-"$TAG" \
--amend ghcr.io/rtcamp/frappe-manager-frappe:arm64-"$TAG"
COMMAND+=" --platform linux/${ARCH} -t ${IMAGE_NAME_WITH_TAG} $CONTEXT_DIR"

docker manifest push ghcr.io/rtcamp/frappe-manager-frappe:"$TAG"
fi
eval "${COMMAND}"
STATUS="$?"


if [[ "${STATUS}" -eq 0 ]]; then
echo "Combining"
rm -rf ~/.docker/manifests
docker manifest create "${IMAGE_NAME}:${IMAGE_TAG}" \
--amend "${IMAGE_NAME_WITH_TAG}" \
--amend "${IMAGE_NAME}:${OTHER_ARCH}-${IMAGE_TAG}"
fi

fi
done
10 changes: 4 additions & 6 deletions Docker/frappe/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,19 @@ mkdir -p /opt/user/conf.d
chown -R "$USERID":"$USERGROUP" /opt

if [[ ! -d "/workspace/.oh-my-zsh" ]]; then
cp -r /opt/user/.oh-my-zsh /workspace/.oh-my-zsh
cp -pr /opt/user/.oh-my-zsh /workspace/
fi

if [[ ! -f "/workspace/.zshrc" ]]; then
cat /opt/user/.zshrc > /workspace/.zshrc
cp -p /opt/user/.zshrc /workspace/
fi

if [[ ! -f "/workspace/.profile" ]]; then
cat /opt/user/.profile > /workspace/.profile
cp -p /opt/user/.profile /workspace/
fi

chown "$USERID":"$USERGROUP" /workspace /workspace/frappe-bench

ls -p /workspace | grep -v 'frappe-bench/' | xargs -I{} chown -R "$USERID":"$USERGROUP" /workspace{}

ls -pA /workspace | xargs -I{} chown -R "$USERID":"$USERGROUP" /workspace/{} &

if [ "$#" -gt 0 ]; then
gosu "$USERID":"$USERGROUP" "/scripts/$@"
Expand Down
6 changes: 3 additions & 3 deletions Docker/frappe/helper-function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,18 @@ install_apps() {

apps_txt=$(mktemp)

apps_list=$(ls -1 apps|| exit 0)
apps_list=$(ls -1 apps || exit 0)

for app_name in $(echo "$apps_list"); do
get_app_name "$app_name"
echo "$APP_NAME" >> "$apps_txt"
done

cat "$apps_txt" > sites/apps.txt
cp "$apps_txt" sites/apps.txt

# create apps_json
for app_name in $(cat "$apps_txt" | grep -v 'frappe' || exit 0); do
apps_json=$(echo "$apps_json" | jq -rc --arg app_name "${APP_NAME}" '.+ [$app_name]')
apps_json=$(echo "$apps_json" | jq -rc --arg app_name "${app_name}" '.+ [$app_name]')
done

update_common_site_config install_apps "$apps_json" 'true'
Expand Down
2 changes: 1 addition & 1 deletion Docker/images-tag.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"frappe": "v0.11.0",
"frappe": "v0.12.0",
"nginx": "v0.10.0",
"mailhog": "v0.8.3"
}
4 changes: 3 additions & 1 deletion frappe_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
CLI_DIR = Path.home() / "frappe"
CLI_METADATA_PATH = CLI_DIR / ".fm.toml"
CLI_SITES_ARCHIVE = CLI_DIR / "archived"
CLI_LOG_DIRECTORY = CLI_DIR / 'logs'
CLI_SITES_DIRECTORY = CLI_DIR / 'sites'


default_extension = [
DEFAULT_EXTENSIONS = [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-python.python",
Expand Down
Loading

0 comments on commit eed1be5

Please sign in to comment.