Skip to content

Commit

Permalink
Feat/x86 (#4)
Browse files Browse the repository at this point in the history
* Local scripts update

* Manifest and Makefile tuning

* typo fix

* mod.ts bump

* latest mode.ts

* latest upstream

* latest upstream update

* one more thing
  • Loading branch information
k0gen authored Dec 9, 2022
1 parent a8b8d7b commit 697a9df
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ghost.s9pk
image.tar
scripts/embassy.js
docker-images
.DS_Store
.vscode
config.json
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUN set -eux; \
ENV GHOST_INSTALL /var/lib/ghost
ENV GHOST_CONTENT /var/lib/ghost/content

ENV GHOST_VERSION 5.17.2
ENV GHOST_VERSION 5.24.2

RUN set -eux; \
mkdir -p "$GHOST_INSTALL"; \
Expand Down
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ install:
embassy-cli package install $(ID_NAME).s9pk

verify: $(ID_NAME).s9pk
embassy-sdk verify s9pk $(ID_NAME).s9pk
@embassy-sdk verify s9pk $(ID_NAME).s9pk
@echo " Done!"
@echo " Filesize: $(shell du -h $(ID_NAME).s9pk) is ready"


clean:
rm -f image.tar
rm -f $(ID_NAME).s9pk
rm -f scripts/*.js
rm -rf docker-images

# download/update latest dependencies scripts to be hosted locally
update:
Expand All @@ -27,11 +31,17 @@ update:
curl https://cdn.jsdelivr.net/npm/@tryghost/comments-ui/umd/comments-ui.min.js --output scripts/local/comments-ui.min.js
curl https://cdn.jsdelivr.net/npm/@tryghost/comments-ui/umd/main.css --output scripts/local/comments-main.css

$(ID_NAME).s9pk: manifest.yaml instructions.md icon.png LICENSE scripts/embassy.js image.tar
$(ID_NAME).s9pk: manifest.yaml instructions.md icon.png LICENSE scripts/embassy.js docker-images/aarch64.tar docker-images/x86_64.tar
@if ! [ -z "$(ARCH)" ]; then cp docker-images/$(ARCH).tar image.tar; echo "* image.tar compiled for $(ARCH)"; fi
embassy-sdk pack

image.tar: Dockerfile docker_entrypoint.sh
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --tag start9/$(ID_NAME)/main:$(VERSION) --platform=linux/arm64 -o type=docker,dest=image.tar .
docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh
mkdir -p docker-images
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --tag start9/$(ID_NAME)/main:$(VERSION) --platform=linux/arm64 -o type=docker,dest=docker-images/aarch64.tar .

docker-images/x86_64.tar: Dockerfile docker_entrypoint.sh
mkdir -p docker-images
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --tag start9/$(ID_NAME)/main:$(VERSION) --platform=linux/amd64 -o type=docker,dest=docker-images/x86_64.tar .

scripts/embassy.js: $(TS_FILES)
deno bundle scripts/embassy.ts scripts/embassy.js
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
- [make](https://www.gnu.org/software/make/)
- [embassy-sdk](https://github.com/Start9Labs/embassy-os/tree/master/backend)

## Build enviroment
Prepare your EmbassyOS build enviroment. In this example we are using Ubuntu 20.04.
## Build environment
Prepare your embassyOS build environment. In this example we are using Ubuntu 20.04.

1. Install docker
```
Expand Down Expand Up @@ -76,14 +76,14 @@ make
## Installing (on Embassy)

Run the following commands to determine successful install:
> :information_source: Change embassy-q1w2e3r4.local to your Embassy address
> :information_source: Change embassy-server-name.local to your Embassy address
```
embassy-cli auth login
#Enter your embassy password
embassy-cli --host https://embassy-q1w2e3r4.local package install ghost.s9pk
embassy-cli --host https://embassy-server-name.local package install ghost.s9pk
```
**Tip:** You can also install the ghost.s9pk using **Sideload Service** under the **Embassy > SETTINGS** section.
**Tip:** You can also install the ghost.s9pk using **Sideload Service** under the **System > MANAGE** section.
## Verify Install

Go to your Embassy Services page, select **Ghost**, configure and start the service.
Expand Down
2 changes: 1 addition & 1 deletion docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if [ "$(yq e .useTinfoil /var/lib/ghost/content/start9/config.yaml)" = "true" ];
fi

sed -i 's#https://code.jquery.com/jquery-3.5.1.min.js#/ghost/assets/local/jquery-3.5.1.min.js#g' /var/lib/ghost/current/content/themes/casper/default.hbs
sed -i 's#https://static.ghost.org/v4.0.0/images/publication-cover.jpg#'$LAN_ADDR'/ghost/assets/local/publication-cover.png#g' /var/lib/ghost/current/core/server/data/schema/default-settings/default-settings.json
sed -i 's#https://static.ghost.org/v5.0.0/images/publication-cover.jpg#'$LAN_ADDR'/ghost/assets/local/publication-cover.png#g' /var/lib/ghost/current/core/server/data/schema/default-settings/default-settings.json
sed -i 's#https://static.ghost.org/v4.0.0/images/feature-image.jpg#'$LAN_ADDR'/ghost/assets/local/feature-image.jpg#g' /var/lib/ghost/current/core/server/data/schema/fixtures/fixtures.json
sed -i 's#https://static.ghost.org/v4.0.0/images/ghost-orb-1.png#/ghost/assets/local/ghost-orb-1.png#g' /var/lib/ghost/current/core/built/admin/assets/ghost-*.js
sed -i 's#https://static.ghost.org/v4.0.0/images/ghost-orb-2.png#/ghost/assets/local/ghost-orb-2.png#g' /var/lib/ghost/current/core/built/admin/assets/ghost-*.js
Expand Down
10 changes: 5 additions & 5 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
id: ghost
title: "Ghost"
version: 5.17.2
version: 5.24.2
release-notes: |
Update to lates Ghost upstream release
* health checks updates
This one is Universal Package aka Fattie
* added support to x86_64 and aarch64 architecture
* latest version of localy hosted scripts
* a more detailed changelog is available [here](https://github.com/TryGhost/Ghost/compare/v5.13.2...v5.17.2)
* latest upstream update - changelog available [here](https://github.com/TryGhost/Ghost/compare/v5.13.2...v5.24.2)
license: mit
wrapper-repo: "https://github.com/Start9Labs/ghost-wrapper"
upstream-repo: "https://github.com/TryGhost/ghost"
Expand All @@ -20,7 +20,7 @@ assets:
license: LICENSE
icon: icon.png
instructions: instructions.md
docker-images: image.tar
# docker-images: image.tar
main:
type: docker
image: main
Expand Down
2 changes: 1 addition & 1 deletion scripts/deps.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/x/[email protected].1.1.4/mod.ts";
export * from "https://deno.land/x/[email protected].3.0.5/mod.ts";
1 change: 1 addition & 0 deletions scripts/embassy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export { getConfig } from "./procedures/getConfig.ts";
export { properties } from "./procedures/properties.ts";
export { migration } from "./procedures/migrations.ts";
export { health } from "./procedures/healthChecks.ts";
//export { main } from "./procedures/main.ts";
2 changes: 1 addition & 1 deletion scripts/local/comments-main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/local/comments-ui.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions scripts/procedures/healthChecks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { types as T, healthUtil } from "../deps.ts";

export const health: T.ExpectedExports.health = {
"web-ui": healthUtil.checkWebUrl("http://ghost.embassy:2368/ghost/api/admin/site/")
}
async "web-ui"(effects, duration) {
return healthUtil.checkWebUrl("http://ghost.embassy:2368/ghost/api/admin/site/")(effects, duration).catch(healthUtil.catchError(effects))
},
};
2 changes: 1 addition & 1 deletion scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { compat, types as T } from "../deps.ts";

export const migration: T.ExpectedExports.migration = compat.migrations
.fromMapping( {}, "5.11.0" );
.fromMapping( {}, "5.24.2" );

0 comments on commit 697a9df

Please sign in to comment.