Skip to content

Commit

Permalink
added exercise files
Browse files Browse the repository at this point in the history
  • Loading branch information
TomPughe committed Jun 17, 2024
1 parent f391ed7 commit 595c681
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 34 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build-tomcat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Tomcat

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Check out tomcat-users.xml
uses: actions/checkout@v2

- name: List project files and java version
run: |
ls -ltr
java -version
- name: Check out Apache Tomcat
uses: actions/checkout@v2
with:
repository: apache/tomcat # Repository name with owner
ref: master # The branch, tag or SHA to checkout
path: ./tomcat # Relative path under $GITHUB_WORKSPACE

- name: Setup Java 9
uses: actions/setup-java@v1
with:
java-version: '9.0.4' # The JDK version to make available on the path
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64

- name: List project files and java version
run: |
ls -ltr
java -version
- name: Copy tomcat-users.xml into Tomcat configuration directory
run: cp -v tomcat-users.xml ./tomcat/conf/tomcat-users.xml

- name: Compile Tomcat
run: |
cd ./tomcat
ant
21 changes: 0 additions & 21 deletions .github/workflows/first.yml

This file was deleted.

57 changes: 44 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,53 @@
# Chapter 01_01
# Passing arguments to an action

- Create a repository on GitHub using the [New Repository](https://github.com/new) page. Name it something that relates to the lesson like `exercise-files`.
In this lesson, arguments are passed to the following actions:

- In a terminal, run the following commands to initialize the directory as a git repository.
- [actions/checkout](https://github.com/actions/checkout)
- [actions/setup-java](https://github.com/actions/setup-java)

git init
git add .
git commit -m 'first check in'
```
name: Build Tomcat
- Now add the new repository you created as a remote for the local repo.
on: [push]
git remote add origin [email protected]:YOUR_GITHUB_USER_NAME_HERE/exercise-files.git
jobs:
build:
- After the remote is added, push the files to the remote.
runs-on: ubuntu-latest
git push -u origin master
steps:
- name: Check out tomcat-users.xml
uses: actions/checkout@v2
- Browse to the repository on GitHub.com and reload the page to confirm the files have been properly pushed.
- name: List project files and java version
run: |
ls -ltr
java -version
Once the files are hosted on GitHub.com, you're ready to start making changes locally and pushing them to the remote repo.
# GA-lesson-01-01
- name: Check out Apache Tomcat
uses: actions/checkout@v2
with:
repository: apache/tomcat # Repository name with owner
ref: master # The branch, tag or SHA to checkout
path: ./tomcat # Relative path under $GITHUB_WORKSPACE
- name: Setup Java 9
uses: actions/setup-java@v1
with:
java-version: '9.0.4' # The JDK version to make available on the path
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- name: List project files and java version
run: |
ls -ltr
java -version
- name: Copy tomcat-users.xml into Tomcat configuration directory
run: cp -v tomcat-users.xml ./tomcat/conf/tomcat-users.xml
- name: Compile Tomcat
run: |
cd ./tomcat
ant
```
24 changes: 24 additions & 0 deletions tomcat-users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>

<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">

<role rolename="manager-gui"/>

<role rolename="manager-script"/>

<role rolename="manager-jmx"/>

<role rolename="manager-status"/>

<role rolename="admin-gui"/>

<role rolename="admin-script"/>

<user username="superadmin"
password="shouldreallychangethis"
roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>

</tomcat-users>

0 comments on commit 595c681

Please sign in to comment.