Fix installs
This commit is contained in:
parent
ffbe1fc1f8
commit
cba7746b5d
|
@ -105,3 +105,4 @@ budibase-component
|
|||
budibase-datasource
|
||||
|
||||
*.iml
|
||||
packageNames.txt
|
||||
|
|
|
@ -10,12 +10,15 @@ COPY package.json .
|
|||
COPY yarn.lock .
|
||||
COPY lerna.json .
|
||||
COPY .yarnrc .
|
||||
COPY packageNames.txt .
|
||||
|
||||
COPY packages/server/package.json packages/server/package.json
|
||||
COPY packages/worker/package.json packages/worker/package.json
|
||||
|
||||
|
||||
COPY scripts/removeWorkspaceDependencies.sh scripts/removeWorkspaceDependencies.sh
|
||||
RUN ./scripts/removeWorkspaceDependencies.sh package.json
|
||||
RUN ./scripts/removeWorkspaceDependencies.sh packages/server/package.json
|
||||
RUN ./scripts/removeWorkspaceDependencies.sh packages/worker/package.json
|
||||
RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
|
||||
RUN ./scripts/removeWorkspaceDependencies.sh
|
||||
|
||||
|
||||
# We will never want to sync pro, but the script is still required
|
||||
|
@ -28,8 +31,6 @@ COPY packages/server/dist packages/server/dist
|
|||
COPY packages/server/client packages/server/client
|
||||
COPY packages/worker/dist packages/worker/dist
|
||||
|
||||
RUN rm -rf scripts/
|
||||
|
||||
|
||||
FROM budibase/couchdb as runner
|
||||
ARG TARGETARCH
|
||||
|
@ -89,7 +90,16 @@ COPY hosting/single/ssh/sshd_config /etc/
|
|||
COPY hosting/single/ssh/ssh_setup.sh /tmp
|
||||
RUN /build-target-paths.sh
|
||||
|
||||
COPY --from=build /app /app
|
||||
|
||||
# setup letsencrypt certificate
|
||||
RUN apt-get install -y certbot python3-certbot-nginx
|
||||
COPY hosting/letsencrypt /app/letsencrypt
|
||||
RUN chmod +x /app/letsencrypt/certificate-request.sh /app/letsencrypt/certificate-renew.sh
|
||||
|
||||
COPY --from=build /app/node_modules /node_modules
|
||||
COPY --from=build /app/package.json /package.json
|
||||
COPY --from=build /app/packages/server /app
|
||||
COPY --from=build /app/packages/worker /worker
|
||||
|
||||
|
||||
EXPOSE 80
|
||||
|
@ -98,10 +108,6 @@ EXPOSE 443
|
|||
EXPOSE 2222
|
||||
VOLUME /data
|
||||
|
||||
# setup letsencrypt certificate
|
||||
RUN apt-get install -y certbot python3-certbot-nginx
|
||||
COPY hosting/letsencrypt /app/letsencrypt
|
||||
RUN chmod +x /app/letsencrypt/certificate-request.sh /app/letsencrypt/certificate-renew.sh
|
||||
# Remove cached files
|
||||
RUN rm -rf \
|
||||
/root/.cache \
|
||||
|
|
|
@ -70,8 +70,8 @@ fi
|
|||
|
||||
# Read in the .env file and export the variables
|
||||
for LINE in $(cat ${DATA_DIR}/.env); do export $LINE; done
|
||||
ln -s ${DATA_DIR}/.env /app/server/.env
|
||||
ln -s ${DATA_DIR}/.env /app/worker/.env
|
||||
ln -s ${DATA_DIR}/.env /app/.env
|
||||
ln -s ${DATA_DIR}/.env /worker/.env
|
||||
# make these directories in runner, incase of mount
|
||||
mkdir -p ${DATA_DIR}/minio
|
||||
chown -R couchdb:couchdb ${DATA_DIR}/couch
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash
|
||||
yarn build --scope @budibase/server --scope @budibase/worker
|
||||
./scripts/generatePackageNamesFile.sh
|
||||
docker build -f hosting/single/Dockerfile -t budibase:latest .
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
workspace_info=$(yarn --silent workspaces info)
|
||||
|
||||
package_names_file="packageNames.txt"
|
||||
|
||||
rm -f $package_names_file
|
||||
|
||||
|
||||
packages=$(echo "$workspace_info" | jq -r 'keys[]')
|
||||
echo "$packages" > $package_names_file
|
|
@ -1,22 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
package_json=$(cat "$1")
|
||||
|
||||
root_package_json=$(cat "package.json")
|
||||
|
||||
process_package() {
|
||||
local pkg="$1"
|
||||
local package_json=$(cat "$pkg/package.json")
|
||||
local has_changes=false
|
||||
|
||||
for workspace_package in $(echo "$root_package_json" | jq -r '.workspaces.packages[]' ); do
|
||||
package_name=$(cat "$workspace_package/package.json" | jq -r '.name')
|
||||
has_changes=false
|
||||
|
||||
|
||||
if echo "$package_json" | jq -e --arg package_name "$package_name" '.dependencies | has($package_name)' > /dev/null; then
|
||||
|
||||
package_json=$(echo "$package_json" | jq "del(.dependencies[\"$package_name\"])")
|
||||
has_changes=true
|
||||
fi
|
||||
while IFS= read -r package_name; do
|
||||
if echo "$package_json" | jq -e --arg package_name "$package_name" '.dependencies | has($package_name)' > /dev/null; then
|
||||
package_json=$(echo "$package_json" | jq "del(.dependencies[\"$package_name\"])")
|
||||
has_changes=true
|
||||
fi
|
||||
done < "packageNames.txt"
|
||||
|
||||
if [ "$has_changes" = true ]; then
|
||||
echo "$package_json" > "$1"
|
||||
echo "$package_json" > "$1/package.json"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
for pkg in $(echo "$root_package_json" | jq -r '.workspaces.packages[]' ); do
|
||||
if [[ "$pkg" == *"*"* ]]; then
|
||||
# Use find to iterate through immediate subdirectories
|
||||
find "$pkg" -maxdepth 1 -type d -print | while read -r workspace_package; do
|
||||
process_package "$workspace_package"
|
||||
done
|
||||
else
|
||||
process_package "$pkg"
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue