Commit 5d1e98a5 authored by Andrew Newdigate's avatar Andrew Newdigate

Validate whitespace

This change adds a `.editorconfig` for GDK, to help keep whitespace
under control. It also adds `make verify` and `make fix` tasks to
verify and fix.

An additional CI task, for ensuring that the rules are in-compliance
has been added.

The ruleset is designed not to impact projects hosted in
subdirectories, which is how GDK is designed to operate.
parent a9289f42
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 2
indent_style = space
# Matches multiple files with brace expansion notation
# Set default charset
[**/*.rb]
charset = utf-8
# Protect the ascii-art!
[lib/run.rb]
end_of_line = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
indent_size = unset
indent_style = unset
# Tab indentation (no size specified)
[Makefile]
indent_style = tab
indent_size = unset
[GDK_ROOT]
end_of_line = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
indent_size = unset
indent_style = unset
[**/.gitkeep]
end_of_line = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
indent_size = unset
indent_style = unset
[**/*.md]
indent_size = unset
# ----------------------------------------------------------------------
# This rule should always stay at the bottom for greatest precendence
# ----------------------------------------------------------------------
# Don't apply these rules to any nested projects
[{gitlab,go-gitlab-shell,gitaly,gitlab-docs,gitlab-workhorse,gitlab-pages}/**]
indent_style = unset
indent_size = unset
tab_width = unset
end_of_line = unset
max_line_length = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
......@@ -56,6 +56,13 @@ container_scanning:
paths:
- gl-sast-container-report.json
# Use eclint to check that the .editorconfig rulesets are being adhered to
verify:
stage: build
image: registry.gitlab.com/gitlab-org/gitlab-build-images:node-10
script:
- npm config set unsafe-perm true # enable run npm as root
- make verify
build:image:
image: docker:git
......
......@@ -246,7 +246,7 @@ update: ensure-postgres-running unlock-dependency-installers gitlab-shell-update
ensure-postgres-running:
@test -f ${postgres_data_dir}/postmaster.pid || \
test "${IGNORE_INSTALL_WARNINGS}" = "true" || \
(echo "WARNING: Postgres is not running. Run 'gdk run db' or 'gdk run' in another shell." && echo "WARNING: Hit <ENTER> to ignore or <CTRL-C> to quit." && read v;)
(echo "WARNING: Postgres is not running. Run 'gdk run db' or 'gdk run' in another shell." && echo "WARNING: Hit <ENTER> to ignore or <CTRL-C> to quit." && read v;)
gitlab-update: ensure-postgres-running gitlab/.git/pull gitlab-setup
cd ${gitlab_development_root}/gitlab && \
......@@ -569,13 +569,13 @@ minio/data/%:
pry:
grep '^#rails-web:' Procfile || (printf ',s/^rails-web/#rails-web/\nwq\n' | ed -s Procfile)
@echo ""
@echo "Commented out 'rails-web' line in the Procfile. Use 'make pry-off' to reverse."
@echo "Commented out 'rails-web' line in the Procfile. Use 'make pry-off' to reverse."
@echo "You can now use Pry for debugging by using 'gdk run' in one terminal, and 'gdk run thin' in another."
pry-off:
grep '^rails-web:' Procfile || (printf ',s/^#rails-web/rails-web/\nwq\n' | ed -s Procfile)
@echo ""
@echo "Re-enabled 'rails-web' in the Procfile. Debugging with Pry will no longer work."
@echo "Re-enabled 'rails-web' in the Procfile. Debugging with Pry will no longer work."
ifeq ($(jaeger_server_enabled),true)
.PHONY: jaeger-setup
......@@ -621,3 +621,25 @@ unlock-dependency-installers:
.gitlab-shell-bundle \
.gitlab-yarn \
.gettext \
.PHONY: verify
verify: verify-editorconfig
.PHONY: verify-editorconfig
verify-editorconfig: install-eclint
eclint check $$(git ls-files) || (echo "editorconfig check failed. Please run \`make correct\`" && exit 1)
.PHONY: correct
correct: correct-editorconfig
.PHONY: correct-editorconfig
correct-editorconfig: install-eclint
eclint fix $$(git ls-files)
.PHONY: install-eclint
install-eclint:
# Some distros come with `npm`, some with `yarn`
# So, we attempt to install eclint with either package manager
(command -v eclint > /dev/null) || \
((command -v npm > /dev/null) && npm install -g eclint) || \
((command -v yarn > /dev/null) && yarn global add eclint)
......@@ -14,8 +14,8 @@ VAGRANTFILE_API_VERSION = "2".freeze
def enable_shares(config, nfs)
# paths must be listed as shortest to longest per bug: https://github.com/GM-Alex/vagrant-winnfsd/issues/12#issuecomment-78195957
config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__exclude: ['gitlab', 'postgresql', 'gitlab-shell', 'gitlab-runner', 'gitlab-workhorse'],
rsync__auto: false
rsync__exclude: ['gitlab', 'postgresql', 'gitlab-shell', 'gitlab-runner', 'gitlab-workhorse'],
rsync__auto: false
config.vm.synced_folder "gitlab/", "/vagrant/gitlab", create: true, nfs: nfs
config.vm.synced_folder "go-gitlab-shell/", "/vagrant/go-gitlab-shell", create: true, nfs: nfs
config.vm.synced_folder "gitlab-runner/", "/vagrant/gitlab-runner", create: true, nfs: nfs
......@@ -89,9 +89,9 @@ $user_setup = <<EOT
# automatically move into the gitlab-development-kit folder, but only add the command
# if it's not already there
if [ -f /home/$DEV_USER/.bash_profile ]; then
sudo -u $DEV_USER -i bash -c "grep -q \"cd /home/$DEV_USER/gitlab-development-kit/\" /home/$DEV_USER/.bash_profile || echo \"cd /home/$DEV_USER/gitlab-development-kit/\" >> /home/$DEV_USER/.bash_profile"
sudo -u $DEV_USER -i bash -c "grep -q \"cd /home/$DEV_USER/gitlab-development-kit/\" /home/$DEV_USER/.bash_profile || echo \"cd /home/$DEV_USER/gitlab-development-kit/\" >> /home/$DEV_USER/.bash_profile"
else
sudo -u $DEV_USER -i bash -c "touch /home/$DEV_USER/.bash_profile && echo \"cd /home/$DEV_USER/gitlab-development-kit/\" >> /home/$DEV_USER/.bash_profile"
sudo -u $DEV_USER -i bash -c "touch /home/$DEV_USER/.bash_profile && echo \"cd /home/$DEV_USER/gitlab-development-kit/\" >> /home/$DEV_USER/.bash_profile"
fi
# set up gdk
......
......@@ -48,4 +48,3 @@ if ! (echo "$sha $download_path" | shasum -a1 -c -); then
>&2 echo "cannot verify jaeger binary: sha checksum mismatch."
exit 1
fi
......@@ -10,17 +10,17 @@ depends on our infrastructure. For non-GitLab employees you can see
[Alternatives](#alternatives) below.
1. Request GCP permission and SSH tunnel by
[creating an access request](https://gitlab.com/gitlab-com/access-requests/issues/new).
You can use
[this issue](https://gitlab.com/gitlab-com/access-requests/issues/382) as an
example.
You need to request:
- IAM permission on GCP for `roles/container.admin` role for.
`gitlab-internal-153318` GCP project
- server access for `qa-tunnel.gitlab.info` and provide
them with your SSH public key.
[creating an access request](https://gitlab.com/gitlab-com/access-requests/issues/new).
You can use
[this issue](https://gitlab.com/gitlab-com/access-requests/issues/382) as an
example.
You need to request:
- IAM permission on GCP for `roles/container.admin` role for.
`gitlab-internal-153318` GCP project
- server access for `qa-tunnel.gitlab.info` and provide
them with your SSH public key.
1. Once your account has been created, configure your SSH config `~/.ssh/config` to set the correct username.
......@@ -32,14 +32,14 @@ depends on our infrastructure. For non-GitLab employees you can see
1. Verify you have `ssh` access into `qa-tunnel.gitlab.info`:
```bash
ssh qa-tunnel.gitlab.info
> Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.13.0-1019-gcp x86_64)
```
ssh qa-tunnel.gitlab.info
> Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.13.0-1019-gcp x86_64)
```
If you're able to log in [without entering your passphrase](doc/howto/auto_devops/tips_and_troubleshooting.md#ssh-requires-a-passphrase), it means you can move on to the next step.
If you're able to log in [without entering your passphrase](doc/howto/auto_devops/tips_and_troubleshooting.md#ssh-requires-a-passphrase), it means you can move on to the next step.
1. Set up the GDK for your workstation following [the preparation
instructions](../prepare.md) and [setup instructions](../set-up-gdk.md)
instructions](../prepare.md) and [setup instructions](../set-up-gdk.md)
NOTE: Running Auto DevOps flow [downloads/uploads gigabytes of data on each
run](#massive-bandwidth-used-by-auto-devops). For this reason it is not a good
......@@ -494,13 +494,13 @@ deleted clusters.
You can find and delete any unused load balancers following these steps:
1. Open [The Load Balancers
page](https://console.cloud.google.com/net-services/loadbalancing/loadBalancers/list?filter=%255B%257B_22k_22_3A_22Protocol_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22TCP_5C_22_22%257D%255D)
in the GCP console
page](https://console.cloud.google.com/net-services/loadbalancing/loadBalancers/list?filter=%255B%257B_22k_22_3A_22Protocol_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22TCP_5C_22_22%257D%255D)
in the GCP console
1. Open every one of the TCP load balancers in new tabs
1. Check through every tab for the yellow warning next to the nodes list saying
the nodes they point to no longer exist
the nodes they point to no longer exist
1. Delete the load balancer if it has no green ticks and only yellow warnings
about nodes no longer existing
about nodes no longer existing
### Unused Persistent Disks
......@@ -512,14 +512,14 @@ the unused orphaned persistent disks from deleted clusters.
You can find and delete any unused persistent disks following these steps:
1. Open [Compute Engine Disks page](https://console.cloud.google.com/compute/disks?diskssize=200&disksquery=%255B%257B_22k_22_3A_22userNames_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22%27%27_5C_22_22%257D%255D)
in the GCP console
in the GCP console
1. Be sure you are filtered by `In use by: ''` and you should also notice the
`In use by` column is empty to verify they are not in use
`In use by` column is empty to verify they are not in use
1. Search this list for a `Name` that matches how you were naming your
clusters. For example a cluster called `mycluster` would end up with
persistent disks named `gke-mycluster-pvc-<random-suffix>`. If they match
the name you are expecting and they are not in use it is safe to delete
them.
clusters. For example a cluster called `mycluster` would end up with
persistent disks named `gke-mycluster-pvc-<random-suffix>`. If they match
the name you are expecting and they are not in use it is safe to delete
them.
NOTE: When [running the integration test](#run-the-integration-test) it is
creating clusters named `qa-cluster-<timestamp>-<random-suffix>`. As such it is
......
......@@ -150,4 +150,4 @@ Note that we stopped using `--client-only`, but instead we added the tls flags:
- `--tls-cert /tmp/cert.pem`
- `--tls-key /tmp/key.pem`
and the `--tiller-namespace=gitlab-managed-apps` flag.
\ No newline at end of file
and the `--tiller-namespace=gitlab-managed-apps` flag.
......@@ -13,4 +13,4 @@ may take a few seconds for GitLab to boot in development mode. Once
the sign-in page is there, log in with user `root` and password
`5iveL!fe`.
You can shut down GDK in your terminal with Ctrl-C.
\ No newline at end of file
You can shut down GDK in your terminal with Ctrl-C.
......@@ -25,14 +25,14 @@ run db` processes.
1. Start Elasticsearch by either running `elasticsearch` in a new terminal, or
by adding it to your `Procfile`:
```
elasticsearch: elasticsearch
```
```
elasticsearch: elasticsearch
```
1. Be sure to restart the GDK's `foreman` instance if it's running.
1. Perform a manual update of the Elasticsearch indexes:
```sh
cd gitlab-ee && bundle exec rake gitlab:elastic:index
```
```sh
cd gitlab-ee && bundle exec rake gitlab:elastic:index
```
......@@ -171,7 +171,7 @@ Same as `geo_primary_migrate`, but also:
* Updates dependencies (e.g. if Gitaly is erroring)
* Rebuilds FDW tables in test DB
* Checks out schemas to get rid of irrelevant diffs (not done in
`geo_primary_migrate` because you may have created a migration)
`geo_primary_migrate` because you may have created a migration)
### `geo_secondary_migrate`
......@@ -209,7 +209,7 @@ test DB, and this error occurs on the very last step of `gdk update`.
```bash
cd /Users/foo/Developer/gdk-geo/gitlab && \
bundle exec rake db:migrate db:test:prepare
bundle exec rake db:migrate db:test:prepare
rake aborted!
ActiveRecord::StatementInvalid: PG::ReadOnlySqlTransaction: ERROR: cannot execute DROP DATABASE in a read-only transaction
: DROP DATABASE IF EXISTS "gitlabhq_test"
......
......@@ -6,7 +6,7 @@
1. Click "Create credentials" > "Oauth Client ID"
1. Choose "Web application" as Application type
1. Fill the form with application name
1. Fill in following URLs in "Authorized redirect URIs"
1. Fill in following URLs in "Authorized redirect URIs"
- http://localhost:3000/users/auth/google_oauth2/callback # For Oauth2 Login
- http://localhost:3000/-/google_api/auth/callback # For GKE Cluster Integration
1. Click "Create" button
......@@ -17,14 +17,14 @@
1. Configure gitlab/config/gitlab.yml
```yml
development:
<<: *base
omniauth:
providers:
- { name: 'google_oauth2',
app_id: 'Here is your Client ID',
app_secret: 'Here is your Client secret',
args: { access_type: 'offline', approval_prompt: '' } }
development:
<<: *base
omniauth:
providers:
- { name: 'google_oauth2',
app_id: 'Here is your Client ID',
app_secret: 'Here is your Client secret',
args: { access_type: 'offline', approval_prompt: '' } }
```
......
......@@ -73,13 +73,13 @@ with Kubernetes components.
For MacOS:
```
minikube start --vm-driver hyperkit --disk-size=20g
minikube start --vm-driver hyperkit --disk-size=20g
```
For Linux:
```
minikube start --vm-driver kvm2 --disk-size=20g
minikube start --vm-driver kvm2 --disk-size=20g
```
### Open the Kubernetes Dashboard
......@@ -107,9 +107,9 @@ This is because GDK returns this information to the Runner, and if it is wrong,
pipelines will fail.
1. Get your local IP address by running `ifconfig` or opening up Network Settings
if on macOS. On Linux you can also use `ip addr show`.
if on macOS. On Linux you can also use `ip addr show`.
1. Open `gitlab/config/gitlab.yml` and change the `host: localhost` line to
reflect the IP of the previous step.
reflect the IP of the previous step.
1. Save the file and restart GDK to apply this change.
You should now be able to access GitLab by the external URL
......@@ -126,11 +126,11 @@ CI/CD pipeline with no requirements, based on AutoDevOps. It contains just the `
## Allow requests to the local network
We have CSRF protection in place on the cluster url, so if we try to connect minikube now, we'll get
a `Requests to the local network are not allowed` error. The below steps will disable this protection
We have CSRF protection in place on the cluster url, so if we try to connect minikube now, we'll get
a `Requests to the local network are not allowed` error. The below steps will disable this protection
for use with minikube.
1. As root user, navigate to **Admin Area** (the little wrench in the top nav) > **Settings** > **Network**.
1. As root user, navigate to **Admin Area** (the little wrench in the top nav) > **Settings** > **Network**.
1. Expand the **Outbound requests** section, check the box to *Allow requests to the local network from hooks and services*, and save your changes.
## Connect your cluster
......@@ -167,7 +167,7 @@ kubectl create clusterrolebinding permissive-binding \
## Deploy Helm Tiller, Prometheus, and GitLab Runner
Back in the GDK on the cluster screen, you should now be able to deploy Helm Tiller. Once complete, also deploy a Runner and Prometheus.
Back in the GDK on the cluster screen, you should now be able to deploy Helm Tiller. Once complete, also deploy a Runner and Prometheus.
If you get an error about an API token not yet being created, wait a minute or two and try again.
......
......@@ -19,4 +19,4 @@ Then launch GDK as usual (e.g. with `gdk run`) and in a separate
terminal run: `gdk run thin`. Your Pry prompts will appear in the window
that runs Thin.
**Note**: It's not possible to submit commits from the web without at least two `unicorn` servers running. Which means when running `thin` for debugging, actions such as creating a file from the web will time out. See [Use GitLab with only 1 Unicorn worker?](https://gitlab.com/gitlab-org/gitlab-ce/issues/18771)
\ No newline at end of file
**Note**: It's not possible to submit commits from the web without at least two `unicorn` servers running. Which means when running `thin` for debugging, actions such as creating a file from the web will time out. See [Use GitLab with only 1 Unicorn worker?](https://gitlab.com/gitlab-org/gitlab-ce/issues/18771)
......@@ -14,4 +14,3 @@ gdk reconfigure
Registry port defaults to `5000` but it can be changed writing the desired value
in `registry_port`.
Changing either registry or GitLab port number requires `gdk reconfigure`.
......@@ -17,7 +17,7 @@ omniauth:
### Docker
The docker identity provider needs to be configured using your group's callback URL and entity ID.
The docker identity provider needs to be configured using your group's callback URL and entity ID.
For example, an identity provider for the "zebra" group can be ran using the following:
```shell
......
......@@ -20,15 +20,15 @@ DevOps](./auto_devops.md) before following any steps in here.
Alternatively there are some [workarounds to avoid buying a domain
name](#workarounds-to-avoid-buying-a-domain-name) below.
1. Assuming you used a domain name that you own you will then need to setup a
wildcard DNS record that points to the IP address of the Knative ingress.
Once the IP address finishes fetching (usually a few minutes after Knative
intall finishes) then go to your DNS provider and set up a wildcard A record
pointing to this IP address. Assuming you used `example.com` as the domain
for Knative and the IP address is `1.2.3.4` then you need to create an `A`
record like `*.example.com -> 1.2.3.4`.
wildcard DNS record that points to the IP address of the Knative ingress.
Once the IP address finishes fetching (usually a few minutes after Knative
intall finishes) then go to your DNS provider and set up a wildcard A record
pointing to this IP address. Assuming you used `example.com` as the domain
for Knative and the IP address is `1.2.3.4` then you need to create an `A`
record like `*.example.com -> 1.2.3.4`.
1. Now clone [this minimal example ruby
app](https://gitlab.com/gitlab-org/cluster-integration/knative-examples/knative-ruby-app-kubectl)
and push to your project to deploy a Knative service
app](https://gitlab.com/gitlab-org/cluster-integration/knative-examples/knative-ruby-app-kubectl)
and push to your project to deploy a Knative service
## Workarounds to avoid buying a domain name
......
......@@ -26,13 +26,13 @@ The installation of the `charlock_holmes` gem (`0.7.3` or greater) during
[SNIPPED]
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3025:7: error: delegating constructors are permitted only in C++11
UnicodeString(ConstChar16Ptr(text)) {}
^~~~~~~~~~~~~
UnicodeString(ConstChar16Ptr(text)) {}
^~~~~~~~~~~~~
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3087:7: error: delegating constructors are permitted only in C++11
UnicodeString(ConstChar16Ptr(text), length) {}
^~~~~~~~~~~~~
UnicodeString(ConstChar16Ptr(text), length) {}
^~~~~~~~~~~~~
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3180:7: error: delegating constructors are permitted only in C++11
UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
[SNIPPED]
```
......@@ -71,10 +71,10 @@ transliterator.cpp:108:3: error: no template named 'StringByteSink'; did you mea
icu_61::StringByteSink
/usr/local/include/unicode/bytestream.h:232:7: note: 'icu_61::StringByteSink' declared here
class StringByteSink : public ByteSink {
^
^
transliterator.cpp:106:34: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int32_t' (aka 'int') [-Wshorten-64-to-32]
u_txt = new UnicodeString(txt, txt_len);
~~~~~~~~~~~~~ ^~~~~~~
~~~~~~~~~~~~~ ^~~~~~~
1 warning and 9 errors generated.
make: *** [transliterator.o] Error 1
```
......@@ -281,7 +281,7 @@ compiling binder.cpp
In file included from binder.cpp:20:
./project.h:116:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^
^
1 error generated.
make: *** [binder.o] Error 1
......@@ -325,21 +325,21 @@ If building `gpgme` gem fails with an `Undefined symbols for architecture x86_64
1. Ensure necessary dependencies are installed:
```sh
brew install gpgme
```
```sh
brew install gpgme
```
1. (optional) Try building the `gpgme` gem manually to ensure it compiles. If it fails, debug the failure with the error messages. To compile the `gpgme` gem manually run:
```sh
gem install gpgme -- --use-system-libraries
```
```sh
gem install gpgme -- --use-system-libraries
```
1. Configure Bundler to use system libraries for the `gpgme` gem:
```sh
bundle config build.gpgme --use-system-libraries
```
```sh
bundle config build.gpgme --use-system-libraries
```
You can now run `gdk install` or `bundle` again.
......@@ -350,7 +350,7 @@ On macOS, GitLab may fail to start and fail with an error message about
```
LoadError:
dlopen(/Users/janedoe/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
dlopen(/Users/janedoe/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /Users/janedoe/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin15/readline.bundle
Reason: image not found - /Users/janedoe/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin15/readline.bundle
```
......@@ -369,7 +369,7 @@ If for some reason you end up having database migrations that no longer exist
but are present in your database, you might want to remove them.
1. Find the non-existent migrations with `rake db:migrate:status`. You should
see some entries like:
see some entries like:
```
up 20160727191041 ********** NO FILE **********
......@@ -485,7 +485,7 @@ If you still encounter some errors, see the troubleshooting FAQ below:
This means you have not run `npm install` since updating your gitlab CE/EE
repository. The `gdk update` command should have done this for you, but you
can do so manually as well.
* I'm getting the following error when I try to run `gdk run`:
```
......@@ -497,7 +497,7 @@ If you still encounter some errors, see the troubleshooting FAQ below:
14:52:22 webpack.1 | Error: listen EADDRINUSE 127.0.0.1:3808
...
```
This means the port is already in use, probably because webpack failed to
terminate correctly when the GDK was last shutdown. You can find out the pid
of the process using the port with the command `lsof -i :3808`. If you are
......@@ -577,7 +577,7 @@ If you're seeing errors such as:
`ERROR -- : Failure while sending a batch of spans: Failed to open TCP connection to localhost:14268 (Connection refused - connect(2) for "localhost" port 14268)`
This is most likely because Jaeger is not configured in your `$GDKROOT/Procfile`.
The easiest way to fix this is by re-creating your `Procfile` and then running
The easiest way to fix this is by re-creating your `Procfile` and then running
a `gdk reconfigure`:
1. `mv Procfile Procfile.old; make Procfile`
......
......@@ -174,9 +174,9 @@ This was tested on OpenSUSE LEAP 42.1, and Tumbleweed (20161109)
sudo zypper dup
sudo zypper install libxslt-devel postgresql postgresql-devel libpqxx-devel redis libicu-devel nodejs git ed cmake \
rpm-build gcc-c++ krb5-devel postgresql-server postgresql-contrib \
libxml2-devel libxml2-devel-32bit findutils-locate re2 GraphicsMagick \
runit
rpm-build gcc-c++ krb5-devel postgresql-server postgresql-contrib \
libxml2-devel libxml2-devel-32bit findutils-locate re2 GraphicsMagick \
runit
```
On leap 42.1 you also need:
......
......@@ -8,7 +8,7 @@
```
1. Then, **open a separate terminal window** and update gdk along with all its
components:
components:
```
cd <gdk-dir>
......@@ -18,4 +18,4 @@
```
1. Then stop the `gdk run db` process running in the first tab. It must be
restarted once `gdk reconfigure` has been run.
restarted once `gdk reconfigure` has been run.
......@@ -30,13 +30,13 @@ case you should take care to not lose the files if you destroy or update the VM.
To avoid usage of slow VirtualBox shared folders we use NFS here.
1. (optional for Windows users) [Disable Hyper-V](https://superuser.com/a/642027/143551)
then enable virtualization technology via the BIOS.
then enable virtualization technology via the BIOS.
1. Install [VirtualBox] and [Vagrant].
1. [Configure NFS for Vagrant](https://docs.vagrantup.com/v2/synced-folders/nfs.html)
if you are on Linux.
if you are on Linux.
1. Run `vagrant up --provider=virtualbox --provision` in this directory (from an elevated
command prompt if on Windows). Vagrant will download an OS image, bring it
up, and install all the prerequisites.
command prompt if on Windows). Vagrant will download an OS image, bring it
up, and install all the prerequisites.
1. Run `vagrant ssh` to SSH into the box.
1. Continue setup at [Installation](https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/set-up-gdk.md#install-gdk) below.
......@@ -51,9 +51,9 @@ OSes like Windows/OSX you will have to run the entire Docker hypervisor in a VM
1. Install [Vagrant].
1. Install [Docker Engine]. Don't forget to add your user to the docker group
and re-login.
and re-login.
1. Run `vagrant up --provider=docker --provision` in this directory. Vagrant will build a
docker image and start the container.
docker image and start the container.
1. Run `vagrant ssh` to SSH into the container.
1. Continue setup at [Installation](https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/set-up-gdk.md#install-gdk) below.
......
inherit_from: ../gdk-rubocop.yml
\ No newline at end of file
inherit_from: ../gdk-rubocop.yml
......@@ -28,11 +28,11 @@ module GDK
end
directory = ARGV.count == 2 ? ARGV[1] : DEFAULT_INIT_DIRECTORY
if directory.start_with?('-')
puts <<-EOS.gsub(/^\s+\|/, '')
|The gdk directory cannot start with a dash ('-'). Did you mean:
|gdk init #{directory.sub(/^-+/,'')}
EOS
return false
puts <<-EOS.gsub(/^\s+\|/, '')
|The gdk directory cannot start with a dash ('-'). Did you mean:
|gdk init #{directory.sub(/^-+/,'')}
EOS
return false
end
cmd = %W[git clone https://gitlab.com/gitlab-org/gitlab-development-kit.git #{directory}]
system(*cmd) && trust!(directory) && remember!(directory)
......
......@@ -7,7 +7,7 @@ objectClass: dcObject
objectclass: organization
o: Example Organization
dc: Example
description: LDAP Example
description: LDAP Example
# Admin user.
dn: cn=admin,dc=example,dc=com
......
......@@ -73,7 +73,7 @@ postalAddress:
initials: JD
<% end %>
<%
<%
(1...user_count.to_s.length).each do |group_size|
group_size = 10 ** group_size
(user_count/group_size + 1).times do |group_count|
......
......@@ -244,6 +244,3 @@ mode = console
[dashboards.json]
enabled = true
path = /home/git/grafana/grafana-dashboards/dashboards
inherit_from: ../gdk-rubocop.yml
\ No newline at end of file
inherit_from: ../gdk-rubocop.yml
......@@ -12,20 +12,20 @@ module GDK
exec_env(argv)
end
end
private
def print_env
env.each do |k, v|
puts "export #{Shellwords.shellescape(k)}=#{Shellwords.shellescape(v)}"
end
end
def exec_env(argv)
# Use Kernel:: namespace to avoid recursive method call
Kernel::exec(env, *argv)
end
def env
case get_project
when 'gitaly'
......@@ -38,7 +38,7 @@ module GDK
{}
end
end
def get_project
relative_path = Pathname.new(Dir.pwd).relative_path_from(Pathname.new($gdk_root)).to_s
relative_path.split('/').first
......
......@@ -4,7 +4,7 @@ global:
# Attach these labels to any time series or alerts when communicating with
# # external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'gdk-monitor'
monitor: 'gdk-monitor'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
......@@ -22,4 +22,3 @@ scrape_configs:
scrape_interval: 5s
static_configs:
- targets: ['docker.for.mac.localhost:9236']
inherit_from: ../gdk-rubocop.yml
\ No newline at end of file
inherit_from: ../gdk-rubocop.yml
......@@ -9,14 +9,13 @@ if [[ "${registry_enabled}" == "true" ]]; then
fi
exec docker run --rm -p ${registry_port:-5000}:5000 ${run_opts} \
-v $(pwd)/registry/config.yml:/etc/docker/registry/config.yml \
-v $(pwd)/registry/storage:/var/lib/registry \
-v $(pwd)/localhost.crt:/root/certs/certbundle \
registry:2
-v $(pwd)/registry/config.yml:/etc/docker/registry/config.yml \
-v $(pwd)/registry/storage:/var/lib/registry \
-v $(pwd)/localhost.crt:/root/certs/certbundle \
registry:2
else
echo "Docker registry disabled."
# If we exit now, Foreman will shut down all our sibling process too.
# We want to block until Foreman signals us to exit.
tail -f /dev/null
fi
......@@ -6,11 +6,10 @@ os_port=$(cat object_store_port 2>/dev/null)
if [[ "${os_enabled}" == "true" ]]; then
exec env MINIO_REGION=gdk MINIO_ACCESS_KEY=minio MINIO_SECRET_KEY=gdk-minio minio server \
-C minio/config --address "127.0.0.1:${os_port:-9000}" minio/data
-C minio/config --address "127.0.0.1:${os_port:-9000}" minio/data
else
echo "Object Storage disabled."
# If we exit now, Foreman will shut down all our sibling process too.
# We want to block until Foreman signals us to exit.
tail -f /dev/null
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment