Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #155 from ytsarev/fix-make
Browse files Browse the repository at this point in the history
Move control variables to the main Makefile
  • Loading branch information
ulucinar authored Mar 11, 2022
2 parents 7a527e0 + ccd92ed commit 91c8f61
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
PROJECT_NAME := provider-jet-azure
PROJECT_REPO := github.com/crossplane-contrib/$(PROJECT_NAME)

export TERRAFORM_VERSION ?= 1.0.5
export TERRAFORM_PROVIDER_SOURCE ?= hashicorp/azurerm
export TERRAFORM_PROVIDER_VERSION ?= 2.78.0

PLATFORMS ?= linux_amd64 linux_arm64

# -include will silently skip missing files, which allows us
Expand Down Expand Up @@ -100,9 +104,8 @@ provider-jet-azure.vendor: prepare.azurerm vendor

# must match Docker build file env. variable TERRAFORM_PROVIDER_AZURERM_VERSION in
# cluster/images/provider-jet-azure-controller/Dockerfile
AZURERM_REFSPEC ?= v2.78.0
prepare.azurerm:
@WORK_DIR=.work AZURERM_REFSPEC=$(AZURERM_REFSPEC) ./scripts/prepare_azurerm.sh
@WORK_DIR=.work TERRAFORM_PROVIDER_VERSION=$(TERRAFORM_PROVIDER_VERSION) ./scripts/prepare_azurerm.sh

codegen.pipeline: prepare.azurerm
@USE_INCLUDE_LIST=true go run cmd/generator/main.go
Expand Down
1 change: 0 additions & 1 deletion cluster/images/provider-jet-azure-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ARG TERRAFORM_PROVIDER_SOURCE
ARG TERRAFORM_PROVIDER_VERSION
ARG TINI_VERSION
ENV USER_ID=1001
# must match Makefile variable AZURERM_REFSPEC
ENV TERRAFORM_PROVIDER_VERSION=$TERRAFORM_PROVIDER_VERSION
ENV TERRAFORM_PROVIDER_SOURCE=$TERRAFORM_PROVIDER_SOURCE

Expand Down
6 changes: 0 additions & 6 deletions cluster/images/provider-jet-azure-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
# Setup Project

PLATFORMS := linux_amd64 linux_arm64
# Terraform configuration
# TODO(aru): how to pass these from root Makefile?
TERRAFORM_VERSION ?= 1.0.5
TERRAFORM_PROVIDER_SOURCE ?= hashicorp/azurerm
# version specified here should currently match the `AZURERM_REFSPEC` variable of the root Makefile
TERRAFORM_PROVIDER_VERSION ?= 2.78.0

include ../../../build/makelib/common.mk

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/crossplane/terrajet v0.4.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0
// github.com/hashicorp/terraform-provider-azurerm is replaced with ./.work/.azurerm
// and the dependency version is specified in the Makefile via make variable AZURERM_REFSPEC
// and the dependency version is specified in the Makefile via make variable TERRAFORM_PROVIDER_VERSION
github.com/hashicorp/terraform-provider-azurerm v0.0.0
github.com/pkg/errors v0.9.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
Expand Down
4 changes: 2 additions & 2 deletions scripts/prepare_azurerm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ if [ ! -d "${REPO_DIR}/.git" ]; then
git -C "${REPO_DIR}" remote add origin https://github.com/hashicorp/terraform-provider-azurerm
fi

git -C "${REPO_DIR}" fetch origin "${AZURERM_REFSPEC}"
git -C "${REPO_DIR}" fetch origin v"${TERRAFORM_PROVIDER_VERSION}"
git -C "${REPO_DIR}" reset --hard FETCH_HEAD

mkdir -p "${REPO_DIR}/xpprovider"
cp hack/provider.go.txt "${REPO_DIR}/xpprovider/provider.go"
cp hack/provider.go.txt "${REPO_DIR}/xpprovider/provider.go"

0 comments on commit 91c8f61

Please sign in to comment.