copy web.config from template repo to dist folder? - build

We have template repo in which are defined steps and tasks for build pipelines in different projects. Is it possible to add one web.config file to the template repo and copy that file in dist folder in different projects?
The idea is to deploy several apps under one base url

Related

Using Snowpack to transpile Web Components and package dependencies

I am using Django to build a SSR website and using Django to serve static files. I also built some Web Components using lit-element and Typescript. I would like to avoid the complexity of Webpack and use Snowpack instead. Components are stored at /static/js/components.
To use the components, I need to (1) transpile them to Javascript, (2) make available their dependencies (e.g. lit-element) and (3) move the transpired files as well as the _snowpack folder to Django's /static/ folder.
Using just snowpack build does both but creates a build folder with a complete copy of the application. It is my understanding that buildOptions.out only moves the output folder (thereby overwriting static/ altogether if buildOptions.clean===true). I guess it would be possible to script the copying of the necessary files and delete the rest of the build folder immediately, but that strikes me as quite inelegant.
Is there a configuration to only create _snowpack and the transpiled files to a specific directory?
The Django staticfiles module supports having multiple directories for static files, and making them all available under the same /static/ URL.
That way, you won't have to copy those different type of assets into the same folder before being able to serve them with Django.

How can I store my static files to some other github repo?

I am doing a Django Project and I want to store some files (which should be accessible from the project w,r) to some github project as I don't want to store the files and the projects in the same repo.
Any suggestion of doing that?
Let's say, for example, that you want to upload all files with a .css extension to a separate project.
You need to create two files in the root folder of each project. and call them .gitignore
(Don't forget the point at first)
In the repository where you want all files except css files, write in the .gitignore file:
*.css
In the repository where you only want the css files, write in the .gitignore file:
*
!*.css
You will now push the .gitignore files, respectively, to each of the projects you created.

One single git repository for 2 different heroku apps with different PROCFILES, is it possible?

I want to create 2 different heroku apps.Both are using same github repository. Each app is having different processes to run i.e they need 2 different PROCFILES. Can we use same github code for runnning 2 different apps ?
I created 2 different apps on Heroku. In Github code, created 2 different Procfiles also. In environment variables of each heroku app, I explicitly specifed 'PROCFILE' as environment variable with path of PROCFILE for each app. For one app i kept name of PROCFILE as it is and for other I created one different folder 'Backend' and in that folder added PROCFILE.
Example of my folder structure:
Project_folder\
-PROCFILE --> For one app
-my_code_folder\
-abc.py
-xyz.py
-Backend\
-PROCFILE --> For second app

Django project folder doesn’t push to gitlab

When I try to push my Django project into my gitlab repository it, all the files gets pushed properly except for the project folder it gets uploaded with a remove icon and text next to it that looks like that: # it 1080bae7
That looks like a submodule, or at least a gitlink (just a SHA1 entry)
Check if you see a .gitmodules in your repo.
If you don't see one, that means you have a nested git repo.
You can
convert that folder (nested repo) into an actual submodule, or
merge the nested repo into your main repo.
I renamed the folder, pushed it and renamed it again.

"github" and "git heroku" easy way to keep both

Until now I used svn as source control. At this time I have started a new project and it is stored on gitHub.
Issue is that Heroku and GitHub, both use git. First one to publish app and second one for version control.
My app schema is:
base-dir <--github base
some-text-files (Readme, ... )
django-project-dir <--heroku base
manage.py
main-app-dir
settings.py
other-app-dirs
views.py
models.py
When I push to gitHub base-dir and all subfolders are pushed.
To Heroku only django-project-dir should be pushed.
Notice: I have tried to create a new git repository at django-project-dir level but git take it as a submodule and excluded from gitHub.
Because this is a new project I can easily change to another schema dirs.
My question:
What is the easy way to coexist both Heroku and GitHub git configurations?
Your best option is probably to push the full repository to Heroku, but make sure Heroku ignores all files not required to run your application (see https://devcenter.heroku.com/articles/slug-compiler). Alternatively, consider creating two repositories (one for documentation and one for production code).
Your best bet is to move you readme and other files to your project root. Then just add GitHub as a separate remote (when you're in your project directory).
git remote add origin https://github.com/USERNAME/REPO
Then you can push to GitHub with git push origin master. You will have to do a forced push (the -f option) the first time assuming you're pushing what used to be the repo you used exclusively for Heroku.
You'll still be able to push to Heroku with git push heroku master.
You should have two remotes.
This is good and even desirable.
You have github and that's your remote code repository of record.
Then you have a current deployment via heroku and that is the 2nd remote.
Heroku is actually set up to use git as part of the system of pushing changes to your site on it.