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

Feature/external scmm #31

Merged
merged 36 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9dbe746
remove initscmm from postStart; make external scmm configurable
phaenr Mar 19, 2021
66f419b
add environment variables for scmm to jenkins
phaenr Mar 22, 2021
1654236
adjust config call to admin-user to apply external scm config
phaenr Mar 22, 2021
98a582b
Terraform: Switch to version prefix.
schnatterer Mar 22, 2021
77e35ef
adjust scm paths and call config after adjusting users
phaenr Mar 22, 2021
c348473
Terraform: Don't fail when gcloud not present
schnatterer Mar 22, 2021
3387aa2
Merge branch 'main' into feature/external_scmm
pmarkiewka Mar 22, 2021
e2005ad
Stick to default terraform.tfvars file that is loaded by default.
schnatterer Mar 23, 2021
102757c
Merge branch 'main' into feature/update-terraform
schnatterer Mar 23, 2021
1cdb602
merge cleanup
pmarkiewka Mar 23, 2021
3892f21
removes debugging
pmarkiewka Mar 23, 2021
fb93cf9
Merge remote-tracking branch 'origin/feature/external_scmm' into feat…
schnatterer Mar 23, 2021
360ea1f
apply.sh: Update jenkins job URLs
schnatterer Mar 23, 2021
04f7878
apply.sh: Add trace option.
schnatterer Mar 23, 2021
c4d2df1
apply.sh: Add --username option
schnatterer Mar 23, 2021
93a90b7
Jenkins REST client: Don't use API token.
schnatterer Mar 24, 2021
1e5a97d
Jenkins REST client: Don't use API token.
schnatterer Mar 24, 2021
f90abd2
remove anonymousMode for scmm; usage of a dev-branch gitops-build-lib
phaenr Mar 25, 2021
ab4491d
fixes --remote flag with external scmm; Implements url replacing in f…
pmarkiewka Mar 25, 2021
7ff5be9
Terraform: Refactor versions to versions.tf
schnatterer Mar 25, 2021
cbfe838
README: Describe "username" parameter
schnatterer Mar 25, 2021
6123185
Merge pull request #29 from cloudogu/feature/update-terraform
marekzan Mar 25, 2021
e166741
removes comment
pmarkiewka Mar 25, 2021
2b80115
fixes fluxv1/nginx pipeline to work with dynamic scmm url; fixes subs…
pmarkiewka Mar 25, 2021
f7c9e48
newest gitops build lib version
marekzan Mar 25, 2021
901b99e
Merge pull request #30 from cloudogu/feature/disable_anonymousMode_scmm
marekzan Mar 25, 2021
b8f92a6
removes comment from initJenkins execution
pmarkiewka Mar 25, 2021
b0adad9
implements setting of external url for scm-manager in all configurations
pmarkiewka Mar 29, 2021
262b0cd
implements configurable scmm root; fixes urls in pipelines; sets exte…
pmarkiewka Apr 1, 2021
1f5020e
sets argocd config repositories to skip tls verification with insecur…
pmarkiewka Apr 1, 2021
05aa0cd
Major refactoring during review.
schnatterer Apr 1, 2021
3244460
apply.sh: Make --trace imply --debug
schnatterer Apr 1, 2021
be92186
Fix REGISTRY_URL not set when run without --debug.
schnatterer Apr 1, 2021
0997bbe
apply.sh: Don't use getExternalIP() for external Jenkins or SCMM
schnatterer Apr 1, 2021
3a8b61f
apply.sh: Bring back setting default branch in SCMM.
schnatterer Apr 1, 2021
d3f646f
apply.sh: Fix internal registry not deployed
schnatterer Apr 1, 2021
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
2 changes: 2 additions & 0 deletions .curlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# allow it to connect without ssl verification
--insecure
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ gsutil iam ch \

##### Create cluster

Before continuing with the terraform steps, you have to open the `values.tfvars` file
Before continuing with the terraform steps, you have to open the `terraform.tfvars` file
and edit the `gce_project` value to your specific ID.

For local state `terraform init` suffices.
Expand All @@ -152,7 +152,7 @@ terraform init \

Apply infra:
```shell
terraform apply -var-file values.tfvars
terraform apply
```

