Step 5 added to install gitlab via composer
This commit is contained in:
15
5-install-gitlab-via-composer.sh
Executable file
15
5-install-gitlab-via-composer.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
# Next up we need to copy file to gloud vm
|
||||||
|
|
||||||
|
|
||||||
|
# Retrieve the vm name
|
||||||
|
export gcp_machine_name=$(gcloud compute instances list --limit=1 --format='value(name.basename())')
|
||||||
|
|
||||||
|
# Copy file to vm
|
||||||
|
gloud compute scp docker-compose.yaml $gcp_machine_name --ssh-key-file ~/.ssh/$USER --strict-host-key-checking=no
|
||||||
|
|
||||||
|
# Install gotlan with docker compose
|
||||||
|
sleep 2
|
||||||
|
gcloud compute ssh $gcp_machine_name --ssh-key-file ~/.ssh/$USER -- 'sudo docker compose up -d'
|
||||||
22
README.org
22
README.org
@ -78,6 +78,7 @@ name: projects/gitlab-gcp-1611720361/billingInfo
|
|||||||
projectId: gitlab-gcp-1611720361
|
projectId: gitlab-gcp-1611720361
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
* Step 3 - Create vertual machine
|
* Step 3 - Create vertual machine
|
||||||
|
|
||||||
Once we have a project we can create a new virtual machine. To create a virtual machine we need to ensure compute engine apis are enabled.
|
Once we have a project we can create a new virtual machine. To create a virtual machine we need to ensure compute engine apis are enabled.
|
||||||
@ -122,17 +123,17 @@ Next step to create docker compose file for gitlab
|
|||||||
|
|
||||||
#+begin_src yaml :tangle docker-compose.yaml
|
#+begin_src yaml :tangle docker-compose.yaml
|
||||||
web:
|
web:
|
||||||
image: 'gitlab/gitlab-ee:latest'
|
image: 'gitlab/gitlab-ce:latest'
|
||||||
restart: always
|
restart: always
|
||||||
hostname: 'gitlab.example.com'
|
hostname: 'gitlab.example.com'
|
||||||
environment:
|
environment:
|
||||||
GITLAB_OMNIBUS_CONFIG: |
|
GITLAB_OMNIBUS_CONFIG: |
|
||||||
external_url 'https://gitlab.example.com'
|
external_url 'https://gitlab.example.com:3200'
|
||||||
# Add any other gitlab.rb configuration here, each on its own line
|
# Add any other gitlab.rb configuration here, each on its own line
|
||||||
ports:
|
ports:
|
||||||
- '80:80'
|
- '3200:3200'
|
||||||
- '443:443'
|
- '443:443'
|
||||||
- '22:22'
|
- '2222:22'
|
||||||
volumes:
|
volumes:
|
||||||
- '$GITLAB_HOME/config:/etc/gitlab'
|
- '$GITLAB_HOME/config:/etc/gitlab'
|
||||||
- '$GITLAB_HOME/logs:/var/log/gitlab'
|
- '$GITLAB_HOME/logs:/var/log/gitlab'
|
||||||
@ -140,6 +141,19 @@ Next step to create docker compose file for gitlab
|
|||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Next up we need to copy file to gloud vm
|
||||||
|
|
||||||
|
#+begin_src bash :shebang #!/bin/bash :tangle 5-install-gitlab-via-composer.sh
|
||||||
|
# Retrieve the vm name
|
||||||
|
export gcp_machine_name=$(gcloud compute instances list --limit=1 --format='value(name.basename())')
|
||||||
|
|
||||||
|
# Copy file to vm
|
||||||
|
gloud compute scp docker-compose.yaml $gcp_machine_name --ssh-key-file ~/.ssh/$USER --strict-host-key-checking=no
|
||||||
|
|
||||||
|
# Install gotlan with docker compose
|
||||||
|
sleep 2
|
||||||
|
gcloud compute ssh $gcp_machine_name --ssh-key-file ~/.ssh/$USER -- 'sudo docker compose up -d'
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
* Step 6 - Teardown cloud resources
|
* Step 6 - Teardown cloud resources
|
||||||
|
|||||||
@ -4,17 +4,17 @@
|
|||||||
|
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: 'gitlab/gitlab-ee:latest'
|
image: 'gitlab/gitlab-ce:latest'
|
||||||
restart: always
|
restart: always
|
||||||
hostname: 'gitlab.example.com'
|
hostname: 'gitlab.example.com'
|
||||||
environment:
|
environment:
|
||||||
GITLAB_OMNIBUS_CONFIG: |
|
GITLAB_OMNIBUS_CONFIG: |
|
||||||
external_url 'https://gitlab.example.com'
|
external_url 'https://gitlab.example.com:3200'
|
||||||
# Add any other gitlab.rb configuration here, each on its own line
|
# Add any other gitlab.rb configuration here, each on its own line
|
||||||
ports:
|
ports:
|
||||||
- '80:80'
|
- '3200:3200'
|
||||||
- '443:443'
|
- '443:443'
|
||||||
- '22:22'
|
- '2222:22'
|
||||||
volumes:
|
volumes:
|
||||||
- '$GITLAB_HOME/config:/etc/gitlab'
|
- '$GITLAB_HOME/config:/etc/gitlab'
|
||||||
- '$GITLAB_HOME/logs:/var/log/gitlab'
|
- '$GITLAB_HOME/logs:/var/log/gitlab'
|
||||||
|
|||||||
Reference in New Issue
Block a user