Skip to content

Commit

Permalink
Merge pull request #64 from star3am/feature/jenkins-updates
Browse files Browse the repository at this point in the history
uplift jenkins integration
  • Loading branch information
star3am authored Aug 28, 2024
2 parents 9771ed1 + 11091e8 commit 84ba7ef
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions jenkins/jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ yes | sudo docker system prune --volumes
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Start Jenkins"
echo -e '\e[38;5;198m'"++++ "
sudo docker run -d -p 8088:8088 -e JENKINS_OPTS="--httpPort=8088" --memory 1024M --restart always --name jenkins -v /var/jenkins_home:/var/jenkins_home jenkins/jenkins:lts
sudo docker run -d -p 8088:8088 -e JENKINS_OPTS="--httpPort=8088" --memory 1024M --restart always --name jenkins -v /vagrant/jenkins/jenkins_home:/var/jenkins_home jenkins/jenkins:lts
sleep 20

echo -e '\e[38;5;198m'"++++ "
Expand All @@ -29,10 +29,9 @@ sudo bash /vagrant/vault/vault.sh
fi

echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Using the root Vault token, add a Secret in Vault which Jenkins will retrieve"
echo -e '\e[38;5;198m'"++++ Ensure Environment Variables from /etc/environment"
echo -e '\e[38;5;198m'"++++ "
# add vault ENV variables
VAULT_TOKEN=$(grep 'Initial Root Token' /etc/vault/init.file | cut -d ':' -f2 | tr -d ' ')
set -a; source /etc/environment; set +a;

echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ vault secrets enable -path=kv1 kv1"
Expand Down Expand Up @@ -69,4 +68,4 @@ vault kv get kv1/secret/testing/value_two
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ To use Jenkins please open in your browser"
echo -e '\e[38;5;198m'"++++ http://localhost:8088"
echo -e '\e[38;5;198m'"++++ Login with username: admin and password: `sudo cat /var/jenkins_home/secrets/initialAdminPassword`"
echo -e '\e[38;5;198m'"++++ Login with username: admin and password: `sudo cat /vagrant/jenkins/jenkins_home/secrets/initialAdminPassword`"

0 comments on commit 84ba7ef

Please sign in to comment.