diff --git a/.ci/Makefile b/.ci/Makefile deleted file mode 100644 index f718f7c92..000000000 --- a/.ci/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -ROOT_DIR := $(CURDIR)/.. - --include $(ROOT_DIR)/.env - -vault :=$(ROOT_DIR)/scripts/retry.sh 5 vault - -# BUILD_ID is present during run on Jenkins machine, but not on dev box, hence using it here to distinguish between those cases -ifndef VAULT_TOKEN - ifdef BUILD_ID - VAULT_TOKEN = $(shell $(vault) write -address=$(VAULT_ADDR) -field=token auth/approle/login role_id=$(VAULT_ROLE_ID) secret_id=$(VAULT_SECRET_ID)) - else - VAULT_TOKEN = $(shell $(vault) write -address=$(VAULT_ADDR) -field=token auth/github/login token=$(GITHUB_TOKEN)) - endif -endif - -.PHONY: clean -clean: ## Delete credentials - @ rm -f .apikey .gpg_private .gpg_passphrase .github_token .gpg_fingerprint - -.apikey: - @ VAULT_TOKEN=$(VAULT_TOKEN) $(vault) read -field=apikey secret/devops-ci/terraform-provider-ec > .apikey - -.gpg_private: - @ VAULT_TOKEN=$(VAULT_TOKEN) $(vault) read -field=gpg_private secret/devops-ci/terraform-provider-ec | base64 -d > .gpg_private - -.gpg_passphrase: - @ VAULT_TOKEN=$(VAULT_TOKEN) $(vault) read -field=gpg_passphrase secret/devops-ci/terraform-provider-ec > .gpg_passphrase - -.gpg_fingerprint: - @ VAULT_TOKEN=$(VAULT_TOKEN) $(vault) read -field=gpg_fingerprint secret/devops-ci/terraform-provider-ec > .gpg_fingerprint - -.github_token: - @ VAULT_TOKEN=$(VAULT_TOKEN) $(vault) read -field=gh_personal_access_token secret/devops-ci/terraform-provider-ec > .github_token - -import-gpg-key: - @ cat .gpg_passphrase | gpg --import --batch --yes --passphrase-fd 0 .gpg_private - -cache-gpg-passphrase: - @ cat .gpg_passphrase | gpg --armor --detach-sign --passphrase-fd 0 --pinentry-mode loopback diff --git a/.ci/jobs/defaults.yml b/.ci/jobs/defaults.yml deleted file mode 100644 index 8a0b5cf18..000000000 --- a/.ci/jobs/defaults.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -##### GLOBAL METADATA - -- meta: - cluster: devops-ci - -##### JOB DEFAULTS - -- job: - project-type: pipeline - prune-dead-branches: true - logrotate: - daysToKeep: 30 - numToKeep: 100 - artifactDaysToKeep: 5 - artifactNumToKeep: 10 - parameters: - - string: - name: branch_specifier - default: master - description: "the Git branch specifier to build (<branchName>, <tagName>,<commitId>, etc.)" - properties: - - github: - url: https://github.com/elastic/terraform-provider-ec - - inject: - properties-content: HOME=$JENKINS_HOME - pipeline-scm: - script-path: .ci/pipelines/acceptance.Jenkinsfile - scm: - - git: - credentials-id: "f6c7695a-671e-4f4f-a331-acdce44ff9ba" - reference-repo: /var/lib/jenkins/.git-references/terraform-provider-ec.git - branches: - - ${branch_specifier} - url: https://github.com/elastic/terraform-provider-ec - vault: - role_id: cff5d4e0-61bf-2497-645f-fcf019d10c13 - wrappers: - - ansicolor - - timestamps diff --git a/.ci/jobs/elastic+terraform-provider-ec+master.yml b/.ci/jobs/elastic+terraform-provider-ec+master.yml deleted file mode 100644 index 264cd0ebc..000000000 --- a/.ci/jobs/elastic+terraform-provider-ec+master.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- job: - name: elastic+terraform-provider-ec+master - display-name: elastic / terraform-provider-ec - master - description: Master branch testing - project-type: pipeline - triggers: - - github - pipeline-scm: - scm: - - git: - branches: - - master diff --git a/.ci/jobs/elastic+terraform-provider-ec+pull-request.yml b/.ci/jobs/elastic+terraform-provider-ec+pull-request.yml deleted file mode 100644 index 242eb4348..000000000 --- a/.ci/jobs/elastic+terraform-provider-ec+pull-request.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- job: - name: elastic+terraform-provider-ec+pull-request - display-name: elastic / terraform-provider-ec - pull-request - description: Pull request testing - project-type: pipeline - concurrent: true - triggers: - - github-pull-request: - github-hooks: true - org-list: - - elastic - allow-whitelist-orgs-as-admins: true - cancel-builds-on-update: false - status-context: acceptance - pipeline-scm: - scm: - - git: - branches: - - $ghprbActualCommit - refspec: +refs/pull/*:refs/remotes/origin/pr/* diff --git a/.ci/jobs/elastic+terraform-provider-ec+tag.yml b/.ci/jobs/elastic+terraform-provider-ec+tag.yml deleted file mode 100644 index 13c8ee624..000000000 --- a/.ci/jobs/elastic+terraform-provider-ec+tag.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- job: - name: elastic+terraform-provider-ec+release - display-name: elastic / terraform-provider-ec - release job - description: Releases job - project-type: pipeline - triggers: - - github - pipeline-scm: - script-path: .ci/pipelines/release.Jenkinsfile - scm: - - git: - refspec: +refs/tags/v*:refs/remotes/origin/tags/v* - branches: - - "**/tags/v*" diff --git a/.ci/pipelines/acceptance.Jenkinsfile b/.ci/pipelines/acceptance.Jenkinsfile deleted file mode 100644 index 9540b79ff..000000000 --- a/.ci/pipelines/acceptance.Jenkinsfile +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env groovy - -node('docker && gobld/machineType:n1-highcpu-8') { - String DOCKER_IMAGE = "golang:1.21" - String APP_PATH = "/go/src/github.com/elastic/terraform-provider-ec" - - stage('Checkout from GitHub') { - checkout scm - } - withCredentials([ - string(credentialsId: 'vault-addr', variable: 'VAULT_ADDR'), - string(credentialsId: 'vault-secret-id', variable: 'VAULT_SECRET_ID'), - string(credentialsId: 'vault-role-id', variable: 'VAULT_ROLE_ID') - ]) { - stage("Get EC_API_KEY from vault") { - withEnv(["VAULT_SECRET_ID=${VAULT_SECRET_ID}", "VAULT_ROLE_ID=${VAULT_ROLE_ID}", "VAULT_ADDR=${VAULT_ADDR}"]) { - sh 'make -C .ci .apikey' - } - } - } - docker.image("${DOCKER_IMAGE}").inside("-u root:root -v ${pwd()}:${APP_PATH} -w ${APP_PATH}") { - try { - stage("Download dependencies") { - sh 'make vendor' - } - stage("Run acceptance tests") { - sh 'make testacc-ci' - } - } catch (Exception err) { - throw err - } finally { - stage("Clean up") { - // Sweeps any deployments older than 1h. - sh 'make sweep-ci' - sh 'make -C .ci clean' - sh 'rm -rf reports bin' - } - } - } -} diff --git a/.ci/pipelines/release.Jenkinsfile b/.ci/pipelines/release.Jenkinsfile deleted file mode 100644 index a51082f3d..000000000 --- a/.ci/pipelines/release.Jenkinsfile +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env groovy - -node('docker && gobld/machineType:n1-highcpu-8') { - String DOCKER_IMAGE = "golang:1.21" - String APP_PATH = "/go/src/github.com/elastic/terraform-provider-ec" - - stage('Checkout from GitHub') { - checkout scm - } - withCredentials([ - string(credentialsId: 'vault-addr', variable: 'VAULT_ADDR'), - string(credentialsId: 'vault-secret-id', variable: 'VAULT_SECRET_ID'), - string(credentialsId: 'vault-role-id', variable: 'VAULT_ROLE_ID') - ]) { - stage("Get secrets from vault") { - withEnv(["VAULT_SECRET_ID=${VAULT_SECRET_ID}", "VAULT_ROLE_ID=${VAULT_ROLE_ID}", "VAULT_ADDR=${VAULT_ADDR}"]) { - sh 'make -C .ci .gpg_private .gpg_passphrase .github_token .gpg_fingerprint' - } - } - } - docker.image("${DOCKER_IMAGE}").inside("-u root:root -v ${pwd()}:${APP_PATH} -w ${APP_PATH}") { - try { - stage("Download dependencies") { - sh 'make vendor' - } - stage("Import gpg key") { - sh 'make -C .ci import-gpg-key' - } - stage("Cache GPG key and release the binaries") { - script { - env.GITHUB_TOKEN = readFile(".ci/.github_token").trim() - env.GPG_FINGERPRINT_SECRET = readFile(".ci/.gpg_fingerprint").trim() - } - sh 'make -C .ci cache-gpg-passphrase; make release' - } - } catch (Exception err) { - throw err - } finally { - stage("Clean up") { - sh 'make -C .ci clean' - sh 'rm -rf dist bin' - } - } - } -} diff --git a/.ci/views/view.yml b/.ci/views/view.yml deleted file mode 100644 index 30d678680..000000000 --- a/.ci/views/view.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- view: - name: 'terraform-provider-ec' - regex: '.*terraform-provider-ec.*' - view-type: list \ No newline at end of file diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml deleted file mode 100644 index 7d47bced0..000000000 --- a/.github/workflows/branch.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: release-branch - -on: - workflow_dispatch: - push: - tags: - - '*.*.*' - -jobs: - branch-out: - name: Create a github branch - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.22 - id: go - - - name: Bump main version - run: make patch - - - name: Get the branch version - id: get_branch - run: | - BRANCH=${GITHUB_REF/refs\/tags\//} - if ${{github.event_name == 'workflow_dispatch'}}; then - BRANCH=$(git describe --abbrev=0 --tags) - fi - echo "BRANCH=$(echo ${BRANCH} | cut -d '.' -f1-2 | tr -d 'v')" >> $GITHUB_OUTPUT - - - name: Create a github branch - uses: peterjgrainger/action-create-branch@v3.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - with: - branch: ${{ steps.get_branch.outputs.BRANCH }} - - - name: Commit changes to the minor branch - uses: EndBug/add-and-commit@v9 - with: - default_author: user_info - message: 'Update patch version' - new_branch: ${{ steps.get_branch.outputs.BRANCH }} - author_name: elasticcloudclients - author_email: elasticcloudclients@elastic.co - - bump-minor-version: - name: Bump main version - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - with: - ref: master - token: ${{ secrets.GH_TOKEN }} - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.22 - id: go - - - name: Bump main version - run: make minor; git diff - - - name: Commit changes to main - uses: EndBug/add-and-commit@v9 - with: - default_author: user_info - message: 'Update minor version' - new_branch: master - author_name: elasticcloudclients - author_email: elasticcloudclients@elastic.co diff --git a/CHANGELOG.md b/CHANGELOG.md index eab15ba7a..9e2fded55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ -# 0.11.0 (Unreleased) +# 0.12.0 (Unreleased) + +# 0.11.0 (August 29, 2024) FEATURES: diff --git a/Makefile b/Makefile index ea5160631..0eae4aa31 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL := /bin/bash export GO111MODULE ?= on -export VERSION := 0.11.0-dev +export VERSION := 0.12.0-dev export BINARY := terraform-provider-ec export GOBIN = $(shell pwd)/bin diff --git a/README.md b/README.md index ae14122c0..23fc6f73e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ terraform { required_providers { ec = { source = "elastic/ec" - version = "0.11.0" + version = "0.12.0" } } } diff --git a/build/Makefile.test b/build/Makefile.test index bf7c0f02e..be990d12a 100644 --- a/build/Makefile.test +++ b/build/Makefile.test @@ -39,11 +39,3 @@ ifndef BUILD_ID @ read -r -p "do you wish to continue? [y/N]: " res && if [[ "$${res:0:1}" =~ ^([yY]) ]]; then echo "-> Continuing..."; else exit 1; fi endif @ go test $(SWEEP_DIR) -v -sweep=$(SWEEP) $(SWEEPARGS) -timeout 60m - -.PHONY: testacc-ci -testacc-ci: - @ EC_API_KEY=$(shell cat .ci/.apikey) $(MAKE) testacc - -.PHONY: sweep-ci -sweep-ci: - @ EC_API_KEY=$(shell cat .ci/.apikey) SWEEPARGS=-sweep-run=$(SWEEP_CI_RUN_FILTER) $(MAKE) sweep diff --git a/developer_docs/RELEASE.md b/developer_docs/RELEASE.md index ac1637f41..aeae1b233 100644 --- a/developer_docs/RELEASE.md +++ b/developer_docs/RELEASE.md @@ -17,8 +17,6 @@ Releasing a new version implies that there have been changes in the source code ### Make sure `VERSION` is up to date -**Since the `VERSION` is now updated via github actions, just double check that it is updated, and if not, manually do so**. - Since the source has changed, we need to update the current committed version to a higher version so that the release is published. The version is currently defined in the [Makefile](./Makefile) as an exported environment variable called `VERSION` in the [SEMVER](https://semver.org) format: `MAJOR.MINOR.PATCH` @@ -54,7 +52,7 @@ When releasing patch versions, the changelog will be branched out in the minor b ### Ensure the NOTICE file is up-to-date -Run `make notice` to update the `NOTICE`. +Run `make vendor` to update the `NOTICE`. ## Executing the release @@ -63,4 +61,5 @@ After all the prerequisites have been ticked off, the only thing remaining is to ## Post release tasks - After the release has been completed, the next version header should be added in the changelog as `# (Unreleased)` at the top of the `CHANGELOG.md` file. +- The VERSION in the [Makefile](../Makefile) should be updated - The version in all examples should be updated to the next version to be released. diff --git a/ec/version.go b/ec/version.go index 3a6154353..a2886cb76 100644 --- a/ec/version.go +++ b/ec/version.go @@ -18,4 +18,4 @@ package ec // Version contains the current terraform provider version. -const Version = "0.11.0-dev" +const Version = "0.12.0-dev" diff --git a/examples/deployment_ccs/deployment.tf b/examples/deployment_ccs/deployment.tf index 6fe93c934..f7ca444b2 100644 --- a/examples/deployment_ccs/deployment.tf +++ b/examples/deployment_ccs/deployment.tf @@ -4,7 +4,7 @@ terraform { required_providers { ec = { source = "elastic/ec" - version = "0.11.0" + version = "0.12.0" } } } diff --git a/examples/deployment_ec2_instance/provider.tf b/examples/deployment_ec2_instance/provider.tf index 0e66f31c2..4f702931a 100644 --- a/examples/deployment_ec2_instance/provider.tf +++ b/examples/deployment_ec2_instance/provider.tf @@ -4,7 +4,7 @@ terraform { required_providers { ec = { source = "elastic/ec" - version = "0.11.0" + version = "0.12.0" } aws = { diff --git a/examples/deployment_with_init/provider.tf b/examples/deployment_with_init/provider.tf index 22b41d76b..a3608bdf6 100644 --- a/examples/deployment_with_init/provider.tf +++ b/examples/deployment_with_init/provider.tf @@ -4,7 +4,7 @@ terraform { required_providers { ec = { source = "elastic/ec" - version = "0.11.0" + version = "0.12.0" } } } diff --git a/examples/extension_bundle/extension.tf b/examples/extension_bundle/extension.tf index 649296fb7..03e22fab3 100644 --- a/examples/extension_bundle/extension.tf +++ b/examples/extension_bundle/extension.tf @@ -4,7 +4,7 @@ terraform { required_providers { ec = { source = "elastic/ec" - version = "0.11.0" + version = "0.12.0" } } }