I am writing this blog after my struggle to install google cloud SDK in macOS (Sierra).
1. First download the official Google Cloud SDK archive file from here.
2. Unzip the archive and save it at your desired folder.
3. Now open the folder which contains your unzipped
google-cloud-sdk folder in terminal.
4. Run the command
sh ./google-cloud-sdk/install.sh and give yes to all further prompts and you are done.
Now, just type
gcloud -v to verify your installation. If you find your gcloud version in your terminal, then you have successfully installed google cloud sdk.
Now the command
gcloud will be available globally anywhere in your terminal!
install.sh has python problems when installing Google Cloud SDK on OS X
We can easily deploy our code from Gitlab repository to our FTP server by using Gitlab CI (Continuous Integration).
But What is Gitlab CI?
GitLab CI/CD is a part of GitLab, a web application with an API that stores its state in a database. It manages projects/builds and provides a nice user interface, besides all the features of GitLab. It is very useful for automating your deployment workflow.
It can do lot of things like Continuous Integration, Continuous Deployment, and Continuous Delivery support to build, test, and deploy your application.
But, today we gonna automate our task of Uploading last changed files to our FTP server by configuring Gitlab CI.
Let’s start by first creating a file named .gitlab-ci.yml in your root folder.
Then add the following code in your .gitlab-ci.yml file.
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev ./ ./public_html --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"
The above code will push all your recently modified files in your Gitlab repository into public_html folder in your FTP Server root.
Just update the variables HOST, USERNAME and PASSWORD with your FTP Credentials and commit this file to your Gitlab Repository, you are good to go.
Now whenever you make changes in your master branch, Gitlab will automatically push your changes to your remote FTP server.
Feel free to get in touch with me, as I am more interested in meeting people with same interests like me. Please check the console log of contact page to find my Whatsapp number and ping me 😉