mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
Test npm deployment in CI
This commit is contained in:
parent
29c8e7e954
commit
a84efdb8be
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -29,3 +29,5 @@ notifications/
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
.nyc_output/
|
.nyc_output/
|
||||||
|
|
||||||
|
*.tgz
|
||||||
|
|
|
@ -24,8 +24,9 @@ script:
|
||||||
- docker-compose build
|
- docker-compose build
|
||||||
- docker-compose up -d
|
- docker-compose up -d
|
||||||
- sleep 5
|
- sleep 5
|
||||||
- ./scripts/check_services.sh
|
- ./scripts/check-services.sh
|
||||||
- npm run int-test
|
- npm run int-test
|
||||||
|
- ./scripts/npm-deployment-test.sh
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- ./scripts/docker-publish.sh
|
- ./scripts/docker-publish.sh
|
||||||
|
|
35
scripts/npm-deployment-test.sh
Executable file
35
scripts/npm-deployment-test.sh
Executable file
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
NPM_UNPACK_DIR=/tmp/npm-unpack/test
|
||||||
|
|
||||||
|
echo "Packing npm package into a tarball"
|
||||||
|
npm pack
|
||||||
|
|
||||||
|
AUTHELIA_PACKAGE=`ls | grep "authelia-\([0-9]\+.\)\{2\}[0-9]\+.tgz"`
|
||||||
|
echo "Authelia package is ${AUTHELIA_PACKAGE}"
|
||||||
|
|
||||||
|
echo "Copy package into "${NPM_UNPACK_DIR}" to test unpacking"
|
||||||
|
mkdir -p ${NPM_UNPACK_DIR}
|
||||||
|
cp ${AUTHELIA_PACKAGE} ${NPM_UNPACK_DIR}
|
||||||
|
|
||||||
|
pushd ${NPM_UNPACK_DIR}
|
||||||
|
|
||||||
|
echo "Test unpacking..."
|
||||||
|
npm install ${AUTHELIA_PACKAGE}
|
||||||
|
|
||||||
|
RET_CODE=$?
|
||||||
|
# echo ${RET_CODE}
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
||||||
|
if [ "$RET_CODE" != "0" ]
|
||||||
|
then
|
||||||
|
echo "Unpacking failed..."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Unpacking succeeded"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user