Skip to content

Commit

Permalink
Bug fixes (#35)
Browse files Browse the repository at this point in the history
* fixing doc

* formatting update

* simplify startup of grafana exercise

* linted

* fix syntax error

---------

Co-authored-by: Larry Lane <[email protected]>
  • Loading branch information
gamethis and Larry Lane authored Jul 23, 2024
1 parent e0bc80a commit 7de3dcc
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 39 deletions.
14 changes: 6 additions & 8 deletions .devcontainer/code_space.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <<EOF > ~/.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
Expand Down
11 changes: 0 additions & 11 deletions exercise4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <http://prometheus:9090>

## Create a dashboard

1. Create a dashboard(s) that shows:
Expand Down
15 changes: 15 additions & 0 deletions exercise4/datasource.yaml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 2 additions & 5 deletions exercise4/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -93,7 +94,3 @@ services:
ports:
- 5000:5000
restart: always


volumes:
grafana-storage: {}
12 changes: 12 additions & 0 deletions exercise4/grafana.ini
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions exercise7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ exits successfully if the [Bonkey Containers File](./BonkeyContainers.yaml) is p
</summary>

```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
```

</details>
Expand Down
10 changes: 5 additions & 5 deletions exercise8/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Cat the file to demonstrate the change
</summary>

```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
```

</details>
Expand Down
10 changes: 5 additions & 5 deletions exercise9/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ to `update` job.
</summary>

```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
```

</details>
Expand Down

0 comments on commit 7de3dcc

Please sign in to comment.