vacp2p / vac.dev

https://vac.dev
7 stars 12 forks source link

add jenkinsfile and CNAME file #102

Closed serhanwbahar closed 1 year ago

serhanwbahar commented 1 year ago

The current implementation of the site builder requires content repo to be submited as a zip file for production using env vars CONTENT_SOURCE_TYPE=git and CONTENT_SOURCE_URL=repo-link.zip which is not considered a best practice. Due to this, a race condition may occur during the build process if another commit is made while the build is in progress which may lead a security flow. To work around this,first, we checkout into src using checkoutToSubdirectory('src'). Then, we use local_folder mode using CONTENT_SOURCE_TYPE=local_folder and CONTENT_SOURCE_URL=..src env vars, just like a local develop. local_folder mode copies the website files from src into docs because the site builder is incapable of copying it. We checkout the builder into the builder directory and run the install and build commands inside of that directory. Finally, for publish stages, we copy the out directory into the site repo, since the out directory is in the wrong repo.

serhanwbahar commented 1 year ago

Also, @jakubgs, can you make the develop default branch?

serhanwbahar commented 1 year ago

It seems to work:

jakubgs commented 1 year ago

One thing worth noting, is taht ghp-import can't work if we use HTTP endpoint to clone the repo:

image

And it fails with:

+ ghp-import -p out
fatal: could not read Username for 'https://github.com/': No such device or address

Instead we need to use the SSH/Git address:

image

jakubgs commented 1 year ago

And now it works: https://ci.infra.status.im/job/website/job/vac.dev/208/

serhanwbahar commented 1 year ago

One thing worth noting, is taht ghp-import can't work if we use HTTP endpoint to clone the repo:

image

And it fails with:

+ ghp-import -p out
fatal: could not read Username for 'https://github.com/': No such device or address

Instead we need to use the SSH/Git address:

image

Thank you for the notification. I'll be sure to update the relevant repositories accordingly.