How do I specify the name of the packages.yml file in the dbt deps command? - package

I have 2 packages.yml file in my project directory to address my use case. The files are as below:
packages.yml
packages_1.yml
Each of the above 2 packages files have different packages with different versions.
Therefore how do I specify the names of the packages.yml file in my dbt deps command?
I have tried using the following commands:
dbt deps --profiles-dir ${DBT_PROFILES_DIR} --project-dir ${DBT_PROJECT_DIR} packages.yml
dbt deps --profiles-dir ${DBT_PROFILES_DIR} --project-dir ${DBT_PROJECT_DIR} packages_1.yml
I expected the dbt deps command to pick up the packages.yml files from my project directory and install the packages.
However this doesn't seem to work. It only picks up the first one.

Related

Error: The reference to external elements from the source named 'master.dacpac' could not be resolved

I am building a database dacpac using sqlpackage on a windows machine. The project contains a reference to master.dacpac
I take the move the dacpac to a linux machine (mssql-server-linux docker image) and restore the database.
deploy-database.sh
# publish dacpac using sqlpackage
./sqlpackage/sqlpackage /Action:Publish /sf:"/MyDb.dacpac" /tu:sa /tp:Password1 /tdn:MyDb /tsn:localhost
Error:
No file was supplied for reference master.dacpac; deployment might fail. When package was created, the original referenced file was
located C:$(windows machine path)\MASTER.DACPAC. Initializing
deployment (Failed)
An error occurred during deployment plan generation. Deployment cannot continue. Error SQL0: The reference to external elements from
the source named 'master.dacpac' could not be resolved, because no
such source is loaded. Warning SQL72025: No file was supplied for
reference master.dacpac; deployment might fail. When package was
created, the original referenced file was located C:$(windows machine
path)\MASTER.DACPAC.
An error occurred while adding references. Deployment cannot
continue. The command '/bin/sh -c sh /deploy-database.sh' returned a
non-zero code: 1
I have tried adding master.dacpac to the project directly and also copying it to the docker image but the same error occurs.
How can I restore a dapac in a linux environment that has a reference to master.dacpac?
I had a similar issue, my solution was to rename the dacpac files UPPERCASE, (ex: MASTER.DACPAC) which worked for me, as well as making the directory with the dacpac files the working directory.
I have tried adding master.dacpac to the project directly and also
copying it to the docker image but the same error occurs.
Make sure master.dacpac file is in the current working directory. Since your MyDb.dacpac file exists in the root directory, copy the master.dacpac file there and execute the sqlpackage command in the context of the root directory.
The example below specifies an absolute reference to sqlpackage (in case it's not already in your path) and a relative reference to your user dacpac (although an absolute reference will work too).
cd /
/sqlpackage/sqlpackage /Action:Publish /sf:"MyDb.dacpac" /tu:sa /tp:Password1 /tdn:MyDb /tsn:localhost

Allure2 report not using allure.properties for #Issue

In my current setup I have it so that I can have a static allure.properties file located in my allure-results folder. This properties file holds the value for the #Issue environment variable and value.
allure.link.issue.pattern=https\://tfs.mytfs.com/tfs/_workitems?id\={}
When I generate the report allure generate --clean <results dir> -o <report dir> it does not appear to be using the allure.properties file to populate the #Issue links with the correct value. Instead, the link value is blank and the link redirects to itself.
I am using the updated #Issue environment variable. I think this might be due to how I am generating the report as the documentation states "simply generate the report. By default command-line tool looking for config in the directory you run the command. You can use ALLURE_CONFIG environment variable to specify the path to configuration".
I am not sure what I am missing though as I run the generate command from the results folder. Is that not correct?
Since version Allure 2 no need to pass allure.properties file to allure-results folder. You need to add it to your test resources instead.
Here you can find an example https://github.com/allure-examples/allure-testng-example/blob/master/src/test/resources/allure.properties

Inno Setup update a installed program

In my into setup script I put the following line :
Source: "..\Source\Programmverzeichnis\*"; DestDir: "{app}"; Flags: recursesubdirs;
At the first install the setup copy 20 files into the program folder. For the second compile I put 5 files into the folder ..\Source\Programmverzeichnis. Inno Setup get these 5 new files and put it into the second setup at compiling. Both setup have the same setup script. Only the 5 files are changed in the source.
If I installed the first setup and then the second setup with the new 5 files. The second setup doesn't copy the new 5 files into the program folder. The flags 'onlyifdestfileexists' and 'onlyifdoesntexist' have no effect.
What can I do, that the second setup copy the new 5 files into the program folder if I only put it into the source and make a new compile ?

Where does GO look for google-cloud-sdk ? What should GOPATH be?

I'm having trouble setting up Go App engine on osX. Should the google-cloud-sdk path be in GOROOT or GOPATH?
I put the google-cloud-sdk in /usr/local
It looks like there is source code in: goroot/
/usr/local/google-cloud-sdk/platform/google_appengine/goroot/
go env
GOPATH="/usr/local/google-cloud-sdk/platform/google_appengine/goroot"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
$ go get
package google.golang.org/appengine: cannot download, /usr/local/google-cloud-sdk/platform/google_appengine/goroot is a GOROOT, not a GOPATH. For more details see: 'go help gopath'
package google.golang.org/appengine/datastore: cannot download, /usr/local/google-cloud-sdk/platform/google_appengine/goroot is a GOROOT, not a GOPATH. For more details see: 'go help gopath'
When I attempted to change the PATH to include /src:
GOPATH="/usr/local/google-cloud-sdk/platform/google_appengine/goroot/src"
$ go get
package google.golang.org/appengine: mkdir /usr/local/google-cloud-sdk/platform/google_appengine/goroot/src/src: permission denied
package google.golang.org/appengine/datastore: cannot find package "google.golang.org/appengine/datastore" in any of:
/usr/local/go/src/google.golang.org/appengine/datastore (from $GOROOT)
/usr/local/google-cloud-sdk/platform/google_appengine/goroot/src/src/google.golang.org/appengine/datastore (from $GOPATH)
I appended the path to google-cloud-sdk to GOROOT:
export GOROOT="/usr/local/go/:/usr/local/google-cloud-sdk/platform/google_appengine/goroot"
GO doesn't seem to like multiple paths in GOROOT:
$ go get
go: cannot find GOROOT directory: /usr/local/go/:/usr/local/google-cloud-sdk/platform/google_appengine/goroot
I did run the ./install.sh script after I copied the source to /usr/local
The additional PATH's added did not fix the errors I was having.
I saw this answer: Test cases for go and appengine
But it's from 5 years ago and it seems clunky/hacky. It would seem in 5 years there would be a more elegant solution that copying individual directories and creating symlinks.
EDIT **********************
mv /usr/local/google-cloud-sdk/ ~/go/ then deleted GOPATH and GOROOT from .bash_profile
I then ran ./install.sh
I attempted to run 'go get':
$ go get
go install: no install location for directory /Users/Bryan/work/gocode/skincarereview outside GOPATH
Since that failed, I added the path to the working directory of code AND appended the path to google-cloud-sdk to PATH:
export GOPATH = "/Users/Bryan/work/gocode/skincarereview"
export PATH=$HOME/google-cloud-sdk:$PATH
go get get failed with the same message:
$ go get
go install: no install location for directory /Users/Bryan/work/gocode/skincarereview outside GOPATH
For more details see: 'go help gopath'
It goes in neither $GOROOT or $GOPATH. Just unpack it to your $HOME directory and run the installer. If necessary, add it to your $PATH by adding this line to your .bash_profile.
export PATH=$HOME/google-cloud-sdk:$PATH
Make sure you grab the golang SDK as well with gcloud components install app-engine-go https://cloud.google.com/appengine/docs/standard/go/download
DO NOT change your path to include the src dir in google-cloud-sdk/platform/google_appengine/goroot/src. That will break things. You leave your $GOPATH to be your normal installation. Using the App Engine SDK for Go automatically uses the sources in that dir without any manipulation.
Also, you should NEVER MANUALLY change $GOROOT unless you plan on compiling a new Go version from source (as in a new version of the language). It will automatically set the proper $GOROOT for you. https://dave.cheney.net/2013/06/14/you-dont-need-to-set-goroot-really
If your install is messed up beyond reason (happened to me once), just remove the cloud SDK and any references to it in your $PATH. Also completely uninstall the regular Go installation. Then start from scratch. Install Go, unpack google-cloud-sdk, run installer (add to $PATH if needed), gcloud components install app-engine-go. Voila.
When developing for App Engine, your go sources go into your REGULAR $GOPATH. They DO NOT go in google-cloud-sdk/... anywhere. To run the dev_appserver locally, run dev_appserver.py [path-to-source] where the given path contains your code and the app.yaml. I usually cd in to my project path (e.g. cd $HOME/go/src/myproject) and run with dev_appserver.py ./. https://cloud.google.com/appengine/docs/standard/go/tools/using-local-server
Deployment is covered here. https://cloud.google.com/appengine/docs/standard/go/tools/uploadinganapp
EDIT: Folder structure.
$GOPATH = $HOME/go
Location for google-cloud-sdk folder

How to sync version numbers for nuget packages when targeting multiple project files

I have a project which has three project files targeting various .net versions (mylib.net20.csproj, mylib.net40.csproj, and mylib.net40-client.csproj). I have a single nuspec file named mylib.nuspec for packaging them all together.
It might help to see the files section of the nuspec file, so here it is:
<files>
<file src="bin\net20\*.dll" target="lib\net20\" />
<file src="bin\net40-client\*.dll" target="lib\net40-client\" />
<file src="bin\net40\*.dll" target="lib\net40\" />
</files>
Right now I use a static version number in the nuspec file and I can successfully package everything by running nuget pack mylib.nuspec. However, I would like to start using $version$ so I don't have to remember to update the version number in two places.
If I simply change the version number to $version$, and build in the same way I get the predictable error:
Attempting to build package from 'mylib.nuspec'.
The replacement token 'version' has no value.
If I use $version$ and package with nuget pack mylib.net40.csproj, it is successful, but I get a package that completely ignores the nuspec file.
Q: What can I do to get the $version$ variable to work?
Technically, I could rename my nuspec file to mylib.net20.nuspec and then package with nuget pack mylib.net20.nuspec. I really don't want to rename my nuspec file in this way though.
creating a package can be done two ways
Using nuspec directly
Using your csproj file , which in fact uses your nuspec file at run time.
First case is pretty straight forward where all metadata defined in nuspec file will be considered for package creation.
nuget pack nuspecfilename.nuspec
On executing above command all hard coded values in your nuspec file will be used for package creation
Above Procedure uses nuspec file directly.
Now let come to your requirement , Using token $version$ in your nuspec files.
In order to work with tokens rather than hard coded values , we need to use csproj file while running nuget pack command.
nuget pack nameofyourprojectfile.csproj -p "configuration=Release;platform=x64"
I'll explain the command i have used ,the concept of using csproj file while generating a package is it will replace all tokens in nuspec file at the run time.
Your corresponding assembly info file to your csproj file will contain required metadata of version which will be replaced at run time.
-p is parameters to be used at run time , here i have assumed that my proj file builds in release and x64 platform so i have passed that at run time so nuget which for artifacts to bundle accordingly.
please refer Here for more details on how to create nuget packages from csproj.
But Ideally when you package from csproj file your nuspec file will be used at run time so ,technically nuspec file should have same name as that of your csproj file.
so requirement of dealing with multiple project files with different frame work may not be achieved with single nuspec file. you need to have individual nuspec accordingly to achieve this.
But if you still want to stick with same nuspec file with out renaming it or making changes to it.
i would suggest passing version at run time
nuget pack nameofnuspec.nuspec -v 1.3.4.5
-v - is version , or you can use -version as well followed by the version of your choice.
after running above command nuget package will be created with the version specified.
to check nuget package created , rename it .zip file and check ...)

Resources