-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Masterxilo/google-auth-li…
- Loading branch information
Showing
16 changed files
with
2,274 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
dist/* | ||
/node_modules | ||
node_modules | ||
|
||
build-in-container* | ||
*.md | ||
Dockerfile* | ||
*.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM node:12-alpine | ||
|
||
RUN apk add bash sudo curl | ||
SHELL ["/bin/bash", "-c"] | ||
RUN node --version | ||
|
||
WORKDIR /app | ||
COPY package*.json ./ | ||
RUN npm install | ||
|
||
COPY . ./ | ||
RUN ./build | ||
RUN ls -l /app/dist/google-auth-library-token-alpine | ||
RUN ldd /app/dist/google-auth-library-token-alpine | ||
RUN ( /app/dist/google-auth-library-token-alpine || true ) 2>&1 | grep -F 'GOOGLE_APPLICATION_CREDENTIALS environment variable is not set!' | ||
|
||
ENTRYPOINT [ "/app/dist/google-auth-library-token" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#FROM alpine:3.16 | ||
|
||
# includes libgcc | ||
FROM node:12-alpine | ||
|
||
# gcompat libstdc++: required for | ||
#10 0.658 libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f9d72263000) | ||
#10 0.658 libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f9d72249000) | ||
# https://wiki.alpinelinux.org/wiki/Running_glibc_programs | ||
RUN apk add bash sudo curl wget musl musl-dev gcompat libstdc++ | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
WORKDIR /app | ||
COPY cachebust . | ||
RUN wget https://github.com/Masterxilo/google-auth-library-token/raw/master/dist/google-auth-library-token-alpine | ||
RUN chmod +x ./google-auth-library-token-alpine | ||
|
||
# Error loading shared library libstdc++.so.6 | ||
RUN ldd ./google-auth-library-token-alpine | ||
# TODO #10 1.662 /bin/bash: line 1: 8 Segmentation fault ./google-auth-library-token-alpine | ||
RUN ( ./google-auth-library-token-alpine || true ) 2>&1 | ||
# | grep -F 'GOOGLE_APPLICATION_CREDENTIALS environment variable is not set!' | ||
|
||
ENTRYPOINT [ "/app/dist/google-auth-library-token" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
./npm-install-if-necessary | ||
|
||
mkdir -p dist | ||
rm dist/* || true | ||
|
||
# depends on nodejs/npm | ||
npm run package | ||
ls | ||
|
||
pushd dist | ||
cp google-auth-library-token-win.exe google-auth-library-token.exe || true | ||
cp google-auth-library-token.exe google-auth-library-token-win.exe || true | ||
|
||
cp google-auth-library-token-linux google-auth-library-token || true | ||
cp google-auth-library-token google-auth-library-token-linux || true | ||
|
||
rm *-linux || true | ||
rm *-win.exe || true | ||
popd | ||
|
||
ls dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
sudo docker build . --tag masterxilo/google-auth-library-token | ||
# TODO use paulfrischknecht repo instead | ||
TAG=masterxilo/google-auth-library-token | ||
sudo docker build --progress plain --file Dockerfile . --tag $TAG | ||
|
||
# note: the -alpine binary not built in alpine gives Segmentation fault in alpine! | ||
rm dist/*-token dist/*-token.exe || true | ||
sudo docker run --volume "$(pwd)/dist:/app/dist2" --entrypoint /bin/bash $TAG -c 'rm /app/dist/*-alpine ; cp /app/dist/* /app/dist2 ; echo "copied dist files" ; find /app/dist2' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
TAG=masterxilo/google-auth-library-token-alpine | ||
#sudo docker build --progress plain --file Dockerfile.alpine . --tag $TAG | ||
|
||
rm dist/*-alpine || true | ||
sudo docker run --volume "$(pwd)/dist:/app/dist2" --entrypoint /bin/bash $TAG -c 'find /app/dist2 ; cp /app/dist/*-alpine /app/dist2 ; echo "copied alpine files" ; find /app/dist2' | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
which npm | ||
|
||
# npm install should also be run if package.json has been modified since last npm install run --> copy package.json to ./node_modules/package.json and compare!!! | ||
if ! ls ./node_modules/package.json &> /dev/null || ! diff ./package.json ./node_modules/package.json &> /dev/null ; then | ||
echo "npm install not run or outdated, running..." 1>&2 | ||
npm install 1>&2 | ||
cp ./package.json ./node_modules/package.json 1>&2 | ||
fi |
Oops, something went wrong.