diff --git a/.dockerignore b/.dockerignore index eb37ba7c54..491470c231 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,12 +1,31 @@ -Dockerfile +# Jenkins and Build Environment Jenkinsfile +Dockerfile +buildkitd.toml +docker-bake*.hcl +docker-compose.ci.yml +docker-compose.override.yml +docker-compose.yml +env.hcl +milano.*.yml +mkdocs.yml +portal.yml +renovate.json +.dockercompose.state.json +.dockerignore +.git +.github .gitignore -.overcommit.yml -Jenkinsfile -milano.* +.sops.yaml +.env +log/*.yml +log/*.json +build-metadata*.json renovate.json playbook/node_modules playbook/tmp playbook-docs/node_modules playbook-docs/tmp *.dec.* +.overcommit.yml +node_modules diff --git a/Dockerfile b/Dockerfile index 3f6a1bb0be..c1a82b7187 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# syntax = docker/dockerfile:1.4.2 +# syntax = docker/dockerfile:1.5.2 FROM phusion/passenger-customizable:1.0.19 AS base @@ -10,6 +10,7 @@ RUN bash -lc 'rvm remove all --force && rvm install ruby-3.1.2 && rvm --default RUN /pd_build/ruby_support/install_ruby_utils.sh RUN /pd_build/ruby_support/finalize.sh +ENV BUNDLE_TO /usr/local/rvm/gems ENV NODE_OPTIONS "--max_old_space_size=8192" ENV NVM_VERSION v0.33.8 ENV NODE_VERSION v14.18.1 @@ -29,27 +30,54 @@ RUN apt-get update -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN bundle config --global silence_root_warning 1 + +# Setup service +COPY --link playbook-website/services/puma.sh /home/app/src/playbook-website/services/puma.sh +RUN chmod +x /home/app/src/playbook-website/services/puma.sh +RUN mkdir /etc/service/puma && ln -s /home/app/src/playbook-website/services/puma.sh /etc/service/puma/run WORKDIR /home/app/src -# Build Library -COPY playbook-website/package.json playbook-website/ -COPY playbook/package.json playbook/ -COPY package.json .rubocop.yml .eslintrc.json .yarnrc.yml yarn.lock .npmrc ./ -COPY .yarn ./.yarn -RUN --mount=type=secret,id=yarnenv,required env $(cat /run/secrets/yarnenv | xargs) yarn install -RUN curl https://github.com/sass/node-sass/releases/download/v4.13.0/linux-x64-64_binding.node -o node_modules/node-sass/vendor/linux-x64-64_binding.node +FROM base as rubypackages +RUN --mount=type=bind,target=/tmp/src \ + cd /tmp/src/ && \ + find . -mindepth 0 -maxdepth 6 \( -name 'Gemfile' -o -name 'Gemfile.lock' -o -name '*.gemspec' \) -exec cp --parents "{}" /home/app/src \; + +FROM base as jspackages -COPY --chown=app:app playbook /home/app/src/playbook +RUN --mount=type=bind,target=/tmp/src \ + cd /tmp/src/ && \ + find . -mindepth 0 -maxdepth 6 \( -name 'package.json' -o -name 'yarn.lock' -o -name '.npmrc' \) -exec cp --parents "{}" /home/app/src \; + +FROM base as rubydeps # Bundle website -COPY --chown=app:app playbook-website /home/app/src/playbook-website -RUN cd playbook-website && bundle install --frozen +COPY --link --chown=9999:9999 --from=rubypackages /home/app/src /home/app/src +COPY --link --chown=9999:9999 playbook/lib/playbook /home/app/src/playbook/lib/playbook +RUN cd playbook-website && bundle install -# Setup service -RUN chmod +x playbook-website/services/*.sh -RUN mkdir /etc/service/puma && ln -s /home/app/src/playbook-website/services/puma.sh /etc/service/puma/run +FROM base as jsdeps -FROM base AS prod +COPY --link package.json .rubocop.yml .eslintrc.json .yarnrc.yml yarn.lock .npmrc ./ +COPY --link .yarn ./.yarn +COPY --link --chown=9999:9999 --from=jspackages /home/app/src /home/app/src +# Build Library +RUN --mount=type=secret,id=yarnenv,required \ + --mount=id=yarncache,type=cache,target=/home/app/.cache/yarn,uid=9999,gid=9999,sharing=locked \ + env $(cat /run/secrets/yarnenv | xargs) yarn install --frozen-lockfile +RUN curl https://github.com/sass/node-sass/releases/download/v4.13.0/linux-x64-64_binding.node -o node_modules/node-sass/vendor/linux-x64-64_binding.node + +FROM jsdeps AS release +COPY --from=rubydeps --link $BUNDLE_TO $BUNDLE_TO +COPY --link --chown=9999:9999 playbook /home/app/src/playbook +COPY --link --chown=9999:9999 playbook-website /home/app/src/playbook-website RUN --mount=type=secret,id=yarnenv,required cd playbook; env $(cat /run/secrets/yarnenv | xargs) yarn release RUN --mount=type=secret,id=yarnenv,required cd playbook-website; env $(cat /run/secrets/yarnenv | xargs) yarn release + +FROM base AS prod +COPY --from=rubydeps --link $BUNDLE_TO $BUNDLE_TO +COPY --link --chown=9999:9999 playbook /home/app/src/playbook +COPY --link --chown=9999:9999 playbook-website /home/app/src/playbook-website +COPY --link --from=release /home/app/src/playbook/dist /home/app/src/playbook/dist +COPY --link --from=release /home/app/src/playbook-website/public /home/app/src/playbook-website/public diff --git a/Jenkinsfile b/Jenkinsfile index 966ade957e..470d6b7039 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,11 +9,12 @@ app.build( requestMemory: '10Gi', limitMemory: '10Gi', ], - timeout: 30, + timeout: 40, ) { app.composeBuild( appRepo: "image-registry.powerapp.cloud/playbook/playbook", - files: ["docker-compose.yml", "docker-compose.ci.yml"] + files: ["docker-compose.yml", "docker-compose.ci.yml"], + bakeFiles: ['docker-bake.hcl'] ) { compose -> stage('Image Build') { withCredentials([ @@ -27,7 +28,7 @@ app.build( shell "playbook-website/bin/deployer sops --decrypt --output yarn.secrets.dec.env yarn.secrets.env" } - compose.buildAndPush() + compose.bake() } stage('Test') { diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 0000000000..dddcdde0ac --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,9 @@ +group "default" { + targets = ["playbook"] +} + +target "playbook" { + inherits = ["web"] + target = "prod" + secret = ["id=yarnenv,src=yarn.secrets.dec.env"] +} diff --git a/playbook/CHANGELOG.md b/playbook/CHANGELOG.md index 1e45abbe49..c2d16482f4 100644 --- a/playbook/CHANGELOG.md +++ b/playbook/CHANGELOG.md @@ -1,3 +1,19 @@ +# Introducing Quick Pick: Effortless Date Range Selection with the Enhanced Date Picker +##### July 6, 2023 + +![12 29 0](https://github.com/powerhome/playbook/assets/73710701/f8ebb760-d5ab-4508-b833-7bef68ab3376) + +A new Quick Pick variant now in DatePicker! This sleek and intuitive component provides a range of pre-defined date options, enhances user experience, and streamlines workflows. + +[12.29.0](https://github.com/powerhome/playbook/tree/12.29.0) full list of changes: + +**Kit Enhancements:** + +- Map Custom Button [\#2626](https://github.com/powerhome/playbook/pull/2626) ([nidaqg](https://github.com/nidaqg)) +- New QuickPick Variant for DatePicker with Preset Dropdown [\#2407](https://github.com/powerhome/playbook/pull/2407) ([carloslimasd](https://github.com/carloslimasd) , [Israel-Molestina](https://github.com/Israel-Molestina)) + +[Full Changelog](https://github.com/powerhome/playbook/compare/12.28.0...12.29.0) + # Updated Phone Number Input: Easier Value Manipulation in React Forms ##### June 29, 2023