Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pipeline {
agent {
docker {
image 'docker:20.10.24-cli'
args "-u root"
args '-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v /var/run/docker.sock:/var/run/docker.sock -u root'
reuseNode true
}
}
Expand All @@ -39,6 +39,7 @@ pipeline {
agent {
dockerfile {
filename './deploy/rsync.Dockerfile'
args '-u indexupdater'
reuseNode true
}
}
Expand All @@ -50,9 +51,7 @@ pipeline {
steps {
sshagent(credentials: ['index_staging_tuonela_ssh']) {
sh '''
mkdir ~/.ssh
ssh-keyscan -t rsa tuonela.scheme.org >> ~/.ssh/known_hosts
rsync schemeindex.zip stag-index@tuonela.scheme.org:/staging/index/update/schemeindex.zip
rsync -e "ssh -o StrictHostKeyChecking=no" schemeindex.zip stag-index@tuonela.scheme.org:/staging/index/update/schemeindex.zip
ssh stag-index@tuonela.scheme.org 'cd ~ ; bash install-update.sh'
'''
}
Expand All @@ -63,6 +62,7 @@ pipeline {
agent {
dockerfile {
filename './deploy/rsync.Dockerfile'
args '-u indexupdater'
reuseNode true
}
}
Expand All @@ -74,9 +74,7 @@ pipeline {
steps {
sshagent(credentials: ['index_tuonela_ssh']) {
sh '''
mkdir ~/.ssh
ssh-keyscan -t rsa tuonela.scheme.org >> ~/.ssh/known_hosts
rsync schemeindex.zip prod-index@tuonela.scheme.org:/production/index/update/schemeindex.zip
rsync -e "ssh -o StrictHostKeyChecking=no" schemeindex.zip prod-index@tuonela.scheme.org:/production/index/update/schemeindex.zip
ssh prod-index@tuonela.scheme.org 'cd ~ ; bash install-update.sh'
'''
}
Expand Down
9 changes: 5 additions & 4 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /app
RUN ./scheme-index-util/buildtypes types/index.scm ./scheme-index-util/types.json
RUN ./scheme-index-util/buildfilters filters/index.scm ./scheme-index-util/filters.json

FROM node:22 as node
FROM node:24 as node
RUN apt-get update && apt-get install zip
COPY ./scheme-index-app/package.json /app/scheme-index-app/package.json
COPY ./scheme-index-app/package-lock.json /app/scheme-index-app/package-lock.json
Expand All @@ -20,10 +20,11 @@ COPY . /app
COPY --from=chicken /app/scheme-index-util/types.json /app/scheme-index-app/src/assets/types.json
COPY --from=chicken /app/scheme-index-util/filters.json /app/scheme-index-app/src/assets/filters.json
RUN npm run build
WORKDIR /app/scheme-index-app/dist/scheme-index
RUN zip -r ../scheme-index.zip *
WORKDIR /app/scheme-index-app/dist/scheme-index/browser
RUN zip -r ../../scheme-index.zip *

FROM nginx:1.27
COPY --from=node /app/scheme-index-app/dist/scheme-index /schemeindex
COPY --from=node /app/scheme-index-app/dist/scheme-index/browser /schemeindex
COPY --from=node /app/scheme-index-app/dist/scheme-index.zip /schemeindex.zip
RUN rm -rf /usr/share/nginx/html
RUN cp -r /schemeindex /usr/share/nginx/html
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install
npm run build

echo 'Zipping result'
cd $ROOT/scheme-index-app/dist/scheme-index
cd $ROOT/scheme-index-app/dist/scheme-index/browser
zip -r $ROOT/build/schemeindex.zip *

echo "Build output at $ROOT/build/schemeindex.zip"
2 changes: 2 additions & 0 deletions deploy/rsync.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y ssh rsync
RUN useradd -ms /bin/bash indexupdater
USER indexupdater
45 changes: 35 additions & 10 deletions scheme-index-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular/build:application",
"options": {
"outputPath": "dist/scheme-index",
"outputPath": {
"base": "dist/scheme-index"
},
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": [
"zone.js"
],
Expand All @@ -37,8 +38,8 @@
"node_modules/@fontsource/roboto/400.css"
],
"scripts": [],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
"serviceWorker": "ngsw-config.json",
"browser": "src/main.ts"
},
"configurations": {
"production": {
Expand All @@ -57,9 +58,7 @@
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
Expand All @@ -68,7 +67,7 @@
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular/build:dev-server",
"options": {
"proxyConfig": "src/proxy.conf.json"
},
Expand All @@ -83,13 +82,13 @@
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"builder": "@angular/build:extract-i18n",
"options": {
"buildTarget": "scheme-index:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular/build:karma",
"options": {
"polyfills": [
"zone.js",
Expand Down Expand Up @@ -126,5 +125,31 @@
"schematicCollections": [
"@angular-eslint/schematics"
]
},
"schematics": {
"@schematics/angular:component": {
"type": "component"
},
"@schematics/angular:directive": {
"type": "directive"
},
"@schematics/angular:service": {
"type": "service"
},
"@schematics/angular:guard": {
"typeSeparator": "."
},
"@schematics/angular:interceptor": {
"typeSeparator": "."
},
"@schematics/angular:module": {
"typeSeparator": "."
},
"@schematics/angular:pipe": {
"typeSeparator": "."
},
"@schematics/angular:resolver": {
"typeSeparator": "."
}
}
}
Loading
Loading