elasticio / component-pusher Goto Github PK
View Code? Open in Web Editor NEWA set of tooling to enable automated push of elastic.io components to multiple tenants
Home Page: https://www.elastic.io
License: Apache License 2.0
A set of tooling to enable automated push of elastic.io components to multiple tenants
Home Page: https://www.elastic.io
License: Apache License 2.0
Recently the component pusher was modified to include a credential check. However, this process is only working for app.elastic.io
tenant due to this line:
https://github.com/elasticio/component-pusher/blob/master/push.sh#L26
Please correct this.
Please do not delete the repositories after the failed push.
Normally this would not be a problem since if the repositories can be clearly deleted, creating them again should not be a problem. However, since we delete only the DB record of this the slug-server value is still present, and it is impossible to write there again. See this bug: https://github.com/elasticio/gitreceiver/issues/78
This creates an additional problem if you need push the failed ones again. The deployment would fail and git push -f
would not work as well. So the only way around is to do an empty commit and push it again. This creates a huge overhead and makes automatic deployment unusable anymore.
Preconditions:
Export.vars and component-list are configured correctly.
Component revision is already pushed to current team, but in different repo.
tested on flint
Start script.
see logs:
About to update components...
About to create repos...
>>>>>>>> Tenant tenants/Luzhompany/. Team stas_team. Component petstore-component-nodejs-201 >>>>>>>>
About to clone petstore-component-nodejs-201, version for_comp_pusher_test from [email protected]:elasticio/petstore-component-nodejs.git
Identity added: /home/stas/.ssh/id_rsa (/home/stas/.ssh/id_rsa)
Cloning into '/tmp/elasticio-components-pusher/petstore-component-nodejs-201'...
/tmp/elasticio-components-pusher/petstore-component-nodejs-201 ~/component-pusher
Adding the remote...
Switched to a new branch 'for_comp_pusher_test'
Branch 'for_comp_pusher_test' set up to track remote branch 'for_comp_pusher_test' from 'origin'.
About to push the component...
remote: Received push to: [email protected]/petstore-component-nodejs-201.git remote: Team: stas_team remote: Repository: petstore-component-nodejs-201 remote: Revision: 4ef821fb2815ba1a12113dd8a56bf3e17500493a remote: Build ID: 06de0cd5-457c-4591-8c7a-ad0faf2633e7 remote: Successfully validated parameters remote: Authorizing access of stas_team to petstore-component-nodejs-201 remote: About to bui-----> Compiled slug size is 21M remote: remote: remote: Slug built successfully remote: Successfully created directory for slug on the host machine remote: About to copy slug from container remote: Slug copied successfully remote: Reading component.json remote: Parsing component.json remote: Found 3 triggers and 2 actions remote: Found metadata for getPetsByStatusWithGenerators remote: Reading file ./lib/schemas/getPetsByStatus.out.json remote: Found metadata for getPetsByStatusWithPromises remote: Reading file ./lib/schemas/getPetsByStatus.out.json remote: Found metadata for getPetsByStatusWithDynamicSelectModel remote: Reading file ./lib/schemas/getPetsByStatus.out.json remote: Found metadata for createPetWithPromise remote: Reading file ./lib/schemas/createPet.in.json remote: Reading file ./lib/schemas/createPet.out.json remote: Found metadata for createPetWithGenerators remote: Reading file ./lib/schemas/createPet.in.json remote: Reading file ./lib/schemas/createPet.out.json remote: Parsing ./lib/schemas/getPetsByStatus.out.json remote: Parsing ./lib/schemas/createPet.out.json remote: Parsing ./lib/schemas/getPetsByStatus.out.json remote: Parsing ./lib/schemas/getPetsByStatus.out.json remote: Parsing ./lib/schemas/createPet.out.json remote: Parsing ./lib/schemas/createPet.in.json remote: Parsing ./lib/schemas/createPet.in.json remote: Reading icon.png remote: Removing build container and slug remote: Cleanup completed successfully remote: Deactivating previous builds remote: Updating repository remote: Saving build remote: Detaching from log stream remote: Build completed successfully To stas.elastic.io:petstore-component-nodejs-201 component.json lib logo.png package.json README.md verifyCredentials.js [new branch] for_comp_pusher_test -> master
Removing the remote...
~/component-pusher
Latest component version on the platform:4ef821fb2815ba1a12113dd8a56bf3e17500493a
============================================================================================================================
COMP NAME COMP ID LATEST VERSION STATUS
============================================================================================================================
petstore-component-nodejs-201 5c51a2c469c93300107645ba --- Failed
============================================================================================================================
AR:
ER:
The tool is working in general. However, there are several limitations which can make this tool difficult to use.
example_team
repository creation would not work.tenant-key
the push of components would not work.flint
there is a high chance that repository name you use is used and the creation of new repositories would not be possible. Only if you choose a unique name, the push would work. This is not necessarily the problem of this tool, but a problem which one can encounter if the repo name is already used in the tenant.Component pusher is unable to create remote repositories although it is possible to create by hand in UI. In general, it gives numerous errors and not particularly useable.
Logs are available per request.
One portion of the logs:
Check if environment variables are OK...
Environment variables are OK
Error: unable to verify the first certificate
(node:6917) UnhandledPromiseRejectionWarning: Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1260:34)
at TLSSocket.emit (events.js:196:13)
at TLSSocket._finishInit (_tls_wrap.js:737:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:569:12)
(node:6917) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:6917) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:6928) UnhandledPromiseRejectionWarning: Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1260:34)
at TLSSocket.emit (events.js:196:13)
at TLSSocket._finishInit (_tls_wrap.js:737:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:569:12)
(node:6928) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:6928) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
When the component list contains an extra empty line, the component pusher behaves wrong. Instead of just stopping and giving the summary it tries to fetch an empty repo from our GitHub repositories and fails miserably with the following error:
~/Operations/component-pusher
Latest component version on the platform:94eb294cb4ea4ff1537b04cab4ca722af1e96a0c
>>>>>>>> Tenant tenants/******/. *******. Component >>>>>>>>
About to clone , version from
Identity added: /Users/tigran/.ssh/id_rsa (/Users/tigran/.ssh/id_rsa)
fatal: repository '/tmp/elasticio-components-pusher/' does not exist
/tmp/elasticio-components-pusher ~/Operations/component-pusher
fatal: not a git repository (or any of the parent directories): .git
Adding the remote...
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
About to push the component...
fatal: not a git repository (or any of the parent directories): .git
Removing the remote...
fatal: not a git repository (or any of the parent directories): .git
~/Operations/component-pusher
Latest component version on the platform:94eb294cb4ea4ff1537b04cab4ca722af1e96a0c
./push.sh: line 51: tenant_map[$component]: bad array subscript
Create a component list with a couple of components and after the last line press Return
twice to create one empty line. Start the pusher script and observe the result.
For commit 22d0c43
Pusher does not shows error in logs when values are invalid
Pusher allows to push components when values are invalid:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.