Skip to content

Commit

Permalink
build: placeholder simplified build process
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelTaranto committed Jul 10, 2024
1 parent 988a41b commit a3f51fb
Show file tree
Hide file tree
Showing 7 changed files with 1,415 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
tags: ci_image:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
build-args: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
GPG_PASSPHRASE=${{ secrets.GPG_PASSPHRASE }}
- name: Extract artifact from Docker image
run: |
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@lamassu:registry=https://gitlab.lamassu.is/api/v4/projects/108/packages/npm/
//gitlab.lamassu.is/api/v4/projects/108/packages/npm/:_authToken="${NPM_TOKEN}"
13 changes: 11 additions & 2 deletions build-scripts/Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
FROM lamassu/upboard-build:2.0 as build
FROM lamassu/upboard-build:2.1 as build

WORKDIR lamassu-machine

ARG GPG_PASSPHRASE
RUN curl -sL https://ssubucket.ams3.digitaloceanspaces.com/deploy-files_2019.06.07.txz | xz -dc | tar -x
RUN curl -sL https://ssubucket.ams3.digitaloceanspaces.com/bnr-sdk.tar.gz.gpg | \
gpg --batch --yes --passphrase "$GPG_PASSPHRASE" --decrypt | \
tar -xzf - -C /var/lib

ARG NPM_TOKEN
COPY ["package.json", "package-lock.json", ".npmrc", "./"]

RUN npm install --global json && \
json -I -f package.json -e 'this.dependencies["@lamassu/bnr-advance"] = this.optionalDependencies["@lamassu/bnr-advance"]; delete this.optionalDependencies["@lamassu/bnr-advance"]'

COPY ["package.json", "package-lock.json", "./"]
RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0
RUN npm install
COPY . ./
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/Dockerfile.upboard-build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get upgrade -y && \

RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN apt-get install -y ca-certificates
RUN curl -sS https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs
RUN curl -sS https://deb.nodesource.com/setup_22.x | bash - && apt-get install -y nodejs

RUN curl -sS https://ssubucket.ams3.digitaloceanspaces.com/barcodescannerlibs.txz | xz -dc | \
tar -x -C /usr/local/lib --strip-components=2 barcodescannerlibs/amd64/libBarcodeScanner.a
2 changes: 1 addition & 1 deletion deploy/remove-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const isNative = m => {
const isNative = fs.existsSync(path.resolve(base, m, 'build', 'Release'))

// TODO this is awfully manual right now.
const mappedNative = m === 'keccak' || m === '@serialport'
const mappedNative = m === 'keccak' || m === '@serialport' || m === '@lamassu'

if (mode === '--rem-native')
return isNative || mappedNative
Expand Down
Loading

0 comments on commit a3f51fb

Please sign in to comment.