Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fredclausen committed May 13, 2024
1 parent 445eeb9 commit 0b21908
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 26 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
reason:
required: true
description: "Reason for running this workflow"
use_test_image:
required: false
type: boolean
description: "Use base image testpr"
default: false
push:
branches:
- main
Expand All @@ -25,8 +20,6 @@ on:
# - REPO: repo name on dockerhub
# - IMAGE: image name on dockerhub
env:
DOCKERHUB_REPO: mikenye
DOCKERHUB_IMAGE: fr24feed
GHCR_IMAGE: ${{ github.repository }}
GHCR_REGISTRY: ghcr.io

Expand All @@ -43,10 +36,8 @@ jobs:
- name: Log dispatch reason
env:
INPUTS_REASON: ${{ github.event.inputs.reason }}
INPUTS_USE_TEST_IMAGE: ${{ github.event.inputs.use_test_image }}
run: |
echo "Workflow dispatch reason: $INPUTS_REASON"
echo "Use test image: $INPUTS_USE_TEST_IMAGE"
hadolint:
name: Run hadolint against docker files
Expand All @@ -64,23 +55,19 @@ jobs:
needs: [hadolint]
with:
push_enabled: true
push_destinations: ghcr.io;dockerhub
dockerhub_profile: mikenye #legacy
dockerhub_repo: docker-flightradar24 #legacy
push_destinations: ghcr.io
ghcr_repo_owner: ${{ github.repository_owner }}
ghcr_repo: ${{ github.repository }}
platform_linux_arm32v6_enabled: false
platform_linux_arm64v8_enabled: true
platform_linux_i386_enabled: false
get_version_method: file_in_container:file=/CONTAINER_VERSION
# set build_latest to true if github.event.inputs.use_test_image is false
build_latest: ${{ github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '' }}
build_baseimage_test: ${{ github.event.inputs.use_test_image == 'true' }}
build_latest: true
build_baseimage_test: false
# only build the entire stack if we are not using the test image
build_version_specific: ${{ github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '' }}
build_platform_specific: ${{ github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '' }}
build_nohealthcheck: ${{ github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '' }}
build_baseimage_url: :qemu/:qemu-test-pr
build_version_specific: false
build_platform_specific: false
build_nohealthcheck: false
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ prisma/migrations/migration_lock.toml
prisma/test.db
*-journal
dist
.DS_Store
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22-bookworm-slim
FROM node:22.1.0-bookworm-slim

RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app

Expand All @@ -19,5 +19,8 @@ RUN npm install && \
rm -rf src

ENV NODE_ENV=production \
PORT=3000
CMD [ "npm", "run", "start"]
PORT=3000 \
API_KEY="/opt/api/sdre-e-updater.2024-02-05.private-key.pem" \
APP_ID="818428" \
DATABASE_URL="file:/opt/api/imageapi.db"
CMD [ "npm", "run", "start_docker"]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"type": "module",
"scripts": {
"build": "tsc && tsc-alias",
"start": "npx prisma migrate deploy && node dist/index.js"
"start": "npx prisma migrate deploy && node --env-file='.env' dist/index.js",
"start_docker": "npx prisma migrate deploy && node dist/index.js"
},
"author": "Fred Clausen",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions src/ignored.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export const IGNORED_REPOS = [
"docker-jaero",
"rbfeeder",
"acars-guide",
"multifeeder",
];
17 changes: 14 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,19 @@ const app = express();
const port = process.env.PORT || 3000;
const prisma = new PrismaClient();

let APP_ID = process.env.APP_ID || process.exit(1);
let API_KEY = process.env.API_KEY || process.exit(1);
let APP_ID = process.env.APP_ID;

if (APP_ID === undefined) {
console.error("APP_ID not set. Exiting");
process.exit(1);
}

let API_KEY = process.env.API_KEY;

if (API_KEY === undefined) {
console.error("API_KEY not set. Exiting");
process.exit(1);
}

const octo_app = new App({
appId: APP_ID,
Expand Down Expand Up @@ -405,7 +416,7 @@ async function update_images() {
let modified_date = new Date(); // FIXME: we should get the modified date from the API
let created_date = new Date();
let release_notes = "No release notes available";
let stable = false;
let stable = true;

// lets see if we already have this image in the database
let existing_image = false;
Expand Down

0 comments on commit 0b21908

Please sign in to comment.