diff --git a/.devcontainer/code_space.sh b/.devcontainer/code_space.sh index 35800cf..f6b8117 100755 --- a/.devcontainer/code_space.sh +++ b/.devcontainer/code_space.sh @@ -138,7 +138,7 @@ pip3 install hvac echo "============" -echo "Install tfupdate +echo "Install tfupdate" $REPO="minamijoyo/tfupdate" $LATEST=getLatestRepoVersion "${REPO}" wget https://github.com/${REPO}/releases/${LATEST}/download/tfupdate_${LATEST}_linux_amd64.tar.gz @@ -149,28 +149,26 @@ echo "============" echo "Install ACT" cd /workspaces/BonkeyWonkers/exercise7 -# git clone https://github.com/nektos/act.git -# cd act -# sudo make test -# sudo make install -# cd .. -# rm -rf act +# https://github.com/nektos/act.git] wget https://github.com/nektos/act/releases/latest/download/act_Linux_x86_64.tar.gz sudo tar -xvlsf act_Linux_x86_64.tar.gz -C /usr/local/bin act act --version rm -rf act_Linux_x86_64.tar.gz git clone https://github.com/cplee/github-actions-demo.git + echo "Building container for using act local" docker build --platform linux/amd64 -t act-local . docker tag act-local:latest localhost:5000/act-local:latest + echo "Pushing container to local registry" docker image push localhost:5000/act-local:latest + echo "Configuring act to use local container" cat < ~/.actrc -P ubuntu-latest=localhost:5000/act-local:latest EOF -#echo 'export DOCKER_HOST=$(docker context inspect --format '\''{{.Endpoints.docker.Host}}'\'')' >> ~/.bashrc +# echo 'export DOCKER_HOST=$(docker context inspect --format '\''{{.Endpoints.docker.Host}}'\'')' >> ~/.bashrc export DOCKER_HOST=$(docker context inspect --format '\''{{.Endpoints.docker.Host}}'\') echo "testing act" echo | act -C github-actions-demo diff --git a/exercise4/README.md b/exercise4/README.md index c4ee55e..b971654 100644 --- a/exercise4/README.md +++ b/exercise4/README.md @@ -27,17 +27,6 @@ If on codespaces: 1. hover over `forwarded address` for the port Labeled Grafana (3000) 1. click middle icon -## Login to grafana - -- username is admin -- password is admin -- When asked to enter a new password click `skip` - -## Setup Data Source - -- Import prometheus data source -- The url will be: - ## Create a dashboard 1. Create a dashboard(s) that shows: diff --git a/exercise4/datasource.yaml b/exercise4/datasource.yaml new file mode 100644 index 0000000..22b668e --- /dev/null +++ b/exercise4/datasource.yaml @@ -0,0 +1,15 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + uid: prometheus + access: proxy + orgId: 1 + url: http://prometheus:9090 + basicAuth: false + isDefault: false + version: 1 + editable: false + jsonData: + httpMethod: GET diff --git a/exercise4/docker-compose.yml b/exercise4/docker-compose.yml index 7318151..b7a358f 100644 --- a/exercise4/docker-compose.yml +++ b/exercise4/docker-compose.yml @@ -59,7 +59,8 @@ services: environment: - GF_INSTALL_PLUGINS=grafana-clock-panel volumes: - - grafana-storage:/var/lib/grafana + - ./datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml + - ./grafana.ini:/etc/grafana/grafana.ini vault: image: hashicorp/vault:latest @@ -93,7 +94,3 @@ services: ports: - 5000:5000 restart: always - - -volumes: - grafana-storage: {} diff --git a/exercise4/grafana.ini b/exercise4/grafana.ini new file mode 100644 index 0000000..fe96625 --- /dev/null +++ b/exercise4/grafana.ini @@ -0,0 +1,12 @@ +instance_name = "grafana" + +[auth.anonymous] +enabled = true +org_role = Admin + +[log.console] +level = error + +[analytics] +reporting_enabled = false +check_for_updates = false diff --git a/exercise7/README.md b/exercise7/README.md index 103dbf9..ef4aedf 100644 --- a/exercise7/README.md +++ b/exercise7/README.md @@ -33,11 +33,11 @@ exits successfully if the [Bonkey Containers File](./BonkeyContainers.yaml) is p ```code -cd /workspaces/BonkeyWonkers/exercise6 -docker build -t act-local . -docker tag act-local:latest localhost:5000/act-local:latest -docker image push localhost:5000/act-local:latest -cd /workspaces/BonkeyWonkers + cd /workspaces/BonkeyWonkers/exercise7 + docker build -t act-local:latest . + docker tag act-local:latest localhost:5000/act-local:latest + docker image push localhost:5000/act-local:latest + cd /workspaces/BonkeyWonkers ``` diff --git a/exercise8/README.md b/exercise8/README.md index 15cbe27..f990288 100644 --- a/exercise8/README.md +++ b/exercise8/README.md @@ -36,11 +36,11 @@ Cat the file to demonstrate the change ```code -cd /workspaces/BonkeyWonkers/exercise6 -docker build -t act-local . -docker tag act-local:latest localhost:5000/act-local:latest -docker image push localhost:5000/act-local:latest -cd /workspaces/BonkeyWonkers + cd /workspaces/BonkeyWonkers/exercise8 + docker build -t act-local:latest . + docker tag act-local:latest localhost:5000/act-local:latest + docker image push localhost:5000/act-local:latest + cd /workspaces/BonkeyWonkers ``` diff --git a/exercise9/README.md b/exercise9/README.md index 5275f84..dce4004 100644 --- a/exercise9/README.md +++ b/exercise9/README.md @@ -41,11 +41,11 @@ to `update` job. ```code -cd /workspaces/BonkeyWonkers/exercise6 -docker build -t act-local . -docker tag act-local:latest localhost:5000/act-local:latest -docker image push localhost:5000/act-local:latest -cd /workspaces/BonkeyWonkers + cd /workspaces/BonkeyWonkers/exercise9 + docker build -t act-local:Latest . + docker tag act-local:latest localhost:5000/act-local:latest + docker image push localhost:5000/act-local:latest + cd /workspaces/BonkeyWonkers ```