terraform apply already adds an entry to your local `kubeconfig` and activate the context. That is calling
Expand Down Expand Up @@ -183,6 +183,7 @@ Use `./scripts/apply.sh --help` for more information.
Important options:
* `--remote` - deploy to remote cluster (not local k3s cluster), e.g. in GKE
* `--password` - change admin passwords for SCM-Manager, Jenkins and ArgoCD. Should be set with `--remote` for security
* `--username` - change admin passwords for SCM-Manager, Jenkins. Note that argo CD user cannot be changed and always is `admin`
reasons.
* `--argocd` - deploy only argoCD GitOps operator
* `--fluxv1` - deploy only Flux v1 GitOps operator
Expand Down Expand Up @@ -228,6 +229,17 @@ Find scm-manager on http://localhost:9091

Login with `admin/admin`

#### External SCM-Manager

You can set an external scm-manager server by providing the follow parameters:
`scmm-url`, `scmm-username`, `scmm-password`

The user on the scm has to have privileges to:
* add / edit users
* add / edit permissions
* add / edit repositories
* add / edit proxy

### ArgoCD UI

Find the ArgoCD UI on http://localhost:9092 (redirects to https://localhost:9093)
Expand Down
15 changes: 8 additions & 7 deletions applications/nginx/fluxv1/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

String getApplication() { "nginx" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/fluxv1/gitops" }
String getConfigRepositoryPRBaseUrl() { 'http://scmm-scm-manager/scm' }
String getConfigRepositoryUrl() { "${env.SCMM_URL}/repo/fluxv1/gitops" }
String getConfigRepositoryPRBaseUrl() { "${env.SCMM_URL}" }
String getConfigRepositoryPRRepo() { 'fluxv1/gitops' }
String getCesBuildLibRepo() { 'https://github.com/cloudogu/ces-build-lib/' } // TODO change back to scmm repo
String getCesBuildLibRepo() { "${env.SCMM_URL}/repo/common/ces-build-lib/" }
String getCesBuildLibVersion() { 'bugfix/location_for_prId' }
String getGitOpsBuildLibRepo() { 'https://github.com/cloudogu/gitops-build-lib' } // TODO change to scmm repo?
String getGitOpsBuildLibVersion() { '0.0.9' }
String getGitOpsBuildLibRepo() { "${env.SCMM_URL}/repo/common/gitops-build-lib" }
String getGitOpsBuildLibVersion() { '0.0.10' }
String getHelmChartRepository() { "https://charts.bitnami.com/bitnami" }
String getHelmChartName() { "nginx" }
String getHelmChartVersion() { "8.0.0" }
String getMainBranch() { 'main' }

cesBuildLib = library(identifier: "ces-build-lib@${cesBuildLibVersion}",
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo])
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo, credentialsId: scmManagerCredentials])
).com.cloudogu.ces.cesbuildlib

gitOpsBuildLib = library(identifier: "gitops-build-lib@${gitOpsBuildLibVersion}",
retriever: modernSCM([$class: 'GitSCMSource', remote: gitOpsBuildLibRepo])
retriever: modernSCM([$class: 'GitSCMSource', remote: gitOpsBuildLibRepo, credentialsId: scmManagerCredentials])
).com.cloudogu.gitops.gitopsbuildlib

