Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

func: draft implementation of catalog repo visibility on creation #25

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

watch_file flake.nix
watch_file flake.lock
if ! use flake . --no-pure-eval
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
main.tf
variables.tf
*.env
.direnv/
.devenv/
.ci/
9 changes: 6 additions & 3 deletions examples/resources/cycloid_catalog_repository/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ resource "cycloid_credential" "tf_credential_catalog_repo" {
}

resource "cycloid_catalog_repository" "tf_catalog_repository" {
name = "tfcatalogrepo"
name = "tfcatalogrepo"
credential_canonical = cycloid_credential.tf_credential_catalog_repo.canonical
url = var.catalog_repository_url
branch = var.catalog_repository_branch
url = var.catalog_repository_url
branch = var.catalog_repository_branch

on_create_visibility = "shared"
on_create_team = "admin"
}

provider "cycloid" {
Expand Down
265 changes: 265 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
inputs = {
nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
devenv.inputs.nixpkgs.follows = "nixpkgs";
};

nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};

outputs = { self, nixpkgs, devenv, systems, ... } @ inputs:
let
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
packages = forEachSystem (system: {
devenv-up = self.devShells.${system}.default.config.procfileScript;
devenv-test = self.devShells.${system}.default.config.test;
});

devShells = forEachSystem (system:
let
pkgs = import nixpkgs {
inherit system;

config = {
allowUnfree = true;
};
};
in
{
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [{
languages = {
go = {
enable = true;
package = pkgs.go_1_22;
};

terraform = {
enable = true;
#version = "";
};
};
# https://devenv.sh/reference/options/
packages = with pkgs; [
gnumake
terraform-ls
terraform-plugin-docs
openapi-generator-cli
yamlfix
openapi-changes
];
}];
};
});
};
}
Loading