Skip to content

Commit

Permalink
Merge branch 'master' into project-template-support
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmet2mir authored Jun 15, 2020
2 parents 28e564f + 05676fe commit dc76c5b
Show file tree
Hide file tree
Showing 870 changed files with 35,558 additions and 178,259 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -text
68 changes: 68 additions & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Acceptance Tests
on: [push,pull_request]

jobs:
acceptance-ce:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Check out code repository source code
uses: actions/checkout@v2

# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions
- name: Set build variables
run: |
echo "::set-env name=MAKE_TARGET::testacc"
echo "::set-env name=GO_FLAGS::-mod=vendor"
echo "::set-env name=GO111MODULE::on"
echo "::set-env name=GITLAB_TOKEN::20char-testing-token"
echo "::set-env name=GITLAB_BASE_URL::http://127.0.0.1:8080/api/v4"
- name: Start Gitlab and run acceptance tests
run: |
bash scripts/start-gitlab.sh
make $MAKE_TARGET
acceptance-ee:
timeout-minutes: 60
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Check out code repository source code
uses: actions/checkout@v2

- name: Set up Enterprise Edition License file
run: |
openssl version
mkdir license
[[ -n "${{ secrets.ENCRYPT_PASSWORD }}" ]] && echo decrypt
[[ -n "${{ secrets.ENCRYPT_PASSWORD }}" ]] && openssl enc -d -aes-256-cbc -pbkdf2 -iter 20000 -in Gitlab-license.encrypted -out license/Gitlab-license.txt -pass "pass:${{ secrets.ENCRYPT_PASSWORD }}"
chmod 666 license/Gitlab-license.txt || true
echo "::set-env name=GITLAB_LICENSE_FILE::Gitlab-license.txt"
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions
- name: Set build variables
run: |
echo "::set-env name=MAKE_TARGET::testacc"
echo "::set-env name=GO_FLAGS::-mod=vendor"
echo "::set-env name=GO111MODULE::on"
echo "::set-env name=GITLAB_TOKEN::20char-testing-token"
echo "::set-env name=GITLAB_BASE_URL::http://127.0.0.1:8080/api/v4"
echo "::set-env name=TF_LOG::DEBUG"
- name: Start Gitlab and run acceptance tests
run: |
bash scripts/start-gitlab.sh
make $MAKE_TARGET
33 changes: 33 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Unit Tests
on: [push,pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
go: [1.13, 1.14]
os: [ubuntu-latest, macos-latest, windows-latest]
make_target: [test, vet]

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
id: go

- name: Check out code repository source code
uses: actions/checkout@v2

# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions
- name: Set build variables
run: |
echo "::set-env name=MAKE_TARGET::${{ matrix.make_target }}"
echo "::set-env name=GO_FLAGS::-mod=vendor"
echo "::set-env name=GO111MODULE::on"
- name: Run ${{matrix.make_target}}
run: |
make $MAKE_TARGET
33 changes: 33 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Website Build
on: [push,pull_request]

jobs:
website:
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions
- name: Set Go variables for backwards compatibility
run: |
echo "::set-env name=GOPATH::$GITHUB_WORKSPACE/go"
echo "::set-env name=GOBIN::$GITHUB_WORKSPACE/go/bin"
echo "::add-path::$GITHUB_WORKSPACE/go/bin"
- name: Check out code repository source code
uses: actions/checkout@v2
with:
path: go/src/github.com/${{ github.repository }}

- name: Run website-test
run: |
cd $GOPATH/src/github.com/${{ github.repository }}
export MAKE_TARGET=${{ matrix.make_target }}
export GOFLAGS=-mod=vendor
export GO111MODULE=on
make website-test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ website/vendor
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/

license/JulienPivotto.gitlab-license
license/*
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.5
1.14.1
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

72 changes: 71 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,74 @@
## 2.5.1 (Unreleased)
## 2.11.0 (Unreleased)
## 2.10.0 (June 09, 2020)

FEATURES:
* **New Resource:** `gitlab_service_github`
([#311](https://github.com/terraform-providers/terraform-provider-gitlab/issues/311))

ENHANCEMENTS:
* add attribute remove_source_branch_after_merge to projects
([#289](https://github.com/terraform-providers/terraform-provider-gitlab/issues/289))

BUGFIXES:
* fix for flaky `gitlab_group` tests
([#320](https://github.com/terraform-providers/terraform-provider-gitlab/issues/320))
* Creating custom skip function for group_ldap_link tests.
([#328](https://github.com/terraform-providers/terraform-provider-gitlab/issues/328))

## 2.9.0 (June 01, 2020)

FEATURES:
* **New DataSource:** `gitlab_projects`
([#279](https://github.com/terraform-providers/terraform-provider-gitlab/issues/279))
* **New Resource:** `gitlab_deploy_token`
([#284](https://github.com/terraform-providers/terraform-provider-gitlab/issues/284))

ENHANCEMENTS:
* Add `management_project_id` for Group and Project Clusters
([#301](https://github.com/terraform-providers/terraform-provider-gitlab/issues/301))

## 2.8.0 (May 28, 2020)

FEATURES:
* **New Resource:** `gitlab_group_ldap_link`
([#296](https://github.com/terraform-providers/terraform-provider-gitlab/issues/296),
[#316](https://github.com/terraform-providers/terraform-provider-gitlab/issues/316))

ENHANCEMENTS:

* Update resource gitlab_group_label to read labels from all pages
([#302](https://github.com/terraform-providers/terraform-provider-gitlab/issues/302))
* Provide a way to specify client cert and key
([#315](https://github.com/terraform-providers/terraform-provider-gitlab/issues/315))

BUGFIXES:
* Increase MaxIdleConnsPerHost in http.Transport
([#305](https://github.com/terraform-providers/terraform-provider-gitlab/issues/305))

## 2.7.0 (May 20, 2020)

* Implement `masked` parameters for `gitlab_group_variable`
([#271](https://github.com/terraform-providers/terraform-provider-gitlab/issues/271))

## 2.6.0 (April 08, 2020)

ENHANCEMENTS:
* Add jira flags
([#274](https://github.com/terraform-providers/terraform-provider-gitlab/issues/274))

## 2.5.1 (April 06, 2020)

BUGFIXES:
* Support for soft-delete of groups and projects in Gitlab Enterprise Edition
([#282](https://github.com/terraform-providers/terraform-provider-gitlab/issues/282),
[#283](https://github.com/terraform-providers/terraform-provider-gitlab/issues/283),
[#285](https://github.com/terraform-providers/terraform-provider-gitlab/issues/285),
[#291](https://github.com/terraform-providers/terraform-provider-gitlab/issues/291))

ENHANCEMENTS:
* Switched from Travis CI to Github Actions
([#216](https://github.com/terraform-providers/terraform-provider-gitlab/issues/216))

## 2.5.0 (December 05, 2019)

ENHANCEMENTS:
Expand Down
10 changes: 8 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TEST?=$$(go list ./... |grep -v 'vendor')
TEST?=./gitlab
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=gitlab
Expand All @@ -13,8 +13,14 @@ test: fmtcheck
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc-prepareenv:
MAKE_TARGET=testacc GITLAB_TOKEN=ACCTEST LC_ALL=en_US sh -c "'$(CURDIR)/scripts/start-gitlab.sh'"

testacc-cleanenv:
docker stop gitlab

testacc: fmtcheck
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
TF_ACC=1 go test -v $(TEST) $(TESTARGS) -timeout 40m

vet:
@echo "go vet ."
Expand Down
Binary file added Gitlab-license.encrypted
Binary file not shown.
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
Terraform Provider
==================
<img src="https://cdn.rawgit.com/hashicorp/terraform-website/master/content/source/assets/images/logo-hashicorp.svg" width="600px">

Terraform Provider for Gitlab
=============================

- Website: https://www.terraform.io
- [Documentation](https://www.terraform.io/docs/providers/gitlab/index.html)
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)

<img src="https://cdn.rawgit.com/hashicorp/terraform-website/master/content/source/assets/images/logo-hashicorp.svg" width="600px">
- Build status:
- ![Unit Tests](https://github.com/terraform-providers/terraform-provider-gitlab/workflows/Unit%20Tests/badge.svg?branch=master)
- ![Acceptance Tests](https://github.com/terraform-providers/terraform-provider-gitlab/workflows/Acceptance%20Tests/badge.svg?branch=master)
- ![Website Build](https://github.com/terraform-providers/terraform-provider-gitlab/workflows/Website%20Build/badge.svg?branch=master)

Requirements
------------

- [Terraform](https://www.terraform.io/downloads.html) 0.10.x
- [Go](https://golang.org/doc/install) 1.11 (to build the provider plugin)
- [Terraform](https://www.terraform.io/downloads.html) 0.12.x
- [Go](https://golang.org/doc/install) >= 1.13 (to build the provider plugin)

Building The Provider
---------------------
Expand All @@ -34,10 +38,9 @@ Using the provider
----------------------
## Fill in for each provider

Developing the Provider
---------------------------
# Developing the Provider

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.11+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.14+ is *required*).

To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

Expand All @@ -49,7 +52,8 @@ $ $GOPATH/bin/terraform-provider-gitlab
```

### Running tests
The Terraform Provider only has acceptance tests, these can run against a gitlab instance where you have a token with administrator permissions (likely not gitlab.com).

The Terraform Provider only has acceptance tests, these can run against a gitlab instance where you have a token with administrator permissions (likely not gitlab.com).
There is excellent documentation on [how to run gitlab from docker at gitlab.com](https://docs.gitlab.com/omnibus/docker/)

In order to run the full suite of acceptance tests, export the environment variables:
Expand All @@ -62,3 +66,13 @@ and run `make testacc`.
```sh
$ make testacc
```

### Gitlab Community Edition and Gitlab Entreprise Edition

This module supports both Gitlab CE and Gitlab EE. We run tests on Gitlab EE,
but can't run them on pull requests from forks.

Features that only work on one flavour can use the following helpers as
SkipFunc: `isRunningInEE` and `isRunningInCE`. You can see an exemple of this
for [gitlab_project_push_rules](gitlab/resource_gitlab_project_push_rules_test.go)
tests.
Loading

0 comments on commit dc76c5b

Please sign in to comment.