properties([
Expand Down Expand Up @@ -49,6 +49,7 @@ node('docker') {
scmmPullRequestRepo: configRepositoryPRRepo,
cesBuildLibRepo: cesBuildLibRepo,
cesBuildLibVersion: cesBuildLibVersion,
cesBuildLibCredentialsId: scmManagerCredentials,
application: application,
mainBranch: mainBranch,
deployments: [
Expand Down
8 changes: 4 additions & 4 deletions applications/petclinic/argocd/plain-k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
// "Constants"
String getApplication() {"spring-petclinic-plain" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/argocd/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager/scm/api/v2/pull-requests/argocd/gitops' }
String getConfigRepositoryUrl() { "${env.SCMM_URL}/repo/argocd/gitops" }
String getConfigRepositoryPRUrl() { "${env.SCMM_URL}/api/v2/pull-requests/argocd/gitops" }
// The docker daemon cant use the k8s service name, because it is not running inside the cluster
String getDockerRegistryBaseUrl() { "${env.REGISTRY_URL}" }
String getDockerRegistryPath() { "${env.REGISTRY_PATH}" }
String getDockerRegistryCredentials() { 'registry-user' }
String getCesBuildLibVersion() { '1.44.3' }
String getCesBuildLibRepo() { 'https://github.com/cloudogu/ces-build-lib/' }
String getCesBuildLibRepo() { "${env.SCMM_URL}/repo/common/ces-build-lib/" }
String getMainBranch() { 'main' }

cesBuildLib = library(identifier: "ces-build-lib@${cesBuildLibVersion}",
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo])
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo, credentialsId: scmManagerCredentials])
).com.cloudogu.ces.cesbuildlib

properties([
Expand Down
21 changes: 11 additions & 10 deletions applications/petclinic/fluxv1/helm/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

String getApplication() { "spring-petclinic-helm" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/fluxv1/gitops" }
String getConfigRepositoryPRBaseUrl() { 'http://scmm-scm-manager/scm' }
String getConfigRepositoryUrl() { "${env.SCMM_URL}/repo/fluxv1/gitops" }
String getConfigRepositoryPRBaseUrl() { "${env.SCMM_URL}" }
String getConfigRepositoryPRRepo() { 'fluxv1/gitops' }
// The docker daemon cant use the k8s service name, because it is not running inside the cluster
String getDockerRegistryBaseUrl() { "${env.REGISTRY_URL}" }
String getDockerRegistryPath() { "${env.REGISTRY_PATH}" }
String getDockerRegistryCredentials() { 'registry-user' }
String getCesBuildLibRepo() { 'http://scmm-scm-manager/scm/repo/common/ces-build-lib/' }
String getCesBuildLibRepo() { "${env.SCMM_URL}/repo/common/ces-build-lib/" }
String getCesBuildLibVersion() { '1.45.1' }
String getGitOpsBuildLibRepo() { 'http://scmm-scm-manager/scm/repo/common/gitops-build-lib' }
String getGitOpsBuildLibVersion() { '0.0.9' }
String getHelmChartRepository() { 'http://scmm-scm-manager.default.svc.cluster.local/scm/repo/common/spring-boot-helm-chart' }
String getGitOpsBuildLibRepo() { "${env.SCMM_URL}/repo/common/gitops-build-lib" }
String getGitOpsBuildLibVersion() { '0.0.10' }
String getHelmChartRepository() { "${env.SCMM_URL}/repo/common/spring-boot-helm-chart" }
String getHelmChartVersion() { "1.0.0" }
String getMainBranch() { 'main' }

cesBuildLib = library(identifier: "ces-build-lib@${cesBuildLibVersion}",
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo])
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo, credentialsId: scmManagerCredentials])
).com.cloudogu.ces.cesbuildlib

gitOpsBuildLib = library(identifier: "gitops-build-lib@${gitOpsBuildLibVersion}",
retriever: modernSCM([$class: 'GitSCMSource', remote: gitOpsBuildLibRepo])
retriever: modernSCM([$class: 'GitSCMSource', remote: gitOpsBuildLibRepo, credentialsId: scmManagerCredentials])
).com.cloudogu.gitops.gitopsbuildlib

