How to install helm in travis pipeline - continuous-integration

I am doing this to install helm in my travis job
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
And when the command helm init --client-only runs in the travis, it says
Not Really a helm install
Can someone help me out in this?

This command is the correct way to install helm in the Travis pipeline:
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
And then you can check by using
helm version

As Installing Helm chapter from the official Helm guide says:
Download your desired version from here
Unpack it (tar -zxvf helm-v3.0.0-linux-amd64.tar.gz)
Find the helm binary in the unpacked directory, and move it to its desired destination (mv Linux-amd64/helm /usr/local/bin/helm).
From there, you should be able to run the client and add the stable repo : helm help

Related

VMSS Custom script not fully executing

We are currently experimenting with new VMSS build agents for our devops environment, which requires some components for each build pipeline.
So to make sure don't need to add this to every build pipeline, we created a startup script which is executed every time the machine is created (standard custom script extension) with the following contents
#install kubectl
echo "Installing KubeCTL"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
echo "Installing DotNet SDK"
#install dotnet runtime (5) for dotnet tool install
sudo apt-get install -y dotnet-sdk-5.0
echo "Installing DotNet DotNet Runtime"
#install dotnet runtime (5) for FluentMigrator
sudo apt-get install -y dotnet-runtime-5.0
echo "Installing DotNet AzureCLI"
#install AzureCLI
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
echo "Installing Powershell"
#install powershell
# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common
# Download the Microsoft repository GPG keys
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of packages after we added packages.microsoft.com
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
echo "Installing FluentMigrator"
#install fluent migrator
dotnet tool install -g FluentMigrator.DotNet.Cli
echo "Installing OpenJDK"
#install openJDK
sudo apt-get install -y openjdk-11-jre
Now, everything in this script executes and installs without any issues, the build pipeline runs correctly after a new agent is booted up.
However, during release time, we require fluentmigrator, which is not installed even though it is included in the script.
If we add the same install line dotnet tool install -g FluentMigrator.DotNet.Cli as a build step or as a step during release it gets installed correctly. To do this we run a custom bash with the command.
However, i would very much prefer to have this run within the boot-up of the machine instead of adding a custom bash script to 20 release pipelines. Anyone has any idea why the tool is not installing correctly within this script?

How to install a particular version of helm?

I am installing helm through a script which uses these commands to install the latest version -
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3.2.0
chmod 700 get_helm.sh
./get_helm.sh
however , i don't want it to install the latest versions always. how can i install the version v3.2.4 always?
You can find all the versions of helm binaries on Helm Releases page
If you want to install v3.2.4
$ wget https://get.helm.sh/helm-v3.2.4-linux-amd64.tar.gz
$ tar -zxvf helm-v3.2.4-linux-amd64.tar.gz
$ sudo mv linux-amd64/helm /usr/local/bin/helm
$ helm version
version.BuildInfo{Version:"v3.2.4", GitCommit:"0ad800ef43d3b826f31a5ad8dfbb4fe05d143688", GitTreeState:"clean", GoVersion:"go1.13.12"}
Documentation
It is possible to use the DESIRED_VERSION environment variable to specify the version (by github tag) that should be installed by the get_helm.sh script.
curl -fsSL -o get_helm.sh \
https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
DESIRED_VERSION=v3.2.4 ./get_helm.sh
helm version
console output:
Helm v3.2.4 is available. Changing from version v3.5.0.
Downloading https://get.helm.sh/helm-v3.2.4-linux-amd64.tar.gz
Verifying checksum... Done.
Preparing to install helm into /usr/local/bin
helm installed into /usr/local/bin/helm
...
version.BuildInfo{Version:"v3.2.4",
GitCommit:"0ad800ef43d3b826f31a5ad8dfbb4fe05d143688",
GitTreeState:"clean", GoVersion:"go1.13.12"}
Use --version option to specify desired version
$ ./get_helm.sh -h
Accepted cli arguments are:
[--help|-h ] ->> prints this help
[--version|-v <desired_version>] . When not defined it fetches the latest release from GitHub e.g. --version v3.0.0 or -v canary
[--no-sudo] ->> install without sudo

Can I install bazel on Ubuntu 18.04.1?

I just want to know, if it's possible to install Bazel in Ubuntu 18.04.1 LTS. Thank you for your answers
Bazel is officially supported on 18.04. It's not reflected on the documentation yet, but it's fully tested on the Bazel CI.
You can just follow the below codes to run bazel on 16.04
$ sudo apt-get install openjdk-8-jdk
$ echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
$ curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install bazel
You can but it is not supported, if you have a look at the Documentation.

About install jenkins on my local ubuntu 17.10 machine

I'm trying to install jenkins locally
I try these steps:-
1) wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo
apt-key add -
2) echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee
/etc/apt/sources.list.d/jenkins.list
3) sudo apt-get update
then i get this error:-
E: Malformed entry 1 in list file /etc/apt/sources.list.d/elastic-
5.4.1.list (Suite)
E: The list of sources could not be read.
I try to change the mode of this file but i can't do.this is only readable file.
In elastic-5.4.1.list I find this thing:-
deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-
5.4.1.deb
Your elasticsearch apt source file (elastic-5.4.1.list) is not correct. It must have this format:
deb https://artifacts.elastic.co/packages/6.x/apt stable main
Once you fix that line, make sure you update your apt repository:
apt-get update
Refer to documentation for details: https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

Error in build from Dockerfile for Ubuntu image with Mono installed

I have the following docker file that I am attempting to use to build a Ubuntu image with mono.
FROM ubuntu:14.04
MAINTAINER John Smith <John.Smith#gmail.com>
RUN sudo apt-get update
RUN sudo /bin/bash -l -c apt-get install wget
RUN sudo /bin/bash -l -c apt-get http://download.mono-project.com/repo/xamarin.gpg
RUN sudo apt-key add xamarin.gpg
RUN sudo echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
RUN sudo apt-get update
RUN sudo apt-get install mono-complete
When I run the following docker build command...
docker build -t="test/mono" .
It fails building and gives the following errors message:
gpg:can't open 'xamaring.gpg': No such file or directory.
2015/05/27 16:11:01 The command [/bin/bash -c sudo apt-key add xamarin.gpg] returned a non-zero code: 2
Anything obviously wrong sticking out?
It looks like you forgot to use wget instead of apt-get after you installed wget, so 'xamaring.gpg' has not been downloaded and that's why it can't be found.
You need this:
/bin/bash -l -c "wget http://download.mono-project.com/repo/xamarin.gpg"
The is an example of this in docker's website:
Dockerizing MongoDB

Resources