properties([
Expand Down Expand Up @@ -76,13 +76,14 @@ node {
scmmPullRequestRepo: configRepositoryPRRepo,
cesBuildLibRepo: cesBuildLibRepo,
cesBuildLibVersion: cesBuildLibVersion,
cesBuildLibCredentialsId: scmManagerCredentials,
application: application,
mainBranch: mainBranch,
deployments: [
sourcePath: 'k8s',
helm : [
repoType : 'GIT',
credentialsId : 'creds',
credentialsId : scmManagerCredentials,
repoUrl : helmChartRepository,
version : helmChartVersion,
updateValues : [[fieldPath: "image.name", newValue: imageName]]
Expand All @@ -94,7 +95,7 @@ node {
],
'fluxv1-production': [:]
],
fileConfigmaps: [
fileConfigmaps: [
[
name : "index-helm",
sourceFilePath : "../index.html",
Expand Down
15 changes: 8 additions & 7 deletions applications/petclinic/fluxv1/plain-k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
// "Constants"
String getApplication() {"spring-petclinic-plain" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/fluxv1/gitops" }
String getConfigRepositoryPRBaseUrl() { 'http://scmm-scm-manager/scm' }
String getConfigRepositoryUrl() { "${env.SCMM_URL}/repo/fluxv1/gitops" }
String getConfigRepositoryPRBaseUrl() { "${env.SCMM_URL}" }
String getConfigRepositoryPRRepo() { 'fluxv1/gitops' }
// The docker daemon cant use the k8s service name, because it is not running inside the cluster
String getDockerRegistryBaseUrl() { "${env.REGISTRY_URL}" }
String getDockerRegistryPath() { "${env.REGISTRY_PATH}" }
String getDockerRegistryCredentials() { 'registry-user' }
String getCesBuildLibRepo() { 'http://scmm-scm-manager/scm/repo/common/ces-build-lib/' }
String getCesBuildLibRepo() { "${env.SCMM_URL}/repo/common/ces-build-lib/" }
String getCesBuildLibVersion() { '1.45.1' }
String getGitOpsBuildLibRepo() { 'http://scmm-scm-manager/scm/repo/common/gitops-build-lib' }
String getGitOpsBuildLibVersion() { '0.0.9' }
String getGitOpsBuildLibRepo() { "${env.SCMM_URL}/repo/common/gitops-build-lib" }
String getGitOpsBuildLibVersion() { '0.0.10' }
String getMainBranch() { 'main' }

cesBuildLib = library(identifier: "ces-build-lib@${cesBuildLibVersion}",
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo])
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo, credentialsId: scmManagerCredentials])
).com.cloudogu.ces.cesbuildlib

gitOpsBuildLib = library(identifier: "gitops-build-lib@${gitOpsBuildLibVersion}",
retriever: modernSCM([$class: 'GitSCMSource', remote: gitOpsBuildLibRepo])
retriever: modernSCM([$class: 'GitSCMSource', remote: gitOpsBuildLibRepo, credentialsId: scmManagerCredentials])
).com.cloudogu.gitops.gitopsbuildlib

properties([
Expand Down Expand Up @@ -76,6 +76,7 @@ node {
scmmPullRequestRepo: configRepositoryPRRepo,
cesBuildLibRepo: cesBuildLibRepo,
cesBuildLibVersion: cesBuildLibVersion,
cesBuildLibCredentialsId: scmManagerCredentials,
application: application,
mainBranch: mainBranch,
deployments: [
Expand Down
8 changes: 4 additions & 4 deletions applications/petclinic/fluxv2/plain-k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
// "Constants"
String getApplication() {"spring-petclinic-plain" }
String getScmManagerCredentials() { 'scmm-user' }
String getConfigRepositoryUrl() { "http://scmm-scm-manager/scm/repo/fluxv2/gitops" }
String getConfigRepositoryPRUrl() { 'http://scmm-scm-manager/scm/api/v2/pull-requests/fluxv2/gitops' }
String getConfigRepositoryUrl() { "${env.SCMM_URL}/repo/fluxv2/gitops" }
String getConfigRepositoryPRUrl() { "${env.SCMM_URL}/api/v2/pull-requests/fluxv2/gitops" }
// The docker daemon cant use the k8s service name, because it is not running inside the cluster
String getDockerRegistryBaseUrl() { "${env.REGISTRY_URL}" }
String getDockerRegistryPath() { "${env.REGISTRY_PATH}" }
String getDockerRegistryCredentials() { 'registry-user' }
String getCesBuildLibVersion() { '1.44.3' }
String getCesBuildLibRepo() { 'https://github.com/cloudogu/ces-build-lib/' }
String getCesBuildLibRepo() { "${env.SCMM_URL}/repo/common/ces-build-lib/" }

cesBuildLib = library(identifier: "ces-build-lib@${cesBuildLibVersion}",
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo])
retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo, credentialsId: scmManagerCredentials])
).com.cloudogu.ces.cesbuildlib

properties([
Expand Down
3 changes: 3 additions & 0 deletions argocd/control-app/general/argocd-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ metadata:
data:
repositories: |
- url: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/gitops
insecure: true
passwordSecret:
name: gitops-scmm
key: PASSWORD
usernameSecret:
name: gitops-scmm
key: USERNAME
- url: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/control-app
insecure: true
passwordSecret:
name: gitops-scmm
key: PASSWORD
usernameSecret:
name: gitops-scmm
key: USERNAME
- url: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/nginx-helm
insecure: true
passwordSecret:
name: gitops-scmm
key: PASSWORD
Expand Down
1 change: 1 addition & 0 deletions argocd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ server:
config:
repositories: |
- url: http://scmm-scm-manager.default.svc.cluster.local/scm/repo/argocd/control-app
insecure: true
passwordSecret:
name: gitops-scmm
key: PASSWORD
Expand Down
119 changes: 0 additions & 119 deletions scm-manager/initscmm.sh

This file was deleted.

Loading